On 02/08/2014 at 07:13, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 14, 15
Platform: Windows ;
Language(s) : C++ ;
---------
I am having trouble getting cycle buttons to work in a generator plugin.
This is what I added in the res file
LONG MYOBJECT_CYCLE
{
CYCLE
{
CYCLE_ITEM_1;
CYCLE_ITEM_2;
CYCLE_ITEM_3;
}
}
The cycle list appears fine in the AM.
The problem is when I am try to access the buttons. This is the code that I am using:
Bool MYOBJECT::Message(GeListNode *node, LONG type, void *data)
{
switch (type)
{
case MSG_DESCRIPTION_COMMAND:
{
DescriptionCommand *dc = (DescriptionCommand* ) data;
if (dc->id[0].id == MYOBJECT_CYCLE)
{
BaseContainer *bc = ((BaseObject* )node)->GetDataInstance();
if (!bc) return FALSE;
LONG item = bc->GetLong(MYOBJECT_CYCLE);
switch (item)
{
case CYCLE_ITEM_1:
GePrint("1");
break;
case CYCLE_ITEM_2:
GePrint("2");
break;
case CYCLE_ITEM_3:
GePrint("3");
break;
default:
GePrint("default");
break;
}
}
}
}
return TRUE;
}
Nothing gets printed. If I try to print dc- >id[0].id I don't get anything.I am presuming that MYOBJECT_CYCLE is not getting recognized in the first place.
Anyone can shed a light on what I might be doing wrong?
Thanks