Post #251: : post_00254
🏷️ Tags
pie-menu context-sensitive-menus beginner solved
⚙️ Related PME Features
- Pie Menu Editor
- Python Scripting
- Context Sensitive Menus
💬 Content
servapunk:
How could I add a context sensitive when nothing is selected? Currently when I have nothing selected the menu of the last active object appears. I need a menu to appear when nothing is selected. I am trying to make this change but I am noob whith python.
Import examples_context_sensitive.json file, select “Object Context Sensitive Menu” and replace it’s command with this (Command tab):
name = C.selected_objects and C.active_object and C.active_object.type.title() or "Object (None)"; open_menu(name) or open_menu("Object")
Now “Object Context Sensitive Menu” will open “Object (None)” menu if there is no selected object in your scene.