On 13/02/2015 at 18:58, xxxxxxxx wrote:
Hi Sebastian,
this is a quite good and neat example!!, thanks
but I'm still aware of an unsolved part which is:
adding description dynamically using GetDDescription()
I just copied and pasted the GetDDescription() part from the lookatcamera tag example
Bool SDKExampleMaterial::GetDDescription(GeListNode* node, Description* description, DESCFLAGS_DESC& flags)
{
if (!description->LoadDescription(ID_SDK_EXAMPLE_MATERIAL))
return false;
const DescID* singleid = description->GetSingleDescID();
DescID cid = DescLevel(16001, DTYPE_GROUP, 0);
if (!singleid || cid.IsPartOf(*singleid, nullptr)) // important to check for speedup c4d!
{
BaseContainer maingroup = GetCustomDataTypeDefault(DTYPE_GROUP);
maingroup.SetString(DESC_NAME, "Main Group");
if (!description->SetParameter(cid, maingroup, DescLevel(0)))
return true;
}
cid = DescLevel(16002, DTYPE_GROUP, 0);
if (!singleid || cid.IsPartOf(*singleid, nullptr)) // important to check for speedup c4d!
{
BaseContainer subgroup = GetCustomDataTypeDefault(DTYPE_GROUP);
subgroup.SetString(DESC_NAME, "Sub Group");
if (!description->SetParameter(cid, subgroup, DescLevel(16001)))
return true;
}
cid = DescLevel(16003, DTYPE_BOOL, 0);
if (!singleid || cid.IsPartOf(*singleid, nullptr)) // important to check for speedup c4d!
{
BaseContainer locked = GetCustomDataTypeDefault(DTYPE_BOOL);
locked.SetString(DESC_NAME, "SPECIAL Locked");
locked.SetBool(DESC_DEFAULT, true);
if (!description->SetParameter(cid, locked, DescLevel(16002)))
return true;
}
cid = DescLevel(16004, DTYPE_BOOL, 0);
if (!singleid || cid.IsPartOf(*singleid, nullptr)) // important to check for speedup c4d!
{
BaseContainer locked = GetCustomDataTypeDefault(DTYPE_BOOL);
locked = GetCustomDataTypeDefault(DTYPE_LONG);
locked.SetString(DESC_NAME, "SPECIAL Long");
locked.SetBool(DESC_DEFAULT, true);
if (!description->SetParameter(cid, locked, DescLevel(16002)))
return true;
}
flags |= DESCFLAGS_DESC_LOADED;
return true;
}