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

    Checkmark in submenu list when using GetSubContainer

    Cinema 4D SDK
    python r20
    2
    4
    788
    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 Boony2000

      Hi everyone!

      When adding entries to a custom menu via the GetSubContainer function of the commandData class I get a weird check mark when adding an entry to position 0. The first entry is also not clickable.

      def GetSubContainer(self, doc, submenu):
          submenu.SetString(0, "Entry1")
          submenu.SetString(1, "Entry2")
          submenu.SetString(2, "Entry3")
          return True
      

      0_1547733244270_weird checkmark.png

      I realize, that I can simply move up the indices by one and the result looks correct.

      def GetSubContainer(self, doc, submenu):
          submenu.SetString(1, "Entry1")
          submenu.SetString(2, "Entry2")
          submenu.SetString(3, "Entry3")
          return True
      

      0_1547733535053_weird checkmark 2.png

      I was just wondering why this happens or what you would use it for. I'm guessing it has something to do with the commandData plugin, that is already inserted at position 0?

      Edit: This is just tangentially related, but: Is it possible to add a seperator between the entries that are created in GetSubContainer?

      1 Reply Last reply Reply Quote 0
      • a_blockA
        a_block
        last edited by

        Hi,

        those first IDs are really special. As the documentation for GetSubContainer() states, for example ID 1 in the sub-container is used to name the sub-menu. To be honest I didn't check, why ID zero is also special. But I think, you will be fine, using IDs beginning from 1000 as also shown in the code snippets in the documentation.

        We will try to make the documentation more clear in this regard. Sorry for the inconvenience caused.

        Cheers,
        Andreas

        1 Reply Last reply Reply Quote 1
        • B
          Boony2000
          last edited by

          Thanks Andreas!
          That clears that up 🙂

          I have another question related to submenus. But since you guys like to keep things seperate I'll open a new thread. (Hope that's appropriate)

          1 Reply Last reply Reply Quote 0
          • a_blockA
            a_block
            last edited by

            Yes, that's appropriate. Thanks ☺

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