I’m trying to obtain a list of materials, but it seems that the list only contains those that are assigned to the objects in the scene. Is this correct behavior? And is there an alternative way to obtain a full list of materials.
The code I’m using is: auto &materials = RhinoApp().ActiveDoc()->m_material_table; RhinoApp().Print("MaterialCount(): %d\n", materials.MaterialCount()); RhinoApp().Print("Material #0: %s\n", get_name(materials[0]).c_str());
When I start with an empty scene with 2 materials, the list of materials is empty, as can be seen by querying the MaterialCount() property. Only after applying a material (in my case the second one) to an object, I can see that there is 1 material. However, that one is the second one, and not the first one in the list.
It is still unclear to me how to obtain an ONX_Model. All I have is the RhinoApp(). Does that provide this information?
Also, is there an ON_… corresponding to the ON_ModelComponent::Type::RenderMaterial (like ON_InstanceDefinition corresponds to ON_ModelComponent::Type::InstanceDefinition)?