I'm trying to see if there is a way for me to get a boolean value for the tools menu being opened or closed. I know you can see a few toggle options using something like console.toggle() but I wasn't able to find anything about the tools menu in the Blender Documentation or other similar questions on this platform. Thanks!
1 Answer
$\begingroup$
$\endgroup$
2
I fiddled a bit in the python console and found the show_region_ui
property of the 3D Viewport space indicating this:
for area in bpy.context.screen.areas:
if area.type == 'VIEW_3D':
for space in area.spaces:
if space.type == 'VIEW_3D':
# True: n-panel is open
# False: n-panel is closed
n_panel_is_open = space.show_region_ui
# You can even set it
if not n_panel_is_open:
space.show_region_ui = True
break
-
$\begingroup$ Thank you so much! Is show_region_ui in the docs? Every time I search for it I don't get results... this is such a useful method to know! $\endgroup$ Commented Sep 26, 2022 at 21:23
-
$\begingroup$ Well, technically there is an entry in the docs, but it is explaining nothing, so not of much use. $\endgroup$ Commented Sep 26, 2022 at 22:12