2
$\begingroup$

I'd like to hide the vast majority of the user interface. The users of my addon are biologists who are often quite intimidated by computers, so I'd like to limit the confusion on the screen to just the outliner, the panel of my custom addon, and the 3D view with no overlays, if possible.

How can I access the panels and other interface objects from python, in order to hide them from view? It's probably fine to just consider the layout workspace.

Thanks for your help!

$\endgroup$
5
  • 1
    $\begingroup$ You could customise the Layout workspace (even delete the other ones) by merging the different views until you only have the outliner and your addon left, also hide menus and headers, and save the file. Then makes the users open Blender by double-clicking the file. Just an idea. $\endgroup$
    – wilks
    Feb 26 at 16:39
  • $\begingroup$ Thanks wilks. I'm having trouble finding documentation on how to customize the Layout workspace, could you provide any tips or a link to an example? $\endgroup$
    – Animik
    Feb 26 at 16:49
  • $\begingroup$ You get a little crosshair in the views corners, pulling in splits and pulling out merges (when the adjacent view has the same size). About half way through this guy shows merging youtube.com/watch?v=HSm-cq7zd2s $\endgroup$
    – wilks
    Feb 26 at 16:52
  • $\begingroup$ I mean, how to do it from python... $\endgroup$
    – Animik
    Feb 26 at 16:56
  • $\begingroup$ Right, gee, not a clue. That's what I meant by having them open Blender through a file. But maybe you could do it manually, save a user preference file and load that with python? I don't know how you would go about doing that tho :) $\endgroup$
    – wilks
    Feb 26 at 17:05
3
$\begingroup$

"Whack" em all.

enter image description here

Script will "whack" (unregister) any registered Panel, Menu or Header class that follows the naming convention.

import bpy

classes_to_whack = (
        getattr(bpy.types, p) 
        for p in dir(bpy.types)
        if any(
            sep in p 
            for sep in ("_PT_", "_HT_", "_MT_")
            )
        )
        
for cls in classes_to_whack:
    bpy.utils.unregister_class(cls)

More sensible approach here Unregistering panels in python

$\endgroup$
4
  • $\begingroup$ Very helpful, thanks batFINGER. $\endgroup$
    – Animik
    Feb 26 at 17:14
  • 1
    $\begingroup$ Just a tad overkill. Cobbling together a panel beater addon that (among other functionality) makes all panels in a tab the children of one by Unrego,-> set parent -> then re-register. Both "cleans up" the interface, without totally removing. (for the rare biologist that can handle tech). Could prob be marked a dupe of link added.? $\endgroup$
    – batFINGER
    Feb 26 at 17:23
  • $\begingroup$ I spent quite a long time today googling, and never arrived at the link attached, because I didn't realizing that "unregistering" was the thing to do, so wasn't including that keyword in my searches. It's a duplicate, but with perhaps more general searchable keywords? $\endgroup$
    – Animik
    Feb 26 at 17:27
  • $\begingroup$ Ditto , is often difficult finding the "jargon" that is the key that unlocks finding the answers. $\endgroup$
    – batFINGER
    Feb 27 at 7:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.