Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Add UserData to a Group?

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 473 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        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);
        
        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          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

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            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.

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              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

              1 Reply Last reply Reply Quote 0
              • First post
                Last post