Here is what I am trying to achieve: I have two 3D views
- One for manipulating objects (which needs to have some custom manipulation tools in its header). This view cannot be rotated.
- A second one used to view the result from any point of view. This one does not allow to interact with the objects of the scene. It can be rotated.
The goal here is to hide the manipulators in the right 3d area from the user.
But, of course, there's still a plus sign
that allows the user to reach those features (not only from the toolbar, but on the sides toolshelves, etc, as well).
I tried different approaches so far.
- The most satisfying was to detach the right one into a new window and switch that view to fullscreen (removes anything else but the
window
region. But, since my app is small sized on screen, I would like to keep both views in a unique window. Another possibility I tried was to override the draw callback of the header. Of course it leads to removing it from both views:
def my_draw(self, context): #... pass bpy.types.VIEW3D_HT_header.draw = my_draw
Maybe there is a way to distinguish between the areas owning the header, and do the regular draw()
for the left one and leave it empty for the right one (but I don't think so). But an empty header on the right would be more than enough for me.
- I also tried to find a way to sort of mimic the way the
region_quadviews
work. That would have been a "dualviews" version, but don't really know where to start with that kind of approach. - And last thing I've been thinking about was to use another type of area for the right side and override its window region with the one from the left side area (since I won't need an
OUTLINER
, neither aRENDER
area). But same problem: I read lot of threads here and there, but couldn't figure out if this is something that can be done, and if so how to implement it.
Well, I've read many times that we cannot hide the header via python (just saw a patch allowing it here).
But, if you guys have an idea about how to get close to one of the options above, or have another approach to suggest (even a simple idea) to help having a behavior that is not to far from was I'm trying to achieve, then thanks for your time.
EDIT: To be more specific, I have disabled the 3D Manipulators
from user prefs
and have a modal operator
running on the left side allowing to deal with manipulating the green objects. And I use the code below to lock this same area from being rotated:
# Locks: Prevents from any numpad, mouse, ... rotation, as well as
# leaving the 'ORTHO' mode
rv3d.is_perspective = False
rv3d.lock_rotation = True
bpy.types.Header
supports thepoll()
classmethod to hide the header, but it's worth a try. Otherwise, put a condition in thedraw()
function to not draw anything for one panel. You should be able to distinguish multiple areas by comparing theirx
andy
attributes for instance, or regions via theirid
(note: not all seem to have a unique one, it can be 0 for multiple). $\endgroup$bpy.types.Header
only has a draw(). About your second proposal, I might be missing something here, but since I am working with two 3D View areas (id 0 and 1) that are sharing the same Header definitionVIEW3D_HT_header
, I should still get an identical header in both views. Is there a way to define abpy.type.Panel
for anHEADER
region? Is this what you had in mind? Thanks for your lights. $\endgroup$