@archvisioninc/canvas 3.1.1 → 3.1.3

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.
@@ -119,7 +119,7 @@ export const removeFromMaterial = inboundData => {
119
119
  }
120
120
  if (removeAmbientTexture) {
121
121
  material.ambientTexture?.dispose();
122
- material.opacityTexture = null;
122
+ material.ambientTexture = null;
123
123
  }
124
124
  if (removeRoughnessTexture) {
125
125
  if (material.metallicTexture) {
@@ -450,7 +450,7 @@ export const updateMaterial = inboundData => {
450
450
  }
451
451
 
452
452
  // Ambient
453
- if (ambientColor) material.ambientColor = newColor(emissiveColor);
453
+ if (ambientColor) material.ambientColor = newColor(ambientColor);
454
454
  if (ambientTextureStrength !== undefined) material.ambientTextureStrength = ambientTextureStrength;
455
455
  if (!_.isEmpty(ambientTexture?.src || ambientTexture?.url)) {
456
456
  material.ambientTexture = newTexture(ambientTexture?.src || ambientTexture?.url);
@@ -543,6 +543,15 @@ export const materialData = material => {
543
543
  asDataUrl: true
544
544
  })
545
545
  },
546
+ ambientTextureStength: material.ambientTextureStrength,
547
+ ambientTexture: {
548
+ name: material.ambientTexture?.name,
549
+ url: getTextureUrl({
550
+ texture: material.ambientTexture,
551
+ asDataUrl: true
552
+ })
553
+ },
554
+ ambientColor: material.ambientColor?.toHexString() || props?.theme?.colors?.[props.$selectedTheme]?.black,
546
555
  bumpIntensity: material.bumpTexture?.level ?? 1,
547
556
  bumpTexture: {
548
557
  name: material.bumpTexture?.name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archvisioninc/canvas",
3
- "version": "3.1.1",
3
+ "version": "3.1.3",
4
4
  "private": false,
5
5
  "main": "dist/Canvas.js",
6
6
  "module": "dist/Canvas.js",
@@ -157,7 +157,7 @@ export const removeFromMaterial = inboundData => {
157
157
  }
158
158
  if (removeAmbientTexture) {
159
159
  material.ambientTexture?.dispose();
160
- material.opacityTexture = null;
160
+ material.ambientTexture = null;
161
161
  }
162
162
  if (removeRoughnessTexture) {
163
163
  if (material.metallicTexture) {
@@ -506,7 +506,7 @@ export const updateMaterial = inboundData => {
506
506
  }
507
507
 
508
508
  // Ambient
509
- if (ambientColor) material.ambientColor = newColor(emissiveColor);
509
+ if (ambientColor) material.ambientColor = newColor(ambientColor);
510
510
  if (ambientTextureStrength !== undefined) material.ambientTextureStrength = ambientTextureStrength;
511
511
  if (!_.isEmpty(ambientTexture?.src || ambientTexture?.url)) {
512
512
  material.ambientTexture = newTexture(ambientTexture?.src || ambientTexture?.url);
@@ -603,6 +603,12 @@ export const materialData = material => {
603
603
  name: material.emissiveTexture?.name,
604
604
  url: getTextureUrl({ texture: material.emissiveTexture, asDataUrl: true }),
605
605
  },
606
+ ambientTextureStength: material.ambientTextureStrength,
607
+ ambientTexture: {
608
+ name: material.ambientTexture?.name,
609
+ url: getTextureUrl({ texture: material.ambientTexture, asDataUrl: true }),
610
+ },
611
+ ambientColor: material.ambientColor?.toHexString() || props?.theme?.colors?.[props.$selectedTheme]?.black,
606
612
  bumpIntensity: material.bumpTexture?.level ?? 1,
607
613
  bumpTexture: {
608
614
  name: material.bumpTexture?.name,
@@ -742,4 +748,4 @@ export const takePreviewScreenshots = () => {
742
748
  } finally {
743
749
  toggleUI(true);
744
750
  }
745
- };
751
+ };