MikaFil commited on
Commit
c934050
·
verified ·
1 Parent(s): 64fa81e

Update viewer.js

Browse files
Files changed (1) hide show
  1. viewer.js +9 -2
viewer.js CHANGED
@@ -235,8 +235,15 @@ export async function initializeViewer(config, instanceId) {
235
  matSol.blendType = pc.BLEND_NORMAL;
236
  matSol.emissivve = new pc.Color(color_bg);
237
  matSol.emissiveIntensity = 1;
238
-
239
- glbEntity.material = matSol;
 
 
 
 
 
 
 
240
  }
241
 
242
  const presentoirEntity =assets.presentoir.resource.instantiateRenderEntity();
 
235
  matSol.blendType = pc.BLEND_NORMAL;
236
  matSol.emissivve = new pc.Color(color_bg);
237
  matSol.emissiveIntensity = 1;
238
+ matSol.update();
239
+
240
+ traverse(glbEntity, node => {
241
+ if (node.render && node.render.meshInstances) {
242
+ for (let mi of node.render.meshInstances) {
243
+ mi.material = matSol;
244
+ }
245
+ }
246
+ });
247
  }
248
 
249
  const presentoirEntity =assets.presentoir.resource.instantiateRenderEntity();