Use tabs for image editor.

For initial discussion see T38371

This commit organized panels for image editor to new tab categories dependent
on the image editor mode:

View Mode:
Tools - contains UV tools (currently only transform and UV Sculpting)
Scopes - contains scopes
Grease Pencil - contains Grease Pencil operators

Paint Mode:
Tools - contains brush options
Scopes - as above
Grease Pencil - as above

Mask Mode
Mask - contains mask tools
Scopes - as above
Grease Pencil - as above

Grease Pencil panel/tab now includes operators, not view options which have been
moved to the UI region on the right.
To make this work better, image editor toolbar now is of type TOOLS instead
of PREVIEW as was the case previously. A nice version patch makes sure all
works predictably, but opening newer files with older blender executables
could backfire.

This commit does not address which UV Tools will be included in the
Tools tab for the view mode, but does include some basic tools (transform)
and provides a class to inherit from to avoid conflicts with UV Sculpting.

Reviewers: brecht, dingto, sergey

Differential Revision: https://developer.blender.org/D315
This commit is contained in:
2014-02-13 19:49:26 +02:00
parent 6b1a4fc66e
commit eb7485389b
9 changed files with 318 additions and 206 deletions

View File

@@ -21,7 +21,7 @@
import bpy
from bpy.types import Panel, Header, Menu, UIList
from bpy.app.translations import pgettext_iface as iface_
from bl_ui.properties_grease_pencil_common import GreasePencilPanel
class CLIP_UL_tracking_objects(UIList):
def draw_item(self, context, layout, data, item, icon,
@@ -1043,28 +1043,11 @@ class CLIP_PT_tools_mask(MASK_PT_tools, Panel):
# --- end mask ---
class CLIP_PT_tools_grease_pencil(Panel):
class CLIP_PT_tools_grease_pencil(GreasePencilPanel, Panel):
bl_space_type = 'CLIP_EDITOR'
bl_region_type = 'TOOLS'
bl_label = "Grease Pencil"
bl_category = "Grease Pencil"
def draw(self, context):
layout = self.layout
col = layout.column(align=True)
row = col.row(align=True)
row.operator("gpencil.draw", text="Draw").mode = 'DRAW'
row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT'
row = col.row(align=True)
row.operator("gpencil.draw", text="Poly").mode = 'DRAW_POLY'
row.operator("gpencil.draw", text="Erase").mode = 'ERASER'
row = col.row(align=True)
row.prop(context.tool_settings, "use_grease_pencil_sessions")
class CLIP_PT_footage(CLIP_PT_clip_view_panel, Panel):
bl_space_type = 'CLIP_EDITOR'