Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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
    1. Maxon Developers Forum
    2. RenoBozo
    R
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Best 0
    • Controversial 0
    • Groups 0

    RenoBozo

    @RenoBozo

    0
    Reputation
    2
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    RenoBozo Unfollow Follow

    Latest posts made by RenoBozo

    • CUSTOMGUI_CYCLE: SetContainer: TypeError: an integer is required (got type set)

      Hi, everyone,

      I can't get to make .SetContainer work.

      I'm doing this through a python tag, file attached.

      I looked everywhere, and I've seen the code on a few websites, I don't understand why it's not working.
      Is there a change I've missed?
      custom-gui.c4d
      My goal is to make the element selected so that I can use this component to make a sort of quick selector between objects.

      import c4d
      from c4d import gui
      from c4d import documents
      
      def MkUD(Object):
          children = Object.GetChildren()
          count = len(children)
          bc = c4d.GetCustomDataTypeDefault(c4d.DTYPE_LONG)
          bc.SetString(c4d.DESC_NAME, 'Objects')
          bc.SetInt32(c4d.DESC_CUSTOMGUI, c4d.CUSTOMGUI_CYCLE)
          cycle = c4d.BaseContainer()
          cycle.SetString(0, 'si')
          cycle.SetString(1, 'sai')
          print (cycle)
          bc.SetContainer(c4d.DESC_CYCLE, cycle) # I can see the UD when I comment this line
          Object.SetUserDataContainer([c4d.ID_USERDATA, 1], bc) # but nothing inside...
      
      def main():
          obj = doc.SearchObject("Null")
          MkUD(obj)
          c4d.EventAdd()
      

      I get:

      <c4d.BaseContainer object at 0x000001DF3FF609C0>
      Traceback (most recent call last):
        File "Python", line 20, in main
        File "Python", line 15, in MkUD
      TypeError: an integer is required (got type set)
      >>> 
      

      I'm on R25
      Thanks for your help, so frustrating.

      posted in Cinema 4D SDK python r25
      R
      RenoBozo