How do I create a menu item on the home screen next to the buttons.
-
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.
-
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()
-
-
And a great example by @ferdinand at Building menus with C4DPL_BUILDMENU in S26+.
-
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!
-
@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.
-
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:
Cheers,
Ilia -
@i_mazlov , Do you speak Russian?