Reading all the objects in the scene 3ds Max SDK C++

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  6 Days Ago
Reading all the objects in the scene 3ds Max SDK C++

How do I read the names of all the groups and objects in the group from the scene?

Also if there are good tutorials to 3ds Max SDK C++ tutorial do share the link.

  4 Days Ago
this is how i do it....

class INodeEnum
 virtual BOOL proc(INode *node) = 0;
 virtual ~INodeEnum() {}

typedef BOOL (*GetObjectTypeFnPtr)(Object* obj);

class CollectObjectsOfType : public INodeEnum

 GetObjectTypeFnPtr GetTypeFn;
 INodeTab nodes;
 CollectObjectsOfType(GetObjectTypeFnPtr fn, i) : GetTypeFn(fn) { }
 BOOL proc(INode *node)
  Object* obj = node->GetObjectRef();
  if(obj && GetTypeFn(obj))
   nodes.AppendNode (node);
  return TRUE;

BOOL INodeEnumTree(INode *node, INodeEnum& enumerator) 
 if(node == NULL) return TRUE;
 if(!enumerator.proc(node)) return FALSE;

 for(int i = 0; i < node->NumberOfChildren(); ++i) 
  if(!INodeEnumTree(node->GetChildNode(i), enumerator)) 
   return FALSE;
 return TRUE;

// this function can test any aspect of the object such as class id or superclass id or as in this case use one of the built in object functions

BOOL isShapeObject(Object* obj) { return obj->IsShapeObject(); }

CollectObjectsOfType ShapeNodeCollector (isShapeObject);
INodeEnumTree(ip->GetRootNode(), ShapeNodeCollector); 

Last edited by Klvnk : 4 Days Ago at 09:33 PM.
reply share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 09:18 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.