On 22/02/2013 at 01:58, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R14
Platform: Windows ;
Language(s) : C++ ;
---------
Hi,
I've just recently started exploring plugin development for C4D in C++. Coming from Python I now find myself struggling with the most simple things, which I pretty much expected (Never been a C++ buff to begin with ).
At the moment I'm running into a brick wall trying to dynamically set the contents of a dropdown menu in my descriptions. I'm writing an ObjectData plugin and I want the dropdown to reflect the changes being made by the user. Here is what I've done so far:
BaseObject *op = (BaseObject* )node;
BaseContainer *data = op->GetDataInstance();
data->SetReal(MY_PARAMETER, 1.0);
// Until here it works, but the next lines is where the trouble starts
BaseContainer listBC;
listBC.SetString(0, String("Test"));
BaseContainer bc = GetCustomDataTypeDefault(DTYPE_LONG);
bc.SetString(DESC_NAME, "List");
bc.SetContainer(DESC_CYCLE, listBC);
data->SetParameter(CHANNEL_NAMES, bc);
To be honest I've just butchered the last part together from pieces of this post https://plugincafe.maxon.net/topic/6616/7177_dynamic-drop-down-list-in-ressource so it's no wonder it's not working. I also realize, that Kuroyume said to place the code inside an overridden GetDDescription() function, but that also didn't work for me.
Isn't there a quick and efficient way to do what I want? Again, sorry for the noobish question, but everyone has to start somewhere, right?
Cheers
Johannes