diff options
author | hwc487 | 2012-06-06 16:34:41 -0700 |
---|---|---|
committer | hwc487 | 2012-06-06 16:34:41 -0700 |
commit | 6c994c4b90023cecf4fd0caafb404b859fe28f54 (patch) | |
tree | 75a4d813441ca6a3eb529dc88a749776459bb76e /js/panels | |
parent | 920436977433ea55c01ce1e73895d1db0a6abac1 (diff) | |
download | ninja-6c994c4b90023cecf4fd0caafb404b859fe28f54.tar.gz |
material cleanup and rearchitecture
Diffstat (limited to 'js/panels')
-rwxr-xr-x | js/panels/Materials/materials-popup.reel/materials-popup.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/js/panels/Materials/materials-popup.reel/materials-popup.js b/js/panels/Materials/materials-popup.reel/materials-popup.js index 3ef2e4ef..5b9790b8 100755 --- a/js/panels/Materials/materials-popup.reel/materials-popup.js +++ b/js/panels/Materials/materials-popup.reel/materials-popup.js | |||
@@ -19,6 +19,7 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
19 | }, | 19 | }, |
20 | 20 | ||
21 | _useSelection: { value: false, enumerable: true }, | 21 | _useSelection: { value: false, enumerable: true }, |
22 | _whichMaterial: { value: "fill", enumerable: true }, | ||
22 | 23 | ||
23 | captureAction: { | 24 | captureAction: { |
24 | value:function(event) { | 25 | value:function(event) { |
@@ -140,6 +141,20 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
140 | if (this._useSelection) | 141 | if (this._useSelection) |
141 | { | 142 | { |
142 | console.log( "apply to selection" ); | 143 | console.log( "apply to selection" ); |
144 | |||
145 | var selection = this.application.ninja.selectedElements; | ||
146 | if (selection && (selection.length > 0)) | ||
147 | { | ||
148 | var canvas = selection[0]; | ||
149 | var obj; | ||
150 | if (canvas.elementModel && canvas.elementModel.shapeModel) obj = canvas.elementModel.shapeModel.GLGeomObj; | ||
151 | if (obj) | ||
152 | { | ||
153 | var world = obj.getWorld(); | ||
154 | if (world) | ||
155 | world.restartRenderLoop(); | ||
156 | } | ||
157 | } | ||
143 | } | 158 | } |
144 | } | 159 | } |
145 | } | 160 | } |
@@ -241,6 +256,7 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
241 | { | 256 | { |
242 | var canvas = selection[0]; | 257 | var canvas = selection[0]; |
243 | var obj; | 258 | var obj; |
259 | this._whichMaterial = whichMaterial; | ||
244 | if (canvas.elementModel && canvas.elementModel.shapeModel) obj = canvas.elementModel.shapeModel.GLGeomObj; | 260 | if (canvas.elementModel && canvas.elementModel.shapeModel) obj = canvas.elementModel.shapeModel.GLGeomObj; |
245 | if (obj) | 261 | if (obj) |
246 | material = (whichMaterial === 'stroke') ? obj.getStrokeMaterial() : obj.getFillMaterial(); | 262 | material = (whichMaterial === 'stroke') ? obj.getStrokeMaterial() : obj.getFillMaterial(); |