hello,
You have to set the DESC_PARENT_COLLAPSE of the "parent" to -1 so it act as a parent. For the children, just set the ID to the parent's ID.
virtual Bool GetDDescription(GeListNode* node, Description* description, DESCFLAGS_DESC& flags)
{
if (!description->LoadDescription(node->GetType()))
return false;
const DescID* singleid = description->GetSingleDescID();
DescID cid = DescLevel(firstID, DTYPE_REAL, 0);
// check if this parameter ID is requested (NOTE: this check is important for speed)
if (!singleid || cid.IsPartOf(*singleid, nullptr))
{
// define the new parameter description
BaseContainer settings = GetCustomDataTypeDefault(DTYPE_REAL);
settings.SetString(DESC_NAME, "A float"_s);
settings.SetInt32(DESC_PARENT_COLLAPSE, -1);
// set the new parameter
if (!description->SetParameter(cid, settings, ID_OBJECTPROPERTIES))
return false;
}
cid = DescLevel(secondID, DTYPE_REAL, 0);
if (!singleid || cid.IsPartOf(*singleid, nullptr))
{
// define the new parameter description
BaseContainer settings = GetCustomDataTypeDefault(DTYPE_REAL);
settings.SetString(DESC_NAME, "Another float"_s);
settings.SetInt32(DESC_PARENT_COLLAPSE, firstID);
// set the new parameter
if (!description->SetParameter(cid, settings, ID_OBJECTPROPERTIES))
return false;
}
cid = DescLevel(thirdID, DTYPE_BOOL, 0);
if (!singleid || cid.IsPartOf(*singleid, nullptr))
{
// define the new parameter description
BaseContainer settings = GetCustomDataTypeDefault(DTYPE_BOOL);
settings.SetString(DESC_NAME, "A Bool"_s);
settings.SetInt32(DESC_PARENT_COLLAPSE, firstID);
// set the new parameter
if (!description->SetParameter(cid, settings, ID_OBJECTPROPERTIES))
return false;
}
flags |= DESCFLAGS_DESC::LOADED;
return SUPER::GetDDescription(node, description, flags);
}
Cheers
Manuel