We're working with Forge Viewer v7 and trying to color objects based on their ID. The idea is simple: when we provide an ID, the viewer should color the corresponding objects and sub-objects.
We’ve used viewer.setThemingColor(dbId, colorCode, null, true) hoping it would apply the color recursively:
dbIds.forEach(dbId => {
let color = new THREE.Color(colour);
let colorCode = new THREE.Vector4(color.r, color.g, color.b, 1);
vm.viewer.setThemingColor(dbId, colorCode, null, true);
});
It works fine when the ID matches a geometry node directly (like a mesh), but when the node corresponds to a group, the sub-object inside that group are not colored. It seems the recursive flag doesn’t traverse into the group structure as expected.
Has anyone run into this issue before or found a reliable way to color all sub-objects belonging to an ID node? Any advice or ideas would be greatly appreciated.
