Initial expose of tools into interface for mask editing.
Maybe no ideal, but looks better than completely empty panels.
This commit is contained in:
@@ -44,9 +44,12 @@ class CLIP_HT_header(Header):
|
||||
|
||||
sub.menu("CLIP_MT_clip")
|
||||
|
||||
if clip and sc.mode != 'MASKEDITING':
|
||||
sub.menu("CLIP_MT_track")
|
||||
sub.menu("CLIP_MT_reconstruction")
|
||||
if clip:
|
||||
if sc.mode == 'MASKEDITING':
|
||||
sub.menu("CLIP_MT_mask")
|
||||
else:
|
||||
sub.menu("CLIP_MT_track")
|
||||
sub.menu("CLIP_MT_reconstruction")
|
||||
|
||||
if sc.mode != 'MASKEDITING':
|
||||
layout.prop(sc, "view", text="", expand=True)
|
||||
@@ -55,6 +58,14 @@ class CLIP_HT_header(Header):
|
||||
if sc.view == 'CLIP':
|
||||
layout.prop(sc, "mode", text="")
|
||||
layout.prop(sc, "pivot_point", text="", icon_only=True)
|
||||
|
||||
if sc.mode == 'MASKEDITING':
|
||||
toolsettings = context.tool_settings
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.prop(toolsettings, "use_proportional_edit_mask", text="", icon_only=True)
|
||||
if toolsettings.use_proportional_edit_objects:
|
||||
row.prop(toolsettings, "proportional_edit_falloff", text="", icon_only=True)
|
||||
elif sc.view == 'GRAPH':
|
||||
row = layout.row(align=True)
|
||||
|
||||
@@ -75,15 +86,8 @@ class CLIP_HT_header(Header):
|
||||
row.template_ID(sc, "clip", open='clip.open')
|
||||
|
||||
if sc.mode == 'MASKEDITING':
|
||||
toolsettings = context.tool_settings
|
||||
|
||||
row = layout.row()
|
||||
row.template_ID(sc, "mask", new="mask.new")
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.prop(toolsettings, "use_proportional_edit_mask", text="", icon_only=True)
|
||||
if toolsettings.use_proportional_edit_objects:
|
||||
row.prop(toolsettings, "proportional_edit_falloff", text="", icon_only=True)
|
||||
|
||||
if clip:
|
||||
tracking = clip.tracking
|
||||
@@ -116,6 +120,16 @@ class CLIP_PT_clip_view_panel:
|
||||
return clip and sc.view == 'CLIP'
|
||||
|
||||
|
||||
class CLIP_PT_mask_view_panel:
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
sc = context.space_data
|
||||
clip = sc.clip
|
||||
|
||||
return clip and sc.view == 'CLIP' and sc.mode == 'MASKEDITING'
|
||||
|
||||
|
||||
class CLIP_PT_tracking_panel:
|
||||
|
||||
@classmethod
|
||||
@@ -136,16 +150,6 @@ class CLIP_PT_reconstruction_panel:
|
||||
return clip and sc.mode == 'RECONSTRUCTION' and sc.view == 'CLIP'
|
||||
|
||||
|
||||
class CLIP_PT_distortion_panel:
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
sc = context.space_data
|
||||
clip = sc.clip
|
||||
|
||||
return clip and sc.mode == 'DISTORTION' and sc.view == 'CLIP'
|
||||
|
||||
|
||||
class CLIP_PT_tools_marker(CLIP_PT_tracking_panel, Panel):
|
||||
bl_space_type = 'CLIP_EDITOR'
|
||||
bl_region_type = 'TOOLS'
|
||||
@@ -372,11 +376,51 @@ class CLIP_PT_tools_object(CLIP_PT_reconstruction_panel, Panel):
|
||||
col.prop(settings, "object_distance")
|
||||
|
||||
|
||||
class CLIP_PT_tools_grease_pencil(CLIP_PT_distortion_panel, Panel):
|
||||
class CLIP_PT_tools_mask(CLIP_PT_mask_view_panel, Panel):
|
||||
bl_space_type = 'CLIP_EDITOR'
|
||||
bl_region_type = 'TOOLS'
|
||||
bl_label = "Mask Tools"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.label(text="Transform:")
|
||||
col.operator("transform.translate")
|
||||
col.operator("transform.rotate")
|
||||
col.operator("transform.resize", text="Scale")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.label(text="Spline:")
|
||||
col.operator("mask.delete")
|
||||
col.operator("mask.cyclic_toggle")
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.label(text="Parenting:")
|
||||
col.operator("mask.parent_set")
|
||||
col.operator("mask.parent_clear")
|
||||
|
||||
|
||||
class CLIP_PT_tools_grease_pencil(Panel):
|
||||
bl_space_type = 'CLIP_EDITOR'
|
||||
bl_region_type = 'TOOLS'
|
||||
bl_label = "Grease Pencil"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
sc = context.space_data
|
||||
clip = sc.clip
|
||||
|
||||
if not clip:
|
||||
return False
|
||||
|
||||
if sc.mode == 'DISTORTION':
|
||||
return sc.view == 'CLIP'
|
||||
elif sc.mode == 'MASKEDITING':
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
@@ -591,7 +635,7 @@ class CLIP_PT_mask_objects(Panel):
|
||||
active = mask.layers.active
|
||||
if active:
|
||||
layout.prop(active, "name")
|
||||
|
||||
|
||||
# blending
|
||||
row = layout.row(align=True)
|
||||
row.prop(active, "alpha")
|
||||
@@ -718,12 +762,11 @@ class CLIP_PT_display(CLIP_PT_clip_view_panel, Panel):
|
||||
col.label(text="Display Aspect Ratio:")
|
||||
row = col.row()
|
||||
row.prop(clip, "display_aspect", text="")
|
||||
|
||||
|
||||
if sc.mode == 'MASKEDITING':
|
||||
col = layout.column()
|
||||
col.prop(sc, "mask_draw_type", text="")
|
||||
col.prop(sc, "show_mask_smooth")
|
||||
|
||||
|
||||
|
||||
class CLIP_PT_marker_display(CLIP_PT_clip_view_panel, Panel):
|
||||
@@ -900,6 +943,7 @@ class CLIP_PT_footage(CLIP_PT_clip_view_panel, Panel):
|
||||
layout.operator("clip.open", icon='FILESEL')
|
||||
|
||||
|
||||
|
||||
class CLIP_PT_tools_clip(CLIP_PT_clip_view_panel, Panel):
|
||||
bl_space_type = 'CLIP_EDITOR'
|
||||
bl_region_type = 'TOOLS'
|
||||
@@ -1079,16 +1123,26 @@ class CLIP_MT_select(Menu):
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
sc = context.space_data
|
||||
|
||||
layout.operator("clip.select_border")
|
||||
layout.operator("clip.select_circle")
|
||||
if sc.mode == 'MASKEDITING':
|
||||
layout.operator("mask.select_border")
|
||||
layout.operator("mask.select_circle")
|
||||
|
||||
layout.separator()
|
||||
layout.separator()
|
||||
|
||||
layout.operator("clip.select_all").action = 'TOGGLE'
|
||||
layout.operator("clip.select_all", text="Inverse").action = 'INVERT'
|
||||
layout.operator("mask.select_all").action = 'TOGGLE'
|
||||
layout.operator("mask.select_all", text="Inverse").action = 'INVERT'
|
||||
else:
|
||||
layout.operator("clip.select_border")
|
||||
layout.operator("clip.select_circle")
|
||||
|
||||
layout.menu("CLIP_MT_select_grouped")
|
||||
layout.separator()
|
||||
|
||||
layout.operator("clip.select_all").action = 'TOGGLE'
|
||||
layout.operator("clip.select_all", text="Inverse").action = 'INVERT'
|
||||
|
||||
layout.menu("CLIP_MT_select_grouped")
|
||||
|
||||
|
||||
class CLIP_MT_select_grouped(Menu):
|
||||
@@ -1132,6 +1186,54 @@ class CLIP_MT_tracking_specials(Menu):
|
||||
props.action = 'UNLOCK'
|
||||
|
||||
|
||||
class CLIP_MT_mask(Menu):
|
||||
bl_label = "Mask"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.operator("mask.delete")
|
||||
|
||||
layout.separator()
|
||||
layout.operator("mask.cyclic_toggle")
|
||||
|
||||
layout.separator()
|
||||
layout.operator("mask.parent_clear")
|
||||
layout.operator("mask.parent_set")
|
||||
|
||||
layout.separator()
|
||||
layout.operator("mask.shape_key_clear")
|
||||
layout.operator("mask.shape_key_insert")
|
||||
|
||||
layout.separator()
|
||||
layout.menu("CLIP_MT_mask_visibility")
|
||||
layout.menu("CLIP_MT_mask_transform")
|
||||
|
||||
|
||||
class CLIP_MT_mask_visibility(Menu):
|
||||
bl_label = "Show/Hide"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.operator("mask.hide_view_clear", text="Show Hidden")
|
||||
layout.operator("mask.hide_view_set", text="Hide Selected")
|
||||
|
||||
props = layout.operator("mask.hide_view_set", text="Hide Unselected")
|
||||
props.unselected = True
|
||||
|
||||
|
||||
class CLIP_MT_mask_transform(Menu):
|
||||
bl_label = "Transform"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.operator("transform.translate")
|
||||
layout.operator("transform.rotate")
|
||||
layout.operator("transform.resize")
|
||||
|
||||
|
||||
class CLIP_MT_camera_presets(Menu):
|
||||
"""Predefined tracking camera intrinsics"""
|
||||
bl_label = "Camera Presets"
|
||||
|
||||
Reference in New Issue
Block a user