Add UserData to a Group?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 11/12/2012 at 09:35, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 13
Platform: Windows ;
Language(s) : C++ ;---------
Can anyone tell me how to add a new user data item to a Group type UD entry?I know how to create them individually like this:
BaseDocument *doc = GetActiveDocument(); BaseObject *obj = doc->GetActiveObject(); DynamicDescription *dd = obj->GetDynamicDescription(); BaseContainer groupContainer; dd->FillDefaultContainer(groupContainer, DTYPE_GROUP, "New Group"); DescID groupID = dd->Alloc(groupContainer); dd->Set(groupID, groupContainer, obj); BaseContainer realContainer; dd->FillDefaultContainer(realContainer, DTYPE_REAL, "New Real"); DescID realID = dd->Alloc(realContainer); dd->Set(realID, realContainer, obj);
But how do I put that real UD inside the Group UD?
-ScottA
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 11/12/2012 at 12:05, xxxxxxxx wrote:
Originally posted by xxxxxxxx
Can anyone tell me how to add a new user data item to a Group type UD entry?
I know how to create them individually.
But how do I put that real UD inside the Group UD?
You have to set DESC_PARENTGROUP to the group ID in the user data description:
GeData dataID; dataID.SetCustomDataType(CUSTOMDATATYPE_DESCID, groupID); realContainer.SetData(DESC_PARENTGROUP, dataID);
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 11/12/2012 at 13:54, xxxxxxxx wrote:
Thank you sir.
Here is the working version of my code with the changes you provided:
BaseDocument *doc = GetActiveDocument(); BaseObject *obj = doc->GetActiveObject(); //The object the UD is attached to DynamicDescription* dd = obj->GetDynamicDescription(); BaseContainer groupContainer; dd->FillDefaultContainer(groupContainer, DTYPE_GROUP, "New Group"); DescID groupID = dd->Alloc(groupContainer); dd->Set(groupID, groupContainer, obj); BaseContainer realContainer; dd->FillDefaultContainer(realContainer, DTYPE_REAL, "New Real"); GeData dataID; dataID.SetCustomDataType(CUSTOMDATATYPE_DESCID, groupID); realContainer.SetData(DESC_PARENTGROUP, dataID); DescID realID = dd->Alloc(realContainer); dd->Set(realID, realContainer, obj);
I hate having to keep bothering you with such trivial things that should be shown in the SDK examples, or shown in the docs. It makes me feel like a pest.
Are you still working on the docs? Or is the current state of the SDK going to stay pretty much the same as it is now with only minor additions?-ScottA
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 12/12/2012 at 03:42, xxxxxxxx wrote:
Originally posted by xxxxxxxx
I hate having to keep bothering you with such trivial things that should be shown in the SDK examples, or shown in the docs. It makes me feel like a pest.
Are you still working on the docs? Or is the current state of the SDK going to stay pretty much the same as it is now with only minor additions?I'd like to add articles, tutorials, examples, etc. to both C++ and Python documentation but I need time . I hope I'll have enough time to add useful information to the documentations soon.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 12/12/2012 at 09:24, xxxxxxxx wrote:
OK. Sounds good.
It's just been such a long time since we were told the docs were going to be given a major overhaul. And it hasn't happened. So I'm just wondering what's going on. And if plans have changed.Sometimes the best laid plans of plans of mice and men often go astray.
If I can be of any help. Let me know.-ScottA