THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 23/01/2012 at 07:10, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R12
Platform: Windows ;
Language(s) : C++ ;
---------
Hello,
within my effector plugin, there're quite some parameters generated while runtime (rather than in the ressource files). This seems to work fine, at least most of it. Somehow I'm not able to set the default values of newly created Vector parameters. Actually , this is not quite correct. I seem to be able to set the default values, but they aren't represented in the GUI. If I use "Set to defaults" from the context menu, the GUI also shows the correct values. But if I do not use "Set to defaults" and change a component of the vector, the other components will be set to the wrongly displayed GUI values.
I hope, I was able to describe the behaviour understandably.
Here's my ModifyDDescription() :
Bool MyTestPlugin::ModifyDDescription(GeListNode *node, Description *description, AtomArray* ar)
{
const DescID *singleid = description->GetSingleDescID();
BaseContainer * const bcData = ((BaseList2D* )node)->GetDataInstance();
DescID cid;
for (LONG idx = 0; idx < ed.iMax; idx++) {
cid = DescLevel(MYTESTPLUGIN_GROUP_BASE + idx, DTYPE_GROUP, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL)) { // important to check for speedup c4d!
BaseContainer subgroup = GetCustomDataTypeDefault(DTYPE_GROUP);
subgroup.SetString(DESC_NAME, "Group" + LongToString(idx));
if (!description->SetParameter(cid, subgroup, DescLevel(MYTESTPLUGIN_GROUP))) {
return TRUE;
}
}
cid = DescLevel(MYTESTPLUGIN_SIZE_BASE + idx, DTYPE_VECTOR, 0);
if (!singleid || cid.IsPartOf(*singleid, NULL)) { // important to check for speedup c4d!
BaseContainer bc = GetCustomDataTypeDefault(DTYPE_VECTOR);
bc.SetString(DESC_NAME, "Size");
bc.SetVector(DESC_MIN, Vector(RCO 0.001, RCO 0.001, RCO 0.001));
bc.SetVector(DESC_MAX, Vector(RCO 2.0, RCO 2.0, RCO 2.0));
bc.SetVector(DESC_STEP, Vector(RCO 0.001, RCO 0.001, RCO 0.001));
bc.SetVector(DESC_DEFAULT, Vector(RCO 1.0, RCO 1.0, RCO 1.0));
bc.SetLong(DESC_UNIT, DESC_UNIT_PERCENT);
if (!description->SetParameter(cid, bc, DescLevel(MYTESTPLUGIN_GROUP_BASE + idx))) {
return TRUE;
}
}
}
return TRUE;
}
Thanks in advance,
regards,
Andreas