📋 Metadata
- Author: roaoao
- Date: 2018-08-26 06:25:39
- Type:
answer - Reply to: post_01532
- Replies (1): post_01534
💬 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...