aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Materials
diff options
context:
space:
mode:
authorhwc4872012-05-22 08:38:38 -0700
committerhwc4872012-05-22 08:38:38 -0700
commitcc3b66f817c9d72ca247d5ff789a08ec5b57a2b5 (patch)
tree229a3d92b2fa86c32b6d47134b843880e909bead /js/panels/Materials
parentdc92188fef67d7a2032173d7746fbc16a951a366 (diff)
downloadninja-cc3b66f817c9d72ca247d5ff789a08ec5b57a2b5.tar.gz
Editable material properties
Diffstat (limited to 'js/panels/Materials')
-rwxr-xr-xjs/panels/Materials/materials-popup.reel/materials-popup.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/js/panels/Materials/materials-popup.reel/materials-popup.js b/js/panels/Materials/materials-popup.reel/materials-popup.js
index c54b311e..1e92e144 100755
--- a/js/panels/Materials/materials-popup.reel/materials-popup.js
+++ b/js/panels/Materials/materials-popup.reel/materials-popup.js
@@ -18,6 +18,8 @@ exports.MaterialsPopup = Montage.create(Component, {
18 value: "" 18 value: ""
19 }, 19 },
20 20
21 _useSelection: { value: false, enumerable: true },
22
21 captureAction: { 23 captureAction: {
22 value:function(event) { 24 value:function(event) {
23 switch(event._currentTarget.label) 25 switch(event._currentTarget.label)
@@ -134,6 +136,11 @@ exports.MaterialsPopup = Montage.create(Component, {
134 var value = this.decodeValue( this._propTypes[index], propValue ); 136 var value = this.decodeValue( this._propTypes[index], propValue );
135 this._material.setProperty( this._propNames[index], value ); 137 this._material.setProperty( this._propNames[index], value );
136 } 138 }
139
140 if (this._useSelection)
141 {
142 console.log( "apply to selection" );
143 }
137 } 144 }
138 } 145 }
139 }, 146 },
@@ -224,6 +231,7 @@ exports.MaterialsPopup = Montage.create(Component, {
224 this._materialName = materialID; 231 this._materialName = materialID;
225 if (useSelection) 232 if (useSelection)
226 { 233 {
234 this._useSelection = true;
227 var selection = this.application.ninja.selectedElements; 235 var selection = this.application.ninja.selectedElements;
228 if (selection && (selection.length > 0)) 236 if (selection && (selection.length > 0))
229 { 237 {
@@ -236,6 +244,8 @@ exports.MaterialsPopup = Montage.create(Component, {
236 } 244 }
237 else 245 else
238 { 246 {
247 this._useSelection = false;
248
239 if( 249 if(
240 (materialID === "BumpMetalMaterial") || 250 (materialID === "BumpMetalMaterial") ||
241 (materialID === "DeformMaterial") || 251 (materialID === "DeformMaterial") ||
@@ -342,7 +352,7 @@ exports.MaterialsPopup = Montage.create(Component, {
342 { 352 {
343 value: function( label, color ) 353 value: function( label, color )
344 { 354 {
345 var css = 'rgba(' + color[0]*255 + ',' + color[1]*255 + ',' + color[2]*255 + ',' + color[3] + ')'; 355 var css = 'rgba(' + Math.floor(color[0]*255) + ',' + Math.floor(color[1]*255) + ',' + Math.floor(color[2]*255) + ',' + color[3] + ')';
346 var colorObj = this.application.ninja.colorController.getColorObjFromCss(css) 356 var colorObj = this.application.ninja.colorController.getColorObjFromCss(css)
347 var obj = 357 var obj =
348 { 358 {