Apply different materials on entities of a node

Hello all,

I have a node, let’s say a window. this node consists of multiple meshes (for the glass, the frame, etc). All those meshes are in the entity list of the node. now i want to add a material to all of those nodes (the material is just the color).
I tried something, but it always adds the first material to the whole node. what am I doing wrong?

for (ItemGeometry itemGeometry : item.getItemGeometries()) {
    var mats = (VertexElementMaterial) itemGeometry.getMesh().createElement(VertexElementType.MATERIAL);
    mats.setIndices(new int[]{node.getMaterials().indexOf(itemGeometry.getMaterial())});

Thanks in advance!


We need to investigate this case and for the purpose, an investigation ticket as THREEDJAVA-212 has been logged in our issue tracking system. We will look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.


The best practice is each mesh has its own Node. Some exporters do not support VertexElementMaterial, may we know the file type used to export this file? So we can improve the exporter.

1 Like