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

    AddUserData() for In/Exclusion List?

    Cinema 4D SDK
    r21 python
    2
    3
    393
    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.
    • B
      bentraje
      last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • r_giganteR
        r_gigante
        last edited by

        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

        1 Reply Last reply Reply Quote 3
        • B
          bentraje
          last edited by

          @r_gigante

          Thanks for the response. Works as expected.

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