Post #2231: Wow, thanks. Didn’t know about this feature.
📋 Metadata
- Author: roaoao
- Date: 2019-04-29 11:03:06
- Type:
answer - Quality Score: 9/10
- Reply to: post_02229
- Replies (1): post_02232
🏷️ Tags
v1-20-x macro scripting advanced solved
⚙️ Related PME Features
- Macro Editor
- Python Scripting
- Pie Menu Editor
- Popup Dialog Editor
💬 Content
Wow, thanks. Didn’t know about this feature.
Here is the code for the pie, menu or popup (Command tab, Blender 2.8+):
macro_name = "My Macro"; ao = C.active_object; ([(setattr(C.view_layer.objects, "active", o), open_menu(macro_name)) for o in C.selected_objects], setattr(C.view_layer.objects, "active", ao)) if E.alt else open_menu(macro_name)
Alt+Click a button to call the macro for all selected objects
Click to call it for the active object only.
Note that you can pass variables to your macro:
open_menu("My Macro", my_var1=111, my_var2=222)
❤️ 2 likes