From 1207735f05f202b5bdc5f70c73445f8e0934a227 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Tue, 6 Mar 2012 14:44:30 -0800 Subject: IO --- js/helper-classes/RDGE/Materials/UberMaterial.js | 37 +++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'js/helper-classes/RDGE/Materials/UberMaterial.js') diff --git a/js/helper-classes/RDGE/Materials/UberMaterial.js b/js/helper-classes/RDGE/Materials/UberMaterial.js index 570d3326..1652b4c9 100755 --- a/js/helper-classes/RDGE/Materials/UberMaterial.js +++ b/js/helper-classes/RDGE/Materials/UberMaterial.js @@ -430,11 +430,22 @@ function UberMaterial() this._materialNode.setShader(this._shader); }; + this.import = function( importStr ) + { + // limit the key searches to this material + var endKey = "endMaterial\n"; + var index = importStr.indexOf( endKey ); + index += endKey.length; + importStr = importStr.substr( index ); + } + this.export = function() { // every material needs the base type and instance name var exportStr = "material: " + this.getShaderName() + "\n"; exportStr += "name: " + this.getName() + "\n"; + + var caps = this._ubershaderCaps; // export the material properties if (typeof caps.material != 'undefined') @@ -452,8 +463,32 @@ function UberMaterial() var t; for (var i=0; i