Move Node position in Xpresso menu [SOLVED]

On 16/11/2015 at 00:33, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   R17 
Platform:   Windows  ;   
Language(s) :     C++  ;  XPRESSO  ;

---------
I created a C++ node-plugin (My_Node) ... by default it is on the menu: New Node -> Xpresso -> General -> My_Node ... How to move node (My_Node) in the menu: New Node -> My Group -> My_Node ?
http://forums.cgsociety.org/attachment.php?attachmentid=179117

Example code get on forum
https://plugincafe.maxon.net/topic/3916/3386_baseobjects-and-objectlinkports&PID=13868#13868

On 16/11/2015 at 02:20, xxxxxxxx wrote:

Hello,

please do not cross post on different forums or at least include a link to the other post. Thanks.

If you want to place your node in a custom class and group you have to add a custom class and group. A custom class is created like this:

  
static const String* GetGVClassName()  
{  
 static String mygroup("My Class");  
 return &mygroup;  
}  
  
static BaseBitmap* GetGVClassIcon()  
{  
 return nullptr;  
}  
  
 static GV_OPCLASS_HANDLER myClass;  
 myClass.class_id = CLASS_ID;  
 myClass.GetName = GetGVClassName;  
 myClass.GetIcon = GetGVClassIcon;  
  
 GvRegisterOpClassType(&myClass, sizeof(myClass));  

and a custom group is created like this:

  
static const String* GetGVGroupName(void)  
{  
 static String mygroup("My Group");  
 return &mygroup;  
}  
  
static BaseBitmap* GetGVGroupIcon(void)  
{  
 return nullptr;  
}  
  
 static GV_OPGROUP_HANDLER myGroup;  
 myGroup.group_id = GROUP_ID;  
 myGroup.GetName = GetGVGroupName;  
 myGroup.GetIcon = GetGVGroupIcon;  
  
 GvRegisterOpGroupType(&myGroup, sizeof(myGroup));  

Then you can use the IDs of the class and group when you register your plugin:

  
GvRegisterOperatorPlugin(1033969,"My Node",0,MyNode::Alloc,"gvmynode",0,CLASS_ID,GROUP_ID,0,bitmap);  

best wishes,
Sebastian

On 17/11/2015 at 00:34, xxxxxxxx wrote:

Thanks.