On 02/12/2013 at 20:37, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R15
Platform: Windows ;
Language(s) : C++ ;
---------
Hi guys, I have a little problem, that drives me nuts.
I have an ObjectData plugin where I do all the main user interface stuff the usual way with a description resource.
But now I'd like to add a STATICTEXT at the end of ID_OBJECTPROPERTIES from within the source code (dynamically), because the content of this STATICTEXT shouldn't be possible to alter with simply editing the resource files.
Here is, how I tried it:
Bool MyPlugin::GetDDescription(GeListNode* node, Description* description, DESCFLAGS_DESC& flags)
{
if (!description->LoadDescription(node->GetType())) return FALSE;
BaseContainer *bc;
const DescID *single_id = description->GetSingleDescID();
DescID desc_id;
// add a static text field
desc_id = DescLevel(ID_OBJECTPROPERTIES, DTYPE_STATICTEXT, 0);
if(!single_id || desc_id.IsPartOf(*single_id, NULL)) // important to check for speedup c4d!
{
bc = description->GetParameterI(desc_id, NULL);
if (bc)
{
BaseContainer container = GetCustomDataTypeDefault(DTYPE_STATICTEXT); // Create a custom datatype container.
container.SetLong(MYPLUGIN_INFO, 9000); // I'm not sure if that makes any sense at all.
container.SetString(DTYPE_STATICTEXT, "Here would be the respective text, that should be added."); // but I guess it's wrong here
container.SetString(DESC_NAME, "Or maybe here?");
container.SetString(DESC_SHORT_NAME, "Or here?"); // very unlikely but just to have it checked
container.SetContainer(DTYPE_STATICTEXT, *bc); // probably wrong too
}
}
flags |= DESCFLAGS_DESC_LOADED;
return ObjectData::GetDDescription(node, description, flags);
}
I also tried it with the "BaseContainer.SetParameter()" function but without success either.
But as you may see from the source example above, I couldn't even find out the correct ID to assign the text string.
And most likely it's total crap anyway, how I tried it.
Would be nice, if someone could help me with this topic.
(By the way, the "MyPlugin" naming is of course only here for this demo purpose, so no comments about that please! )