What should I write in the bl_context, if I want to put the panels inside the Tool Settings context?
I tried “tool” and “tool_settings”, and the Hello World Panel is still not appearing in it (I have no problem in the other contexts).
I think it’s a good idea to be able to add custom tabs in this part of Blender.
Or maybe it will be possible to use area to make something with it, like a library or a view for rigging.
I mean, create a new editor.
The ability of adding custom editors would/could be a workaround for floating windows.
We have some ideas for tools that are easier to work with in a ‘regular’ window due to the larger screen estate. The Properties panel or N-panel are often too narrow/ long for a proper UI.
We could take the Preferences window ‘hostage’, like the Scatter addon does, or we can make a new Editor window for it.
The second one would be preferable.
def pref_header(boolean):
"""show/hide header on 'PREFERENCE' areas"""
for window in bpy.context.window_manager.windows:
for area in window.screen.areas:
if(area.type == 'PREFERENCES'):
for space in area.spaces:
if(space.type == 'PREFERENCES'):
space.show_region_header = boolean
def panel_replace():
"""register impostors"""
#show header just in case user hided it
pref_header(True)
#replace class by impostor
try: bpy.utils.register_class(USERPREF_PT_addons)
except: pass
#replace class by impostor
try: bpy.utils.register_class(USERPREF_PT_navigation_bar)
except: pass
#replace class by impostor
try: bpy.utils.register_class(USERPREF_HT_header)
except: pass
def panel_restore():
"""restore and find original drawing classes"""
import os, sys
scr = bpy.utils.system_resource('SCRIPTS')
pth = os.path.join(scr,'startup','bl_ui')
if pth not in sys.path:
sys.path.append(pth)
#restore addons drawing
from space_userpref import USERPREF_PT_addons
bpy.utils.register_class(USERPREF_PT_addons)
#restore navigation panel
from space_userpref import USERPREF_PT_navigation_bar
bpy.utils.register_class(USERPREF_PT_navigation_bar)
#restore header
from space_userpref import USERPREF_HT_header
bpy.utils.register_class(USERPREF_HT_header)
It’s a bit dirty, but creating an operator that register a new class that will overwrite native GUI code, then a restore operator that will register old GUI again is working fine in Scatter4
The only thing extremely important is keep having a loud escape button to restore old interface.
It’s really cool, but as I told you on Twitter, I think it’s a bit “risky”.
I mean, what happens if a user wants to view the prefs while your window is open?
If 2 addons use the same process, you will probably have the same problem.
It would be so much easier to have floating windows natively… like 98% of other softwares in fact…