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
  1 Week 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.

Thanks.
 
  6 Days Ago
this is how i do it....


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

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

class CollectObjectsOfType : public INodeEnum
{
public:

 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 : 6 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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 03:49 PM.


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