@archvisioninc/canvas 2.6.2 → 2.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -182,12 +182,12 @@ export const updateMaterial = inboundData => {
182
182
 
183
183
  // Reset supported texture channels, useful when manually importing a new material.
184
184
  if (clearTextureChannels) {
185
- material.albedoTexture = null;
186
- material.metallicTexture = null;
187
- material.microSurfaceTexture = null;
188
- material.emissiveTexture = null;
189
- material.bumpTexture = null;
190
- material.opacityTexture = null;
185
+ const workingMaterial = scene.metadata.materials.find(mat => mat.materialId === id);
186
+ Object.keys(workingMaterial)?.forEach(key => {
187
+ if (key.endsWith('Texture')) {
188
+ material[key] = null;
189
+ }
190
+ });
191
191
  }
192
192
 
193
193
  // Back-face culling
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archvisioninc/canvas",
3
- "version": "2.6.2",
3
+ "version": "2.6.4",
4
4
  "private": false,
5
5
  "main": "dist/Canvas.js",
6
6
  "module": "dist/Canvas.js",
@@ -220,12 +220,13 @@ export const updateMaterial = inboundData => {
220
220
 
221
221
  // Reset supported texture channels, useful when manually importing a new material.
222
222
  if (clearTextureChannels) {
223
- material.albedoTexture = null;
224
- material.metallicTexture = null;
225
- material.microSurfaceTexture = null;
226
- material.emissiveTexture = null;
227
- material.bumpTexture = null;
228
- material.opacityTexture = null;
223
+ const workingMaterial = scene.metadata.materials.find(mat => mat.materialId === id);
224
+
225
+ Object.keys(workingMaterial)?.forEach(key => {
226
+ if (key.endsWith('Texture')) {
227
+ material[key] = null;
228
+ }
229
+ });
229
230
  }
230
231
 
231
232
  // Back-face culling