On 26/09/2014 at 11:47, xxxxxxxx wrote:
How can I add a userdata combobox using python?
Define a long and adding children to it does not work.
bc = c4d.GetCustomDatatypeDefault(c4d.DTYPE_LONG) # Create default container
bc[c4d.DESC_NAME] = "Point" # Rename the entry
element1 = node.AddUserData(bc) # Add userdata container
node[element1] = 2 # Assign a value
#DTYPE_CHILDREN
bc = c4d.GetCustomDatatypeDefault(c4d.DTYPE_CHILDREN) # Create default container
bc[c4d.DESC_NAME] = "Name 01" # Rename the entry
element11 = node.AddUserData(bc) # Add userdata container
node[element11] = "Name 01" # Assign a value