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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    How do I create a menu item on the home screen next to the buttons.

    Cinema 4D SDK
    s26 s24 s22 r25 r23 python
    4
    8
    1.3k
    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.
    • C
      Cheba Name
      last edited by

      Hello everyone. My English is bad. I use a translator to write this question. Now I want to learn Cinema 4D and Python a little bit. So far, I understand half of the information on the site. But I can't solve the issue in any way. How do I create a drop-down menu on the main screen next to the buttons: "File", "Edit", "Create" and others. Which methods of which class are used for this. The same question about the sub menu. I hope they will help me. I see that writing plugins for Cinema 4D is not difficult. But sometimes I can't find the information I need because of the language barrier.

      1 Reply Last reply Reply Quote 0
      • merkvilsonM
        merkvilson
        last edited by

        Create a ".pyp" file in the Plugins directory(my_menu.pyp) and try this example.

        import c4d
        from c4d import gui
        
        def EnhanceMainMenu():
            mainMenu = gui.GetMenuResource("M_EDITOR")                 
            pluginsMenu = gui.SearchPluginMenuResource()               
        
        
            menu = c4d.BaseContainer()                                 
            menu.InsData(c4d.MENURESOURCE_SUBTITLE, "My Menu 1")  
            menu.InsData(c4d.MENURESOURCE_COMMAND, "PLUGIN_CMD_{}".format(c4d.Ocube))      
            menu.InsData(c4d.MENURESOURCE_SEPERATOR, True);             
            menu.InsData(c4d.MENURESOURCE_COMMAND, "PLUGIN_CMD_{}".format(c4d.Osphere))     
            menu.InsData(c4d.MENURESOURCE_COMMAND, "PLUGIN_CMD_{}".format(c4d.Oplane))     
        
            submenu = c4d.BaseContainer()
            submenu.InsData(c4d.MENURESOURCE_SUBTITLE, "Menu 2 ")
            submenu.InsData(c4d.MENURESOURCE_COMMAND, "PLUGIN_CMD_{}".format(c4d.Onull))     
            menu.InsData(c4d.MENURESOURCE_SUBMENU, submenu)
        
            if pluginsMenu: mainMenu.InsDataAfter(c4d.MENURESOURCE_STRING, menu, pluginsMenu)
            else: mainMenu.InsData(c4d.MENURESOURCE_STRING, menu)
        
        def PluginMessage(id, data):
            if id==c4d.C4DPL_BUILDMENU:
                EnhanceMainMenu()
        
        C 1 Reply Last reply Reply Quote 3
        • merkvilsonM
          merkvilson
          last edited by

          image.png

          DunhouD 1 Reply Last reply Reply Quote 1
          • DunhouD
            Dunhou @merkvilson
            last edited by

            And a great example by @ferdinand at Building menus with C4DPL_BUILDMENU in S26+.

            https://boghma.com
            https://github.com/DunHouGo

            1 Reply Last reply Reply Quote 2
            • C
              Cheba Name
              last edited by

              This is the first time I've been on the forums. And I see that there is no like button here. But thank you very much for your answers!

              1 Reply Last reply Reply Quote 0
              • C
                Cheba Name @merkvilson
                last edited by

                @merkvilson, You're just a miracle. Thank you very much. This will give me more knowledge in creating a visual menu. It will also allow you to experiment. You're a genius.

                i_mazlovI 1 Reply Last reply Reply Quote 0
                • i_mazlovI
                  i_mazlov @Cheba Name
                  last edited by

                  Hello @Cheba-Name !
                  Welcome to the Maxon developers forum and its community, it is great to have you with us!

                  Getting Started

                  Before creating your next postings, we would recommend making yourself accustomed with our forum and support procedures. You did not do anything wrong, we point all new users to these rules.

                  • Forum Overview: Provides a broad overview of the fundamental structure and rules of this forum, such as the purpose of the different sub-forums or the fact that we will ban users who engage in hate speech or harassment.
                  • Support Procedures: Provides a more in detail overview of how we provide technical support for APIs here. This topic will tell you how to ask good questions and limits of our technical support.
                  • Forum Features: Provides an overview of the technical features of this forum, such as Markdown markup or file uploads.

                  It is strongly recommended to read the first two topics carefully, especially the section Support Procedures: Asking Questions.

                  About your First Question

                  Thank you @merkvilson and @Dunhou for taking and active part of our community and for the comprehensive answers you provide! There's nothing special to add to this question.

                  There is no "like" button on this forum, however, there's an "upvote" button that has a similar functionality:
                  c027a4b6-a26d-4629-ae9a-188e1cd753b2-image.png

                  Cheers,
                  Ilia

                  MAXON SDK Specialist
                  developers.maxon.net

                  C 1 Reply Last reply Reply Quote 1
                  • C
                    Cheba Name @i_mazlov
                    last edited by

                    @i_mazlov , Do you speak Russian?

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