2

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!

Animik
  • 593
  • 7
  • 16
  • 1
    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. – pevinkinel Feb 26 '21 at 16:39
  • 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? – Animik Feb 26 '21 at 16:49
  • 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 https://www.youtube.com/watch?v=HSm-cq7zd2s – pevinkinel Feb 26 '21 at 16:52
  • I mean, how to do it from python... – Animik Feb 26 '21 at 16:56
  • 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 :) – pevinkinel Feb 26 '21 at 17:05

1 Answers1

3

"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

batFINGER
  • 84,216
  • 10
  • 108
  • 233
  • Very helpful, thanks batFINGER. – Animik Feb 26 '21 at 17:14
  • 1
    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.? – batFINGER Feb 26 '21 at 17:23
  • 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? – Animik Feb 26 '21 at 17:27
  • Ditto , is often difficult finding the "jargon" that is the key that unlocks finding the answers. – batFINGER Feb 27 '21 at 07:35