Dear Sir / Madame,
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).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.