diff options
author | hwc487 | 2012-06-15 10:20:48 -0700 |
---|---|---|
committer | hwc487 | 2012-06-15 10:20:48 -0700 |
commit | 8556f19a8691fe72791989014c62cb92b8bddb19 (patch) | |
tree | aa7459bbc4367e2ccc7a817d7ba088396b447632 /js/panels | |
parent | 2bcc1d3c6c1e31f5ca4310c581602bfa8b8a1265 (diff) | |
download | ninja-8556f19a8691fe72791989014c62cb92b8bddb19.tar.gz |
Material changes through the popup editor can effect multiple material instances within a single object.
Diffstat (limited to 'js/panels')
-rwxr-xr-x | js/panels/Materials/materials-popup.reel/materials-popup.js | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/js/panels/Materials/materials-popup.reel/materials-popup.js b/js/panels/Materials/materials-popup.reel/materials-popup.js index 38a6865c..91d50234 100755 --- a/js/panels/Materials/materials-popup.reel/materials-popup.js +++ b/js/panels/Materials/materials-popup.reel/materials-popup.js | |||
@@ -160,14 +160,26 @@ exports.MaterialsPopup = Montage.create(Component, { | |||
160 | var selection = this.application.ninja.selectedElements; | 160 | var selection = this.application.ninja.selectedElements; |
161 | if (selection && (selection.length > 0)) | 161 | if (selection && (selection.length > 0)) |
162 | { | 162 | { |
163 | var canvas = selection[0]; | 163 | var nObjs = selection.length; |
164 | var obj; | 164 | for (var iObj=0; iObj<nObjs; iObj++) |
165 | if (canvas.elementModel && canvas.elementModel.shapeModel) obj = canvas.elementModel.shapeModel.GLGeomObj; | ||
166 | if (obj) | ||
167 | { | 165 | { |
168 | var world = obj.getWorld(); | 166 | var canvas = selection[iObj]; |
169 | if (world) | 167 | var obj; |
170 | world.restartRenderLoop(); | 168 | if (canvas.elementModel && canvas.elementModel.shapeModel) obj = canvas.elementModel.shapeModel.GLGeomObj; |
169 | if (obj) | ||
170 | { | ||
171 | var matArray = obj._materialArray; | ||
172 | var matTypeArray = obj._materialTypeArray; | ||
173 | var nMats = matArray.length; | ||
174 | for (var iMat=0; iMat<nMats; iMat++) | ||
175 | { | ||
176 | if (matTypeArray[iMat] === this._whichMaterial) | ||
177 | matArray[iMat].setProperty( this._propNames[index], value ); | ||
178 | } | ||
179 | var world = obj.getWorld(); | ||
180 | if (world) | ||
181 | world.restartRenderLoop(); | ||
182 | } | ||
171 | } | 183 | } |
172 | } | 184 | } |
173 | } | 185 | } |