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
    • Recent
    • Tags
    • Users
    • Login

    Creating structured User Data

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 368 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

      On 29/07/2015 at 01:59, xxxxxxxx wrote:

      Hi everyone,

      I'd like to know the reccomended workflow to create userdata basecontainer and then pass it as a correctly formed object to a newly created python effector with the SetUserDataContainer() syntax.

      Unfortunately, while i'm able to create single user data in a list, I don't really know how to set minimum, maximums, default values, nested groups etc.

      I know that i need to play with the DescLevels and the various enums like c4d.DESC_HIDE, but I cannot work this out using only the official documentation.

      This is what I'm after:

      Thanks!

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

        On 30/07/2015 at 02:06, xxxxxxxx wrote:

        Hello,

        you can define the parent group of a userdata parameter using the DESC_PARENTGROUP property referencing the DescID of the parent group. This can look like this:

          
        if op is None:  
         return  
          
        groupBC = c4d.GetCustomDataTypeDefault(c4d.DTYPE_GROUP)  
        groupBC[c4d.DESC_NAME] = "Group"   
        groupID = op.AddUserData(groupBC)  
          
        stringBC = c4d.GetCustomDataTypeDefault(c4d.DTYPE_STRING)  
        stringBC[c4d.DESC_NAME] = "String"   
        stringBC[c4d.DESC_PARENTGROUP] = groupID  
        groupID = op.AddUserData(stringBC)  
          
        c4d.EventAdd()  
        

        You find the full list of description settings in the C++ documentation. You also find extensive examples on how to configure parameters using description settings the Description example on GitHub.

        Please notice that the Python API has some limitations so it might not be possible to create every desired parameter type.

        Best wishes,
        Sebastian

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

          On 07/08/2015 at 09:03, xxxxxxxx wrote:

          Hello max.pareschi,

          was your question answered?

          Best wishes,
          Sebastian

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