THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 10/01/2008 at 01:11, xxxxxxxx wrote:
Ok, here an example. I defined a standard BUTTON as Bool in GetDDescription. This seems to work perfectly fine.
> _
> #include "c4d.h"
> #include "c4d_symbols.h"
> #include "tlookatcameraexp.h"
>
> #include "customgui_bitmapbutton.h"
>
>
> class LookAtCamera : public TagData
> {
> public:
> virtual Bool Init(GeListNode *node);
> virtual LONG Execute(PluginTag *tag, BaseDocument *doc, BaseObject *op, BaseThread *bt, LONG priority, LONG flags);
> virtual Bool GetDDescription(GeListNode *node, Description *description,LONG &flags;);
>
> static NodeData *Alloc(void) { return gNew LookAtCamera; }
> };
>
> Bool LookAtCamera::Init(GeListNode *node)
> {
> BaseTag *tag = (BaseTag* )node;
> BaseContainer *data = tag->GetDataInstance();
>
> data->SetBool(MYTESTBUTTON,FALSE);
>
> return TRUE;
> }
>
>
> Bool LookAtCamera::GetDDescription(GeListNode *node, Description *description,LONG &flags;)
> {
> if (!description->LoadDescription(node->GetType())) return FALSE;
>
> BaseContainer bc2 = GetCustomDataTypeDefault(DTYPE_BOOL);
>
> BaseTag *tag = (BaseTag* )node;
> BaseContainer *data = tag->GetDataInstance();
>
>
> if(data->GetBool(MYTESTBUTTON))
> {
> bc2.SetString(DESC_NAME,"TRUE");
> bc2.SetString(DESC_SHORT_NAME,"TRUE");
> }
> else
> {
> bc2.SetString(DESC_NAME,"FALSE");
> bc2.SetString(DESC_SHORT_NAME,"FALSE");
> }
>
> bc2.SetLong(DESC_CUSTOMGUI,CUSTOMGUI_BUTTON);
>
> // bc2.SetLong(DESC_ANIMATE,DESC_ANIMATE_ON);
> // bc2.SetBool(DESC_REMOVEABLE,FALSE);
>
> if (!description->SetParameter(DescLevel(MYTESTBUTTON,DTYPE_BOOL,0),bc2,DescLevel(ID_TAGPROPERTIES))) return FALSE;
>
> flags |= DESCFLAGS_DESC_LOADED;
>
> return TRUE;
> }
>
> LONG LookAtCamera::Execute(PluginTag *tag, BaseDocument *doc, BaseObject *op, BaseThread *bt, LONG priority, LONG flags)
> {
> BaseContainer *data = tag->GetDataInstance();
>
> if(data->GetBool(MYTESTBUTTON, FALSE)) GePrint("TRUE");
> else GePrint("FALSE");
>
> return EXECUTION_RESULT_OK;
> }
>
> // be sure to use a unique ID obtained from www.plugincafe.com
> #define ID_LOOKATCAMERATAG 1001165
>
> Bool RegisterLookAtCamera(void)
> {
> // decide by name if the plugin shall be registered - just for user convenience
> String name=GeLoadString(IDS_LOOKATCAMERA); if (!name.Content()) return TRUE;
> return RegisterTagPlugin(ID_LOOKATCAMERATAG,name,TAG_EXPRESSION|TAG_VISIBLE,LookAtCamera::Alloc,"Tlookatcameraexp","lookatcamera.tif",0);
> }
> _
cheers,
Matthias