THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 29/03/2008 at 12:04, xxxxxxxx wrote:
If using the example:
Did you change the file names? Did you change the plugin ID? Did you change 'Tlookatcameraexp'?
SUPER can't be changed. It tells the method to call the base class's original method when you are deriving from it.
So, you should have something like this (where 'Tmyplugintag', MyPluginTag, the plugin ID, etc. should be replaced with your own) :
Tmyplugintag.res
> CONTAINER Tmyplugintag \> { \> NAME Tmyplugintag; \> INCLUDE Texpression; \> \> GROUP ID_TAGPROPERTIES \> { \> BITMAPBUTTON IMAGINARY_PREVIEW { } \> } \> }
Tmyplugintag.h
> #ifndef \_Tmyplugintag_H\_ \> #define \_Tmyplugintag_H\_ \> \> enum \> { \> IMAGINARY_PREVIEW = 1000 \> }; \> \> #endif
Tmyplugintag.str
> STRINGTABLE Tmyplugintag \> { \> Tmyplugintag "My Plugin Tag"; \> IMAGINARY_PREVIEW "test button"; \> }
MyPluginTag.cpp
> #include "c4d.h" \> #include "c4d_symbols.h" \> #include "tmyplugintag.h" \> #include "customgui_bitmapbutton.h" \> \> class MyPluginTag : public TagData \> { \> INSTANCEOF(MyPluginTag,TagData) \> \> public: \> virtual LONG Execute(PluginTag \*tag, BaseDocument \*doc, BaseObject \*op, BaseThread \*bt, LONG priority, LONG flags); \> virtual Bool GetDParameter(GeListNode \*node, const DescID &id;, GeData &t;\_data, LONG &flags;); \> virtual Bool SetDParameter(GeListNode \*node, const DescID &id;, const GeData &t;\_data, LONG &flags;); \> virtual Bool Message(GeListNode \*node, LONG type, void \*data); \> \> static NodeData \*Alloc(void) { return gNew MyPluginTag; } \> }; \> \> LONG MyPluginTag::Execute(PluginTag \*tag, BaseDocument \*doc, BaseObject \*op, BaseThread \*bt, LONG priority, LONG flags) \> { \> return EXECUTION_RESULT_OK; \> } \> \> Bool MyPluginTag::GetDParameter(GeListNode \*node, const DescID &id;, GeData &t;\_data, LONG &flags;) \> { \> switch(id[0].id) \> { \> case IMAGINARY_PREVIEW: \> { \> LONG dirty = 0; \> BitmapButtonStruct bbs(static_cast<PluginObject\*>(node), id, dirty); \> t_data = GeData(CUSTOMDATATYPE_BITMAPBUTTON, bbs); \> flags |= DESCFLAGS_PARAM_GET; \> break; \> } \> } \> return SUPER::GetDParameter(node, id, t_data, flags); \> } \> \> Bool MyPluginTag::SetDParameter(GeListNode \*node, const DescID &id;, const GeData &t;\_data, LONG &flags;) \> { \> switch(id[0].id) \> { \> case IMAGINARY_PREVIEW: \> flags |= DESCFLAGS_PARAM_SET; \> break; \> } \> return SUPER::SetDParameter(node, id, t_data, flags); \> } \> \> Bool MyPluginTag::Message(GeListNode \*node, LONG type, void \*data) \> { \> if (type == MSG_DESCRIPTION_GETBITMAP) \> { \> DescriptionGetBitmap\* dgb = static_cast<DescriptionGetBitmap\*>(data); \> if(dgb->id[0] == IMAGINARY_PREVIEW) \> { \> AutoAlloc<BaseBitmap> bm; \> Filename bg = GeGetPluginPath()+Filename("res")+Filename("imaginary.tif"); \> bm->Init(bg); \> dgb->bmp = bm.Release(); \> } \> } \> return TRUE; \> } \> \> // be sure to use a unique ID obtained from www.plugincafe.com \> #define ID_MYPLUGINTAG //PUT UNIQUE PLUGIN ID HERE! \> \> Bool RegisterMyPluginTag(void) \> { \> return RegisterTagPlugin(ID_MYPLUGINTAG,"My Plugin Tag",TAG_EXPRESSION|TAG_VISIBLE,MyPluginTag::Alloc,"Tmyplugintag","myplugintag.tif",0L); \> }