AddUserData() for In/Exclusion List?



  • Hi,

    I'm trying to add user data with In/Exclusion List type.
    But this type doesn't seem to be enumerated in the c4d.GetCustomDataTypeDefault(type) documentation.

    I tried DTYPE_CHILDREN and DTYPE_MULTIPLEDATA but nothing seems to come out except a blank user data. Although I only use DESC_NAME for its settings.

    Are there any special type not found in the usual documentation reference?



  • Hi @bentraje, thanks for reaching out us.

    With regard to your request, note that the c4d.InExcludeData entry in the documentation reports the CUSTOMDATATYPE_INEXCLUDE_LIST which is the correct type to use.

    ...
        if op is None:
            return
        
        bc = c4d.GetCustomDataTypeDefault(c4d.CUSTOMDATATYPE_INEXCLUDE_LIST)
        bc[c4d.DESC_NAME] = 'InExclude'
        bc.SetLong(c4d.IN_EXCLUDE_FLAG_NUM_FLAGS, 1)
        bc.SetLong(c4d.IN_EXCLUDE_FLAG_INIT_STATE, 1)
        bc.SetLong(c4d.IN_EXCLUDE_FLAG_IMAGE_01_ON, 1018640)
        bc.SetLong(c4d.IN_EXCLUDE_FLAG_IMAGE_01_OFF, 1018641)
        
        op.AddUserData(bc)
        c4d.EventAdd()
    ...
    

    Best, R



  • Hi @bentraje, thanks for reaching out us.

    With regard to your request, note that the c4d.InExcludeData entry in the documentation reports the CUSTOMDATATYPE_INEXCLUDE_LIST which is the correct type to use.

    ...
        if op is None:
            return
        
        bc = c4d.GetCustomDataTypeDefault(c4d.CUSTOMDATATYPE_INEXCLUDE_LIST)
        bc[c4d.DESC_NAME] = 'InExclude'
        bc.SetLong(c4d.IN_EXCLUDE_FLAG_NUM_FLAGS, 1)
        bc.SetLong(c4d.IN_EXCLUDE_FLAG_INIT_STATE, 1)
        bc.SetLong(c4d.IN_EXCLUDE_FLAG_IMAGE_01_ON, 1018640)
        bc.SetLong(c4d.IN_EXCLUDE_FLAG_IMAGE_01_OFF, 1018641)
        
        op.AddUserData(bc)
        c4d.EventAdd()
    ...
    

    Best, R



  • @r_gigante

    Thanks for the response. Works as expected.


Log in to reply