aboutsummaryrefslogtreecommitdiff
path: root/js/lib/geom/geom-obj.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-06-20 11:17:47 -0700
committerValerio Virgillito2012-06-20 11:17:47 -0700
commit3f5aa43b5b545cd551c5585ef5f2d478c2d49cad (patch)
treefe5beec45a8d7f45a90659e95c4f13a679ae35d5 /js/lib/geom/geom-obj.js
parent5c4ff40d7950282a179dcfd49c5ea9234e0a8185 (diff)
parentfcb6309915161d16a74a4385b905742f35b7d62d (diff)
downloadninja-3f5aa43b5b545cd551c5585ef5f2d478c2d49cad.tar.gz
Merge branch 'refs/heads/master' into montage-v11-integration
Conflicts: js/io/system/ninjalibrary.json Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/lib/geom/geom-obj.js')
-rwxr-xr-xjs/lib/geom/geom-obj.js29
1 files changed, 22 insertions, 7 deletions
diff --git a/js/lib/geom/geom-obj.js b/js/lib/geom/geom-obj.js
index 4cb21a25..3a7a5619 100755
--- a/js/lib/geom/geom-obj.js
+++ b/js/lib/geom/geom-obj.js
@@ -180,7 +180,7 @@ exports.GeomObj = Object.create(Object.prototype, {
180 /////////////////////////////////////////////////////////////////////// 180 ///////////////////////////////////////////////////////////////////////
181 // Methods 181 // Methods
182 /////////////////////////////////////////////////////////////////////// 182 ///////////////////////////////////////////////////////////////////////
183 setMaterialColor: { 183 setMaterialColor: {
184 value: function(c, type) { 184 value: function(c, type) {
185 var i = 0, 185 var i = 0,
186 nMats = 0; 186 nMats = 0;
@@ -281,9 +281,13 @@ exports.GeomObj = Object.create(Object.prototype, {
281 this._materialArray.push(strokeMaterial); 281 this._materialArray.push(strokeMaterial);
282 this._materialTypeArray.push("stroke"); 282 this._materialTypeArray.push("stroke");
283 283
284 if (this._strokeColor) { 284 // don't set the value here. The material editor may set a color directly
285 this.setStrokeColor(this._strokeColor); 285 // to the material without setting this value in the obj. The following
286 } 286 // lines of code will clobber the value in the material
287 //if (this._strokeColor)
288 // this.setStrokeColor(this._strokeColor);
289
290 this._strokeMaterial = strokeMaterial;
287 291
288 return strokeMaterial; 292 return strokeMaterial;
289 } 293 }
@@ -304,10 +308,14 @@ exports.GeomObj = Object.create(Object.prototype, {
304 308
305 this._materialArray.push(fillMaterial); 309 this._materialArray.push(fillMaterial);
306 this._materialTypeArray.push("fill"); 310 this._materialTypeArray.push("fill");
311
312 // don't set the value here. The material editor may set a color directly
313 // to the material without setting this value in the obj. The following
314 // lines of code will clobber the value in the material
315 //if (this._fillColor)
316 // this.setFillColor(this._fillColor);
307 317
308 if (this._fillColor) { 318 this._fillMaterial = fillMaterial;
309 this.setFillColor(this._fillColor);
310 }
311 319
312 return fillMaterial; 320 return fillMaterial;
313 } 321 }
@@ -315,6 +323,8 @@ exports.GeomObj = Object.create(Object.prototype, {
315 323
316 exportMaterialsJSON: { 324 exportMaterialsJSON: {
317 value: function() { 325 value: function() {
326 MaterialsModel = require("js/models/materials-model").MaterialsModel;
327
318 var jObj; 328 var jObj;
319 if (this._materialArray && this._materialNodeArray && this.getWorld().isWebGL()) { 329 if (this._materialArray && this._materialNodeArray && this.getWorld().isWebGL()) {
320 var nMats = this._materialArray.length; 330 var nMats = this._materialArray.length;
@@ -345,6 +355,8 @@ exports.GeomObj = Object.create(Object.prototype, {
345 355
346 importMaterialsJSON: { 356 importMaterialsJSON: {
347 value: function(jObj) { 357 value: function(jObj) {
358 MaterialsModel = require("js/models/materials-model").MaterialsModel;
359
348 this._materialArray = []; 360 this._materialArray = [];
349 this._materialTypeArray = []; 361 this._materialTypeArray = [];
350 362
@@ -370,6 +382,7 @@ exports.GeomObj = Object.create(Object.prototype, {
370 case "tunnel": 382 case "tunnel":
371 case "reliefTunnel": 383 case "reliefTunnel":
372 case "squareTunnel": 384 case "squareTunnel":
385 case "flag":
373 case "twist": 386 case "twist":
374 case "fly": 387 case "fly":
375 case "julia": 388 case "julia":
@@ -379,6 +392,8 @@ exports.GeomObj = Object.create(Object.prototype, {
379 case "keleidoscope": 392 case "keleidoscope":
380 case "radialBlur": 393 case "radialBlur":
381 case "pulse": 394 case "pulse":
395 case "twistVert":
396 case "taper":
382 mat = MaterialsModel.getMaterialByShader(shaderName); 397 mat = MaterialsModel.getMaterialByShader(shaderName);
383 if (mat) mat = mat.dup(); 398 if (mat) mat = mat.dup();
384 break; 399 break;