Menus are another aspect of blender's user interface. While the drawing layout works very similarly to panels, menus are actual popup elements the user can interact with. They require slightly more special setup to properly register and be used, but are also a very useful to customize.
- Now let's look at another type…of user interface element called a menu.…As opposed to a panel, which is a…persistent part of the user interface,…a menu is a pop up which generally…contains operators as part of a similar area.…For example, from the 3D view if I click on…the object part of the header,…we see a menu which contains various…submenus and operators related to objects.…While we have already seen use of the…menu template from the text editor,…let's go ahead and write an example by scratch.…
Changing this to a text editor view,…let's go ahead and create a new text block,…enable line numbers, word wrapping…and syntax highlighting,…and increase the size so we can…see it a little bit better.…As always we're going to first start…by importing bpy.…And then we have two main sections:…the menu class and then the registration.…Let's first look at the menu class.…We can name it whatever we'd like,…such as myCustomMenu.…And then the input is the type from bpy.…
Note how previously we had used bpy.types.pound…to create a panel.…
AuthorPatrick W. Crawford
- Controlling Blender with code
- Exploring the bpy library
- Creating Blender operators and properties
- Writing scripts
- Auto running scripts
- Drawing interface elements such as panels and menus
- Building a custom add-on
Skill Level Intermediate
Introduction to Data Analysis with Pythonwith Michele Vallisneri2h 16m Intermediate
1. Controlling Blender through Code
2. Create Blender Scripts
3. Customize Blender Interfaces
4. Build Your Own Add-On
Next steps1m 15s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.