I have loaded an IFC file into an object and added it to the scene. I now need a functionality that will let me highlight an equipment with some custom property. I have managed to identify all items in the three object that belong to my choice, and this is what I do to change the color
for (let equipmentInstanceExpressId of equipmentInstanceExpressIds) {
for (let item of loadedFragmentsGroup.items) {
if (item.ids.has(equipmentInstanceExpressId)) {
item.mesh.instanceColor.array[0] = 0;
item.mesh.instanceColor.array[1] = 1;
item.mesh.instanceColor.array[2] = 1;
}
}
}
However, it doesnt change the color reliably. Sometimes only one of the meshes gets changed, sometimes almost none at all. How can I change the instance color of my mesh reliably? It looks something like this, when I want the entire conveyor to be coloured:
I know that I have all the items, because using item.mesh.visible = false
turns the whole thing invisible.