GvRegisterOpGroupType

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 29/11/2002 at 09:39, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   8.012 
Platform:   Windows  ; Mac  ;  Mac OSX  ; 
Language(s) :     C++  ;

---------
How do I correctly register a new operator group with this function?
Regards, darf - bhodiNUT

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 01/12/2002 at 02:15, xxxxxxxx wrote:

The following seems to work: (Extended version of the example first posted, and different memory allocation scheme.)

    
    
    const LONG ID_GV_OPGROUP_MY = 1010850;  
    const LONG ID_GV_OPCLASS_MY = 1010851;
    
    
    
    
    static const String* GetMyGroupName()  
    {  
      static String mygroup("My Group");  
      return &mygroup;  
    }
    
    
    
    
    static BaseBitmap* GetMyGroupIcon()  
    {  
      static AutoAlloc<BaseBitmap> icon;  
      if (!icon) return NULL;  
      if (icon->GetBw() == 0)  
      {  
        icon->Init(24, 24);  
        icon->Clear(200, 0, 0);  
      }  
      return icon;  
    }
    
    
    
    
    static const String* GetMyClassName()  
    {  
      static String mygroup("My Class");  
      return &mygroup;  
    }
    
    
    
    
    static BaseBitmap* GetMyClassIcon()  
    {  
      static AutoAlloc<BaseBitmap> icon;  
      if (!icon) return NULL;  
      if (icon->GetBw() == 0)  
      {  
        icon->Init(24, 24);  
        icon->Clear(0, 0, 200);  
      }  
      return icon;  
    }
    
    
    
    
    Bool RegisterGvTest()  
    {  
      static GV_OPGROUP_HANDLER mygroup;  
      mygroup.group_id = ID_GV_OPGROUP_MY;  
      mygroup.GetName = GetMyGroupName;  
      mygroup.GetIcon = GetMyGroupIcon;
    
    
    
    
      GvRegisterOpGroupType(&mygroup, sizeof(mygroup));
    
    
    
    
      static GV_OPCLASS_HANDLER myclass;  
      myclass.class_id = ID_GV_OPCLASS_MY;  
      myclass.GetName = GetMyClassName;  
      myclass.GetIcon = GetMyClassIcon;
    
    
    
    
      GvRegisterOpClassType(&myclass, sizeof(myclass));
    
    
    
    
      return GvRegisterOperatorPlugin(GVTEST_ID, "Gv Test", 0, GvTestData::Alloc, "GVtest", 0,   
        ID_GV_OPCLASS_MY, ID_GV_OPGROUP_MY, 0, NULL);  
    }

I'm not sure why the icons aren't used...

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 04/12/2002 at 01:35, xxxxxxxx wrote:

Icons aren't used at the moment. (All groups and classes are shown with the general icon.)

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 04/12/2002 at 08:55, xxxxxxxx wrote:

Thanks for resaerching that and telling me. It had just become a question.
Hmm... Telepathic technical support... Rock on!
 
darf