On 12/06/2013 at 12:15, xxxxxxxx wrote:
Cinema 4D Version: R14 Stud
Platform: Mac OSX ;
Language(s) : C++ ;
I'm trying to access userdata of existing objects. My objects have string, real and bool type data.
I have learned thus far that I need to fetch the dynamic description for the object. Using this I can iterate through the userdata items using BrowseInit, BrowseGetNext and BrowseClose methods within the dynamic description.
Iterating through the items I get a pointer to the basecontainer for each. Using that basecontainer I can retrieve the userdata name using GetString().
What I'm completely missing is how to get at the actual userdata values themselves; ie the string, real and bool.
Here's the code thus far...
DynamicDescription *dynDesc = obj->GetDynamicDescription();
if (dynDesc == NULL)
const BaseContainer *pbc;
void *browseHandle = dd->BrowseInit();
while (dynDesc->BrowseGetNext(browseHandle, &id, &pbc))
// need to access the userdata values here!
The code iterates through the list of userdata items quite happily. I just don't understand how the values are accessed through the basecontainer (pbc in my code).
Any help much appreciated especially in terms of the C++ SDK.