# Custom inteface: Two 3D views with a different header (toolbar)

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


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 a RENDER 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

• I'm not sure if bpy.types.Header supports the poll() classmethod to hide the header, but it's worth a try. Otherwise, put a condition in the draw() function to not draw anything for one panel. You should be able to distinguish multiple areas by comparing their x and y attributes for instance, or regions via their id (note: not all seem to have a unique one, it can be 0 for multiple). – CodeManX Aug 2 '15 at 9:40
• @CoDEmanX Thanks for your comment. Regarding the first proposal, if your talking about overriding the poll() method in my VIEW3D_HT_header, it seems that 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 definition VIEW3D_HT_header, I should still get an identical header in both views. Is there a way to define a bpy.type.Panel for an HEADER region? Is this what you had in mind? Thanks for your lights. – Gauthier Boaglio Aug 2 '15 at 12:19

The only way to truly hide portions of the interface from users is to create a custom build of Blender. This would allow you to restrict interface components as well as providing very specific views and screens for your application functions.

There are a number of projects that have done this:

Fluid Designer (by Microvellum) - http://www.microvellum.com/products/fluid-designer/

Interactive Pizza Designer by Daniele De Luca - https://vimeo.com/68119398

• Ok, thank you Todd. Actually I had already studied Fluid Designer's tweakings, and if you look closer, you'll see that the main menu is a simple rewriting of the 'INFO' header's draw(), and that the left hand stuffs, a rewrite of the 'FILE_BROWSER'. Also, the little pluses are everywhere and nothing is truly hidden. They tried to stay Python sided as much as possible and the only C hack I could find was to enable drag & drop from the left panel to the 3D area. I'll have a look to your second link very soon. And give back here some leads on my final option. Cheers. – Gauthier Boaglio Jul 31 '15 at 14:02
• Probably the shortest way would be to disable or hide the 'pluses' and forbid to change the general layout (disable or hide split/join areas arrows) from C side... Don't know yet. – Gauthier Boaglio Jul 31 '15 at 14:11
• I'd be very interested once you do figure out a solution. I've not done a custom build myself yet, but have come close to needing to for a number of client projects. – Todd McIntosh Jul 31 '15 at 14:23
• Sure, the project I am working on is a simplified interface for designing podology soles (the blue object in the above image is a foot...). All the features are quite ready, except I still don't know exactly how to present a good user experience. I don't know if Pizza Designer' Project is open sourced, but I couldn't locate any source code. Mine will. I'll provide a link ASAP. – Gauthier Boaglio Jul 31 '15 at 14:39

You don't have to create a custom build! What you're trying is easy to accomplish with python using custom scripts and by modifying the space_view3D.py, space_topbar.py, space_userpref.py and a few others in the "yourinstalldirectory\2.80\scripts\startup\bl_ui" directory.

PieMenuEditor does a lot more than just pie menus, by the way. You can hide parts of the interface, and create custom buttons, menus, macros and more very easily without touching a bit of python.