THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 12/04/2008 at 06:18, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 10.1
Platform: Windows ; Mac ; Mac OSX ;
Language(s) : C++ ;
---------
Hi,
I need to make a plugin object that's in fact a Null Object (including e.g. the ID_BASEOBJECT_COLOR and ID_BASEOBJECT_SHADEDWIRECOLORMODE working as in an Null Object), just with 2 extra attributes.
I tried with:
> `
class OPointOfInterest : public ObjectData
\> {
\> INSTANCEOF(OPointOfInterest,ObjectData)
\>
\> private:
\>
\> public:
\> virtual Bool Init(GeListNode *node);
\>
\> virtual Bool Message (GeListNode *node, LONG type, void *data);
\> virtual Bool Draw (PluginObject *op, LONG type, BaseDraw *bd, BaseDrawHelp *bh);
\> virtual Bool GetDEnabling (GeListNode *node, const DescID &id;,GeData &t;_data,LONG flags,const BaseContainer *itemdesc);
\> virtual void CheckDirty(PluginObject* op, BaseDocument* doc);
\>
\> static NodeData *Alloc(void) { return gNew OPointOfInterest; }
\> };
`
All void functions just return TRUE.
I try to register it with:
> `
Bool RegisterPointOfInterest(void)
\> {
\> // decide by name if the plugin shall be registered - just for user convenience
\> String name=GeLoadString(IDS_POINTOFINTEREST); if (!name.Content()) return TRUE;
\> return RegisterObjectPlugin(ID_POINTOFINTEREST,name,0,OPointOfInterest::Alloc,"OPointOfInterest","PointOfInterest.tif",0);
\> }
`
Not sure about the "0" flag, have also tried OBJECT_GENERATOR.
In the .res file I include Onull and add some attributes.
Now the object looks like I want, and has all attributes that I want. But if I try to use the Null Object's functionality to draw e.g. a circle in a certain color, it does not work. Nothing is drawn.
What do I have to do to make an object that completely behaves like the null object?
Thanks in advance for hints and help :-)
Best regards,
Jack