How to collect all GraphicObjects from scene?

How to collect all GraphicObjects from scene?

Anonymous
Not applicable
380 Views
0 Replies
Message 1 of 1

How to collect all GraphicObjects from scene?

Anonymous
Not applicable

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;
		}

	}
0 Likes
381 Views
0 Replies
Replies (0)