Colors don't apply to instanced models

Hello,

Something that I noticed on some of our models we are trying to instance. Face colors don’t get copied.

I followed these instructions on how to do instancing

Left is the instance model and the right is a loaded model

This is what the model tree looks like

When I do getFaceCount on node 8, I get a high number. So there must be a way to copy those over as well?

Is this a limitations of hoops or the example provided, or is there a way to also copy the colors of the face nodes somehow as well?

Thank you!

Hello,

I would expect the colors of the source model to be duplicated to the instanced model. As a quick check, I’d like to get the effective face color for the colored parts in question. To do this, you can paste the following in the console and then select the node:

hwv.setCallbacks({
  selectionArray: async function (selections) {
    if (selections.length > 0) {
      for (const selectionEvent of selections) {
        const selection = selectionEvent.getSelection();
        const nodeId = selection.getNodeId();
		const faceIndex = selection.getFaceEntity().getCadFaceIndex();

        console.log("Selected Node: " + nodeId);
        console.log("Face ID: " + faceIndex);
		console.log("Effective Face Color: " + JSON.stringify(await hwv.model.getNodesEffectiveFaceColor([nodeId])));
      }
    }
  },
});

Ultimately, we may need to get the model in our hands for a closer look.

Thanks,
Tino

I am getting: cannot ready properties of null (reading getCadFaceIndex)

Selections always seem to have nothing except the node id

For the time being, we can just comment out the code to retrieve the face index and show it on the console.

For a given node id, the callback code should be able to output to the console the effective face color.

Okay, in that case, this is what I got:

Effective Face Color: [{“r”:234,“g”:234,“b”:234},{“r”:202,“g”:209,“b”:238},{“r”:234,“g”:234,“b”:234},{“r”:255,“g”:0,“b”:0}]

Those RGB colors all look valid to me. As I previously alluded to, it would probably be best if we got the CAD model in our hands to do a deeper investigation. To that end, the best way would be to create a support ticket via our Support Portal.