SubParts and Materials

Hi,

Is there any doumentation available regarding SubParts, especially materials on SubParts? For instance, several of the function calls reference subpart-id #s but no information on how to get the valid ids.

getSubpartMaterial
listSubpartMaterials
listSubpartVariantMaterials
setSubpartMaterial
setSubpartVariantMaterials
setSubpartVariantMaterialsList
transferSubpartMaterialsOnPatches

A problem we have is that some parts have multiple materials that show up as subpart materials in Studio, and we want to merge those (e.g. use the dominant one), reassigning material 0 (part or subpart) occurrences and then reduce the materials in the scene and merge occurrences by materials (merging by materials does not work well in Pixyz SDK…). Any recommended approach for this, eg Explode by Materials, assign materials, Merge.

These functions take an occurrence id as input and some of them take a subpart index as well. The subpart index is the index of the shape (a Part can reference multiple submeshes or cad patches) on which the material applies. So, to apply a material x on the first Subpart of the Part attached to an occurrence y you should do:

scene.setSubpartMaterial(y, 0, x)