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

    Seperators in GetSubContainer

    Cinema 4D SDK
    python windows r20
    2
    2
    452
    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
      Boony2000
      last edited by

      Hi again!

      I am still messing around with custom menus. Is it possible to add any kind of seperator inside a submenu?
      Trying to insert a seperator inside GetSubContainer doesn't do anything.

      I am trying to do something like the redshift menu has.
      0_1548258425232_redshift_menu.png

      Or do the seperators here mean that the grouped entries are seperate commandData Plugins?

      A workaround might be to add disabled entries that display a line by naming them "----------&d&"
      Is there documentation on stuff like &d& or [name]&i[iconID]&? Finding these nuggets of wisdom by chance in random forums is not a very efficient way to figure out stuff.

      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by m_adam

        Hi @Boony2000

        In a GetSubContainer, to insert a separator use InsData(0, "") The ID used should always be 0. As described in ShowPopupDialog Example.

        Which give us

            def GetSubContainer(self, doc, submenu) :
                menuItems = [["name1"], ["name2", "hasIcon"], ["name3"]]
        
                for i, data in enumerate(menuItems) :
                    if len(data) > 1:
                        submenu.SetString(i+1000, data[0] + "&i" + str(c4d.IDM_KEY_NEXT) + "&")
                        submenu.InsData(0, "")
                    else:
                        submenu.SetString(i+1000, data[0])
        
                return True
        

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

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