Hi,
sometimes I need to add a STATICTEXT element to a Description
in GetDDescription()
. I have this function that I've been using for many years now, and that works fine in R20 - C4D 2023. However, in C4D 2024, calling it does not do anything.
maxon::Bool AddStaticText(Description* const description, const DescID* const singleId, const DescID& groupid, const maxon::Int32 id = 0, const maxon::String& name = ""_s)
{
if (!description)
return false;
const DescID descId = CreateDescID(DescLevel(id, DTYPE_STATICTEXT, 0));
if (MAXON_LIKELY(!singleId || id.IsPartOf(*singleId, nullptr)))
{
BaseContainer bc = GetCustomDataTypeDefault(DTYPE_STATICTEXT);
bc.SetString(DESC_NAME, name);
bc.SetInt32(DESC_ANIMATE, DESC_ANIMATE_OFF);
bc.SetBool(DESC_REMOVEABLE, false);
return description->SetParameter(descId, bc, groupid);
}
return true;
}
I call it like this:
Bool MyObject::GetDDescription(const GeListNode* node, Description* description, DESCFLAGS_DESC& flags) const
{
if (!node || !description)
return false;
if (!description->LoadDescription(node->GetType()))
return false;
flags |= DESCFLAGS_DESC::LOADED;
const DescID* const singleid = description->GetSingleDescID();
if (!AddStaticText(description, singleid, MYOBJECT_SOMEGROUP))
return false;
return SUPER::GetDDescription(node, description, flags);
}
Why does this not work anymore in C4D 2024?