Extensions on change trigger

I have tried and it works for my requirements
see: API change material for another - #2 by jan
Thank you.

var dark = viewer.findMaterial('Flooring-Dark');
var light = viewer.findMeshesWithMaterial('Flooring-light');
var med = viewer.findMeshesWithMaterial('Flooring-Med');

for (var i = 0; i < light.length; ++i) {
  viewer.setMaterialForMesh(dark, light[i]);
}

for (var i = 0; i < med.length; ++i) {
  viewer.setMaterialForMesh(dark, med[i]);
}
viewer.requestFrame();
1 Like