THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 23/07/2007 at 20:05, xxxxxxxx wrote:
If you are doing this in Init() why can't you just use a static description in the .h and .res files? Then you could set the string and get it using whatever (including COFFEE).
But if it is truly a dynamic description, doing it in Init() this way will not work. It must be done in GetDDescription().
The gui type for a text edit is CUSTOMGUI_STRING. But there is more to this. The way you are doing it (which is much more work if a static description), you would need to do this as well:
BaseContainer bc = GetCustomDataTypeDefault(DTYPE_STRING);
bc.SetString(DESC_NAME, "AI Map Info");
bc.SetString(DESC_SHORT_NAME, "AI Map Info");
bc.SetLong(DESC_CUSTOMGUI, CUSTOMGUI_STRING);
Description* desription;
op->GetDescription(description, 0L);
// This adds the description element to the Description
description->SetParameter(DescLevel(??,DTYPE_STRING,0),bc,DESC_ROOT);
The ?? is because you MUST set an ID value (LONG) for the description element that is unique for this node. The static ones are usually defined in the plugin object header (Omyplugin.h or Tmyplugin.h). That is how you access the description resource - and it is the ONLY way. Cinema 4D runs on IDs - and for descriptions, it lives off of them. ;)
To set the actual description value, you need to get the BaseContainer for the node object (op) and set using that:
BaseContainer* obc = op->GetDataInstance();
obc->SetString(??, "test string data");
Do the same to get the value:
String str = obc->GetString(??);