Creating structured User Data



  • 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!



  • 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



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

    Hello max.pareschi,

    was your question answered?

    Best wishes,
    Sebastian


Log in to reply