We are currently making the client retrieve the object states when the page loads (which will cause the \'pending\' objects in the model to turn into different colors). Then
I have no idea how you implement your app, so I only tell what I found in your codes. If you want to resolve the issue you addressed, you can consider providing a reproducible case demonstrating that, I will gladly pass it to our dev team. Those following items should be in the reproducible case:
Forge app
that can be run and debugged with a simple procedure to analyze its behavior lives in the sample model.three.js app
that can be run and demonstrated the shader effect you want. Note. Forge Viewer is using r71 three.js
.If your reproducible case could not be posted here publicly, please send it to the forge.help@autodesk.com
and remove sensitive data or information before you send.
=== Something I found in your codes:
I found here are some wrong types and missing actions in your ColorMaterial
extension. The color property of an material should the a type of the THREE.Color
. Here is my modification:
Autodesk.Viewing.Viewer3D.prototype.setColorMaterial = function(objectIds, color)
{
if( !(color instanceof THREE.Color) ) throw 'Invalid argument: Color';
var material = new THREE.MeshPhongMaterial
({
color: color,
opacity: 0.8,
transparent: true
});
viewer.impl.matman().addMaterial( 'ColorMaterial-' + new Date().getTime(), material, true );
// ...........
};
Its' result is here:
In the ColorOverlay
extension, The type of material color property is also wrong, it should be a type of THREE.Color
, too. Changing it into THREE.Color
should work fine. In addition, overlay is covers on 3D objects, so you should call viewer.hide()
with your setColorOverlay()
together. Otherwise, it won't look like a transparent object.
Without hidding 3D object of the wall:
hide 3D object of the wall: