On 24/07/2017 at 02:32, xxxxxxxx wrote:
Hi,
I guess, the actual question was not so much about the renaming (BaseList2D::SetName()).
So it's probably more about iterating the hierarchy. In the GeListNode manual there's a code snippet demonstrating how to recursively iterate a tree (in this case the object tree). With this such a script should be quite easy to accomplish.
Another option is to use the material assignment data you can get from a material (basically what's used for the "Select texture tags / objects..." command) :
GeData d;
mat->GetParameter(ID_MATERIALASSIGNMENTS, d, DESCFLAGS_GET_0);
MatAssignData* const mad = static_cast<MatAssignData*>(d.GetCustomDataType(CUSTOMDATATYPE_MATASSIGN));
if (mad == nullptr)
return false;
const Int32 cnt = mad->GetObjectCount();
for (Int32 idx = 0; idx < cnt; ++idx)
{
C4DAtom* atom = mad->ObjectFromIndex(document, idxTag);
if (atom == nullptr)
continue;
if (atom->IsInstanceOf(Ttexture))
{
BaseTag* tag = static_cast<BaseTag*>(atom);
BaseObject* const op = tag->GetObject();
// do something here...
}
}