On 07/11/2015 at 18:25, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R16+
Platform: Windows ; Mac OSX ;
Language(s) : C++ ;
---------
The plugin is a generator object and there is a need to do a preliminary phase that 'constructs' the data that the object then uses to create geometry. In that effort, the user clicks a button to start the preliminary phase and then clicks that button again to stop the process. Using a GeDialog in the past, the button text could simply be changed to reflect the state of the process. But it is proving difficult to do the same with a description button that is defined in the .res for the object. Here is the code attempt in GetDDescription() :
if (m_bSetButton)
{
GeData data;
obj->GetParameter(DescID(V4DOBJECT_GROWING), data, DESCFLAGS_GET_0);
BaseContainer bc = GetCustomDataTypeDefault(DTYPE_BUTTON);
bc.SetInt32(DESC_CUSTOMGUI, CUSTOMGUI_BUTTON);
bc.SetInt32(DESC_ANIMATE, DESC_ANIMATE_OFF);
bc.SetBool(DESC_REMOVEABLE, FALSE);
if (data.GetBool())
{
GePrint("GetDDescription Growing");
bc.SetString(DESC_SHORT_NAME, "Growing...");
bc.SetString(DESC_NAME, "Growing...");
description->SetParameter(DescID(V4DOBJECT_GROW, DTYPE_BUTTON, 0), bc, DescLevel(ID_OBJECTPROPERTIES));
}
else
{
GePrint("GetDDescription Stop Growing");
bc.SetString(DESC_SHORT_NAME, "Start Growth Phase");
bc.SetString(DESC_NAME, "Start Growth Phase");
description->SetParameter(DescID(V4DOBJECT_GROW, DTYPE_BUTTON, 0), bc, DescLevel(ID_OBJECTPROPERTIES));
}
m_bSetButton = FALSE;
}
It does not change the button text at all. If need be, I could employ the Status... system, but it requires the user to notice offhand that the button has initiated the process or stopped the process. The look-and-feel is not very intuitive from that perspective.
Any ideas?