We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

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()) {
    node.getMaterials().add(itemGeometry.getMaterial());
    var mats = (VertexElementMaterial) itemGeometry.getMesh().createElement(VertexElementType.MATERIAL);
    mats.setMappingMode(MappingMode.ALL_SAME);
    mats.setIndices(new int[]{node.getMaterials().indexOf(itemGeometry.getMaterial())});
}

Thanks in advance!

@Hue404

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.