Post #1533: : post_01534
π·οΈ Tags
pie-menu hotkeys intermediate solved
βοΈ Related PME Features
- Command tab
- Property tab
- Python Scripting
π¬ Content
Kickflipkid687:
I got this working via an external Python Script, in another format, but can I write this as 1 line, and skip the external file?
if bpy.context.space_data.show_only_render == False bpy.context.space_data.show_only_render = True else bpy.context.space_data.show_only_render = False
Use this code in Command tab:
bpy.context.space_data.show_only_render = not bpy.context.space_data.show_only_render
Or:
setattr(bpy.context.space_data, "show_only_render", True) if bpy.context.space_data.show_only_render == False else setattr(bpy.context.space_data, "show_only_render", False)
Or just use the path in Property tab to add a toggle button:
bpy.context.space_data.show_only_render
Kickflipkid687:
Is it possible to copy this panel or settings somehow, so I can move object in Local Space/etc? Ideally Iβd like to be able to Toggle Global/Local Space buttons, and it would let me use the same spinners , but according to the space.
Itβs not easy but I think itβs possible. You can copy active operator settings using:
bpy.context.active_operator...