Navigation

    • Register
    • Login
        No matches found
    • Search
    1. Home
    2. RenoBozo
    R

    RenoBozo

    @RenoBozo

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

    • Profile
    • More
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups
    RenoBozo Follow

    Best posts made by RenoBozo

    This user hasn't posted anything yet.

    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 •