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!