In Blender 2.8 we introduced the concept of contextual menus that depend on the current context. We show different things depending on which Editor is used and what mode we are in, as well as what type of object we have selected.
However, these menus could be a lot more contextually aware still.
For example, many commands only apply when you have a certain number of items selected. It makes no sense to join objects when there is only one selected. It makes no sense to unparent when there is no parent. It makes no sense to convert a mesh to a mesh, and so on. We could make these menus a lot smarter by looking at:
- Which Editor is used
- Which Mode is engaged
- If something is selected at all or not
- Which Item or object type is selected
- How many of them are selected
- Extra info, such as relationships (is item parented or not, or is item in a group or not)
Also, I think we can make the contextual manus a lot more useful, simply by including more commands here. When modeling, it should be possible to find basically all the main modeling commands using this menu system, as a more contextual alternative from using the header menus.
Here I've put together a patch that starts to add some more contextual logic to these menus.
What this does is:
- If no objects are selected, display different options (Add, Paste etc)
- More contextual items depending on the object selected
- In Node Editor display different items if nothing is selected, something is selected, or multiple nodes are selected (Group, Connect etc)
- In Edit Mode, added more contextual items
- In Edit Mode, make some items only appear under correct circumstances, such as:
- Bridge Faces only appears if you have 2 or more faces selected
- Merge, Connect Vertices and others only appears if more than 1 element is selected
This is just a beginning. This kind of contextual awareness should also be added to the UV Editor and in the other edit modes.
I'm submitting this patch mainly to get feedback if this is the right way to do it technically.