For some reason Maxon’s Cinema 4D C++ SDK does not contain a GetChildren() function (whereas the Python SDK does have one). It’s not the hardest thing in the world to write yourself, but you have to do it nontheless. So here’s a simple template…
1 2 3 4 5 6 7 8 9 10 11 12 |
maxon::BaseArray<BaseObject> children; void MyApp::GetChildren(BaseObject* root) { BaseObject* child = root->GetDown(); if (child == nullptr) return; while (child != nullptr) { children.Append(child); GetChildren(child); child = child->GetNext(); } } |
children
is a global variable in this case, but could of course just as well be passed to the function as a pointer…