Post:
Hi Team,
I am applying colors to nodes using viewer.model.setNodesColors() like this:
const colorMap = new Map();
for (const nodeId of nodeIds) {
colorMap.set(nodeId, new Communicator.Color(255, 0, 0));
}
await viewer.model.setNodesColors(colorMap);
This works correctly and applies the color to the nodes.
Later, I want to reset the nodes back to their original model colors. However, if I assign another color like:
colorMap.set(nodeId, new Communicator.Color(255,255,255));
Not working :- not changing the node color to white
Not working:- not restoring the original material color.
What is the correct way to remove the color override applied by setNodesColors() and restore the node’s original color?
Would passing null for the color value be the recommended approach, for example:
const resetMap = new Map();
for (const nodeId of nodeIds) {
resetMap.set(nodeId, null);
}
await viewer.model.setNodesColors(resetMap);
Is this the correct pattern to restore the original colors?
Also, does this behavior differ for nodes that have texture mapping applied?
current version - Hoops Version: 2023_SP1 this is not working as well. await viewer.model.resetNodesColor();
Thanks!
