aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/backup-delete/GLGeomObj.js
diff options
context:
space:
mode:
authorEric Guzman2012-03-13 13:12:43 -0700
committerEric Guzman2012-03-13 13:12:43 -0700
commit61fd46cad105f0a52afa028e5301b96120f00ab4 (patch)
treed8a7e23e1ea7d9b5c64a288822b7797bb19e50d4 /js/helper-classes/backup-delete/GLGeomObj.js
parent7e3161153b87b891875ac65368a19aed12909fa3 (diff)
parentf56b8cf4d3316d250c0f0045fb78f0dbd5c56e94 (diff)
downloadninja-61fd46cad105f0a52afa028e5301b96120f00ab4.tar.gz
Merge branch 'refs/heads/master' into CSSPanelUpdates
Conflicts: js/controllers/styles-controller.js
Diffstat (limited to 'js/helper-classes/backup-delete/GLGeomObj.js')
-rwxr-xr-xjs/helper-classes/backup-delete/GLGeomObj.js46
1 files changed, 46 insertions, 0 deletions
diff --git a/js/helper-classes/backup-delete/GLGeomObj.js b/js/helper-classes/backup-delete/GLGeomObj.js
index 8946470d..54933590 100755
--- a/js/helper-classes/backup-delete/GLGeomObj.js
+++ b/js/helper-classes/backup-delete/GLGeomObj.js
@@ -158,6 +158,52 @@ function GLGeomObj()
158 return fillMaterial; 158 return fillMaterial;
159 } 159 }
160 160
161 this.exportMaterials = function()
162 {
163 var rtnStr = "";
164 if (this._materialArray && this._materialNodeArray)
165 {
166 var nMats = this._materialArray.length;
167 rtnStr += "nMaterials: " + nMats + "\n";
168 for (var i=0; i<nMats; i++)
169 {
170 var matNode = this._materialNodeArray[i];
171 rtnStr += "materialNodeName: " + matNode.name + "\n";
172
173 var material = this._materialArray[i];
174 rtnStr += material.export();
175 }
176 }
177 else
178 rtnStr += "nMaterials: 0\n" ;
179
180 return rtnStr;
181 }
182
183 this.importMaterials = function(importStr)
184 {
185 var nMaterials = Number( this.getPropertyFromString( "nMaterials: ", importStr ) );
186 for (var i=0; i<nMaterials; i++)
187 {
188 var mat;
189 var materialType = this.getPropertyFromString( "material: ", importStr );
190 switch (materialType)
191 {
192 case "flat": mat = new FlatMaterial(); break;
193
194 default:
195 console.log( "material type: " + materialType + " is not supported" );
196 break;
197 }
198
199 if (mat)
200 mat.import( importStr );
201
202 var endIndex = importStr.indexOf( "endMaterial\n" );
203 if (endIndex < 0) break;
204 importStr = importStr.substr( endIndex );
205 }
206 }
161 207
162 this.translate = function(v) 208 this.translate = function(v)
163 { 209 {