Prototyping - Add tabs to switch between animation editors

Reiner's picture
Project: 
Bforartists Tracker

Adding tabs to switch between editor types is part of the UI proposal, which can be found here: http://www.bforartists.de/data/Bforartists_UI_redesign_Designdoc_Part%20...

We can of course already switch between the editor types by the little editor type menu. But this method is inconvenient and time consuming. You have to click at the tiny dropdown menu symbol, find the editor type that you want to use, then move the mouse to it, and click it to switch to it. We might need for example just two tabs to switch between the graph, dope and nla editor. And when we use tabs then the switch is much faster done. This also gives a better visual hint what is available. With less visual noise.

The plan is to have a customizable tab area, where you can add the tabs that you really need. But it might also end in fixed tabs, that can be changed in the python scripts then. Depends at how hard it is to implement the tabs.

Status: 
Closed (fixed)
Priority: 
Normal
Category: 
Task
Component: 
User interface
Assigned: 
Reporter: 
Created: 
Mon, 01/25/2016 - 10:04
Updated: 
Sun, 09/18/2016 - 10:37

Comments

13
Reiner's picture

Body: Old » New
Reiner's picture

This is part of prototyping.

I had some experiments with Python and buttons, since tabs are also just buttons. But it didn't turn out very well. See shot.

So putting that one on ice. Might be done with C or QT.

Example code so far:

import bpy

def execute_operator(self, context):
eval('bpy.ops.' + self.modes + '()')

class MyModes(bpy.types.PropertyGroup):
mode_options = [
("object.mode_set(mode='OBJECT')", "Object", '', 'OBJECT', 0),
("object.mode_set(mode='EDIT')", "Edit", '', 'EDIT', 1),
("object.mode_set(mode='SCULPT')", "Sculpt", '', 'SCULPT', 2),
("object.mode_set(mode='VERTEX_PAINT')", "Vertex P", '', 'VERTEX_PAINT', 3),
("object.mode_set", "Weight P", '', 'WEIGHT_PAINT', 4),
("object.mode_set", "Texture P", '', 'TEXTURE_PAINT', 5)
]

modes = bpy.props.EnumProperty(
items=mode_options,
description="Sets the object mode to ",
default="object.mode_set(mode='OBJECT')",
update=execute_operator
)

class CustomPanel(bpy.types.Panel):
"""A Custom Panel in the Viewport Toolbar"""
bl_label = "Modepanel"
bl_space_type = 'VIEW_3D'
bl_region_type = 'TOOLS'

def draw(self, context):
layout = self.layout
col = layout.column()
col.label(text="Modepanel")

# -------------------- The modes, in a dropdown box -----------------------------------------------------

col.prop(context.scene.mode_addon, "modes") # Dropdown

# -------------------- The modes, expanded as a button row -----------------------------------------------------

row = layout.row(align=False) # Doesn't work
row.alignment = 'LEFT' # Doesn't work
row.scale_y = 2.0 # Doesn't work
row.prop(context.scene.mode_addon, "modes", expand=True) # Expanded

# -------------------------------------------------------------------------
row = layout.row(align=False)
row.alignment = 'LEFT'
row.operator("my.button", text="", icon='OBJECT_DATAMODE')
row.operator("my.button", text="", icon='EDITMODE_HLT')
row.operator("my.button", text="", icon='SCULPTMODE_HLT')

row = layout.row(align=True)
row.alignment = 'LEFT'
row.operator("my.button", text="", icon='OBJECT_DATAMODE')
row.operator("my.button", text="", icon='EDITMODE_HLT')
row.operator("my.button", text="", icon='SCULPTMODE_HLT')

def register():
bpy.utils.register_module(__name__)
bpy.types.Scene.mode_addon = bpy.props.PointerProperty(type=MyModes)

def unregister():
bpy.utils.unregister_module(__name__)
del bpy.types.Scene.mode_addon

if __name__ == "__main__":
register()

 

Image: 
Reiner's picture

Status: Closed (won't fix) » Needs work
Reiner's picture

Title: Add tabs to switch between editors » Prototyping - Add tabs to switch between editors
Reiner's picture

No Qt implementation means out of reach. I might pick up the experiments though and might try to fix it with the old UI solution. So task stays online.

Reiner's picture

Assigned: Unassigned » Reiner
Status: Needs work » Active
Reiner's picture

Back to this task. We might need some kind of tab functionality for the new animation layout.

Reiner's picture

Fuck yeah \o/

Now we need icons for the activated state ...

The other posibility is to create a C menu like in the Properties editor. But i heavily dislike this solution. I stand for separating the menu from the core code. Not for mixing it.

Image: 
Reiner's picture

Done. Now the active editor button is colored. And so the animation editors have tabs now for quick switching.

The other place where tabs would make sense is the properties and outliner editor. Let's have a look how it turns out.

I still think about to turn this into a Blender addon. That way this tabs would be hidable by simply deactivating the addon. Depends if i manage to get the button row to display by addon code.

Image: 
Reiner's picture

Splitting up this task. Too much at once. This task here is just implementing the tabs for the animation editors now. And is more or less done. Just pushing ...

Reiner's picture

Title: Prototyping - Add tabs to switch between editors » Prototyping - Add tabs to switch between animation editors
Reiner's picture

Status: Active » Closed (fixed)
Reiner's picture