On 24/07/2018 at 09:14, xxxxxxxx wrote:
Cinema 4D Version: R14
Platform: Windows ; Mac ;
Language(s) : C++ ;
Is it possible to get whether a material is currently being used in a scene? In a similar way to how Remove Unused Materials checks, but without the deleting step.
On 25/07/2018 at 02:21, xxxxxxxx wrote:
You can read the assignment data with the following code
Bool MyCommand::Execute(BaseDocument* doc)
BaseMaterial* mat = doc->GetActiveMaterial();
if (mat == nullptr)
if (!mat->GetParameter(DescLevel(ID_MATERIALASSIGNMENTS), d, DESCFLAGS_GET_0))
MatAssignData *mad = (MatAssignData* )d.GetCustomDataType(CUSTOMDATATYPE_MATASSIGN);
GePrint(String::IntToString(mad->GetObjectCount()) + " objects");
If you have any question, please let me know.