THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/12/2003 at 17:35, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 8.207
Platform: Windows ; Mac ;
Language(s) : C++ ;
---------
Hi,
I'm creating some UI elements for my plugin programmatically in [NodeData::]GetDDescription(). Everything works fine except the element defaults (using DESC_DEFAULT), which don't seem to be recognised.
Maybe I'm trying to use DESC_DEFAULT wrongly. What is it supposed to do? How else can one specify defaults for UI elements?
Unfortunately, I don't know which elements I will be creating until *after* [NodeData::]Read() has been called, so I can't initialise them in [NodeData::]Init(), and I haven't been able to find a way to detect whether a parameter has already been set in GetDDescription().
Is there a way to detect whether a parameter has already been set in GetDDescription()?
Here's more-or-less what I'm currently doing in GetDDescription()
Bool
MyPlugin::GetDDescription(GeListNode* node, Description* desc, LONG& flags)
{
if (!desc->LoadDescription(MY_PLUGIN_ID))
return false;
flags |= DESCFLAGS_DESC_LOADED;
LONG dtype = DA_LONG;
BaseContainer descbc = GetCustomDataTypeDefault(dtype);
String name = "my param name";
descbc.SetString(DESC_NAME, name);
descbc.SetString(DESC_SHORT_NAME, name);
// this seems to do nothing
descbc.SetLong(DESC_DEFAULT, 2); // for eg
// etc for DESC_MIN, DESC_MAX, DESC_MINSLIDER, DESC_MAXSLIDER
descbc.SetLong(DESC_CUSTOMGUI, CUSTOMGUI_LONGSLIDER);
DescID descid(DescLevel(MY_PARAM_ID, dtype, MY_PLUGIN_ID));
if (!desc->SetParameter(descid, descbc, DescLevel(ID_OBJECTPROPERTIES)))
return false;
return SUPER::GetDDescription(node, desc, flags);
}
Thanks.
.angus.
PS: I've found that CUSTOMGUI_LONGSLIDER uses DESC_MIN and DESC_MAX, not DESC_SLIDERMIN and DESC_SLIDERMAX. Is this intentional?