Message 1 of 1
How to collect all GraphicObjects from scene?
Not applicable
08-07-2017
08:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I try to collect all graphicObject from scene. But next code isn't working, nodeList is empty:
ModContextList mcList;
INodeTab nodeList;
GetCOREInterface()->GetModContexts(mcList, nodeList);
TimeValue t = GetCOREInterface()->GetTime();
GeomObject *obj;
for (int i = 0; i < nodeList.Count(); i++) {
INode *node = nodeList[i];
// Get the object from the node
ObjectState os = node->EvalWorldState(t);
if (os.obj->SuperClassID() == GEOMOBJECT_CLASS_ID) {
obj = (GeomObject*)os.obj;
wcout << obj->GetObjectName() << endl;
}
else {
continue;
}
}