MSG_DESCRIPTION_COMMAND for Cycle Button

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

On 27/04/2007 at 08:22, xxxxxxxx wrote:

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

---------
Hi all,

i need to detect when a Cycle button is pressed in the resource.

In fact i done a code in my Message that load and save settings for my plugin, and i tried to add another cycle button with some saved presets.
The problem is that i can't detect when is pressed because c4d don't send to me the MSG_DESCRIPTION_COMMAND.
What i need is detect when is pressed and load one of the preset inside.

Any help ?

Cheers
Renato

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

On 27/04/2007 at 08:45, xxxxxxxx wrote:

You don't mention if this is a dialog or attributes manager, but I'll assume the latter from your wording.

In the SetDParameter() method, check for the 'id' of the cycle button (this can be a dynamic or static resource LONG type) :

LONG did = id[0].id;
if (id == MY_CYCLEBUTTON_ID)
{
...
}

The GeData t_data argument contains the selected value of the cycle button:

LONG value = t_data.GetLong();

HTH! 🙂

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

On 27/04/2007 at 09:03, xxxxxxxx wrote:

Thanks Robert,

It's working like a charm 🙂

Cheers
Renato

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

On 27/04/2007 at 16:16, xxxxxxxx wrote:

Robert..

i setup all but is returning the older value..
if i choise the menu numeber 8 and i was in the number 3.. i get 3 🙂

how i can fix this?

Thanks
Renato

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

On 27/04/2007 at 16:43, xxxxxxxx wrote:

Try this (including everything) :

LONG did = id[0].id;  
if (did == MY_CYCLEBUTTON_ID)  
{  
     BaseContainer*     bc = ((BaseTag* )node)->GetDataInstance();  
     if (!bc) return FALSE;  
     bc->SetLong(MY_CYCLEBUTTON_ID, t_data.GetLong());  
     flags |= DESCFLAGS_PARAM_SET;  
}

Since this is using SetDParameter() (GetDParameter() is sort of useless, isn't it?) - you have to set the container value - even though you or the user 'set' it already. :🤷:

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

On 27/04/2007 at 17:59, xxxxxxxx wrote:

Thansk 🙂

Great Robert!