diff options
author | Sebastian Koenig <sebastiankoenig@posteo.de> | 2019-06-19 16:05:25 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-06-19 16:06:10 +0300 |
commit | 72690bbeca854423355f5cc4507726aecd9898c3 (patch) | |
tree | 2ceaf3157f21b7bcb01ce68b01b5de92b792a9e6 | |
parent | 11c9702dd40f1461ee2d2c1136909a867d4f06f9 (diff) |
Bring mask tools back to Masking Tool Area and update Context Menu
The mask tools in the Tool Area of Clip Editor where never brought back,
after decision was made to postpone proper masking tools to 2.81.
This brings back the Mask Tool Panel in the Mask tab of Masking Tool Area.
This Diff also adds a better Context Menu, which respects whether you're
in Masking or Tracking mode. I have added the most important operators
there, with a focus on those that are otherwise harder to access.
Reviewers: sergey, billreynish
Subscribers: sebastian, brecht, hype
Tags: #motion_tracking
Differential Revision: https://developer.blender.org/D5075
-rw-r--r-- | release/scripts/startup/bl_ui/properties_mask_common.py | 35 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_clip.py | 109 |
2 files changed, 120 insertions, 24 deletions
diff --git a/release/scripts/startup/bl_ui/properties_mask_common.py b/release/scripts/startup/bl_ui/properties_mask_common.py index 872b51d51ff..fd8ca542f9f 100644 --- a/release/scripts/startup/bl_ui/properties_mask_common.py +++ b/release/scripts/startup/bl_ui/properties_mask_common.py @@ -239,7 +239,6 @@ class MASK_PT_transforms: # ~ bl_region_type = 'TOOLS' bl_label = "Transforms" bl_category = "Mask" - bl_options = {'DEFAULT_CLOSED'} @classmethod def poll(cls, context): @@ -257,6 +256,40 @@ class MASK_PT_transforms: col.operator("transform.transform", text="Scale Feather").mode = 'MASK_SHRINKFATTEN' +class MASK_PT_tools: + bl_label = "Mask Tools" + bl_category = "Mask" + + @classmethod + def poll(cls, context): + space_data = context.space_data + return space_data.mask and space_data.mode == 'MASK' + + def draw(self, _context): + layout = self.layout + + col = layout.column(align=True) + col.label(text="Spline:") + col.operator("mask.delete") + col.operator("mask.cyclic_toggle") + col.operator("mask.switch_direction") + col.operator("mask.handle_type_set").type = 'VECTOR' + col.operator("mask.feather_weight_clear") + + col = layout.column(align=True) + col.label(text="Parenting:") + row = col.row(align=True) + row.operator("mask.parent_set", text="Parent") + row.operator("mask.parent_clear", text="Clear") + + col = layout.column(align=True) + col.label(text="Animation:") + row = col.row(align=True) + row.operator("mask.shape_key_insert", text="Insert Key") + row.operator("mask.shape_key_clear", text="Clear Key") + col.operator("mask.shape_key_feather_reset", text="Reset Feather Animation") + col.operator("mask.shape_key_rekey", text="Re-Key Shape Points") + class MASK_MT_add(Menu): bl_label = "Add" diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index d138615e9be..f653f8f738f 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -465,17 +465,17 @@ class CLIP_PT_tools_tracking(CLIP_PT_tracking_panel, Panel): row = layout.row(align=True) row.label(text="Track:") - props = row.operator("clip.track_markers", text="", icon='FRAME_PREV') + props = row.operator("clip.track_markers", text="", icon='TRACKING_BACKWARDS_SINGLE') props.backwards = True props.sequence = False props = row.operator("clip.track_markers", text="", - icon='PLAY_REVERSE') + icon='TRACKING_BACKWARDS') props.backwards = True props.sequence = True - props = row.operator("clip.track_markers", text="", icon='PLAY') + props = row.operator("clip.track_markers", text="", icon='TRACKING_FORWARDS') props.backwards = False props.sequence = True - props = row.operator("clip.track_markers", text="", icon='FRAME_NEXT') + props = row.operator("clip.track_markers", text="", icon='TRACKING_FORWARDS_SINGLE') props.backwards = False props.sequence = False @@ -484,10 +484,10 @@ class CLIP_PT_tools_tracking(CLIP_PT_tracking_panel, Panel): row.label(text="Clear:") row.scale_x = 2.0 - props = row.operator("clip.clear_track_path", text="", icon='BACK') + props = row.operator("clip.clear_track_path", text="", icon='TRACKING_CLEAR_BACKWARDS') props.action = 'UPTO' - props = row.operator("clip.clear_track_path", text="", icon='FORWARD') + props = row.operator("clip.clear_track_path", text="", icon='TRACKING_CLEAR_FORWARDS') props.action = 'REMAINED' col = layout.column() @@ -495,10 +495,10 @@ class CLIP_PT_tools_tracking(CLIP_PT_tracking_panel, Panel): row.label(text="Refine:") row.scale_x = 2.0 - props = row.operator("clip.refine_markers", text="", icon='LOOP_BACK') + props = row.operator("clip.refine_markers", text="", icon='TRACKING_REFINE_BACKWARDS') props.backwards = True - props = row.operator("clip.refine_markers", text="", icon='LOOP_FORWARDS') + props = row.operator("clip.refine_markers", text="", icon='TRACKING_REFINE_FORWARDS') props.backwards = False col = layout.column(align=True) @@ -1113,6 +1113,7 @@ from bl_ui.properties_mask_common import ( MASK_PT_point, MASK_PT_display, MASK_PT_transforms, + MASK_PT_tools ) @@ -1151,6 +1152,10 @@ class CLIP_PT_tools_mask_transforms(MASK_PT_transforms, Panel): bl_region_type = 'TOOLS' bl_category = "Mask" +class CLIP_PT_tools_mask_tools(MASK_PT_tools, Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'TOOLS' + bl_category = "Mask" # --- end mask --- @@ -1226,6 +1231,7 @@ class CLIP_MT_view(Menu): layout.prop(sc, "show_region_ui") layout.prop(sc, "show_region_toolbar") layout.prop(sc, "show_region_hud") + layout.prop(sc, "show_region_tool_header") layout.separator() @@ -1421,9 +1427,16 @@ class CLIP_MT_select_grouped(Menu): layout.operator_enum("clip.select_grouped", "group") +class CLIP_MT_mask_handle_type_menu(Menu): + bl_label = "Set Handle Type" + + def draw(self, _context): + layout = self.layout + + layout.operator_enum("mask.handle_type_set", "type") class CLIP_MT_tracking_context_menu(Menu): - bl_label = "Specials" + bl_label = "Context Menu" @classmethod def poll(cls, context): @@ -1432,25 +1445,73 @@ class CLIP_MT_tracking_context_menu(Menu): def draw(self, _context): layout = self.layout - layout.operator("clip.disable_markers", - text="Enable Markers").action = 'ENABLE' + mode = _context.space_data.mode - layout.operator("clip.disable_markers", - text="Disable Markers").action = 'DISABLE' + if mode == 'TRACKING': - layout.separator() - layout.operator("clip.set_origin") + layout.operator("clip.track_settings_to_track") + layout.operator("clip.track_settings_as_default") - layout.separator() - layout.operator("clip.hide_tracks") - layout.operator("clip.hide_tracks_clear", text="Show Tracks") + layout.separator() - layout.separator() - layout.operator("clip.lock_tracks", text="Lock Tracks").action = 'LOCK' + layout.operator("clip.track_copy_color") + + layout.separator() + + layout.operator("clip.copy_tracks", icon='COPYDOWN') + layout.operator("clip.paste_tracks", icon='PASTEDOWN') + + layout.separator() + + layout.operator("clip.disable_markers", + text="Disable Markers").action = 'DISABLE' + layout.operator("clip.disable_markers", + text="Enable Markers").action = 'ENABLE' + + layout.separator() + + layout.operator("clip.hide_tracks") + layout.operator("clip.hide_tracks_clear", text="Show Tracks") - layout.operator("clip.lock_tracks", - text="Unlock Tracks").action = 'UNLOCK' + layout.separator() + + layout.operator("clip.lock_tracks", text="Lock Tracks").action = 'LOCK' + layout.operator("clip.lock_tracks", + text="Unlock Tracks").action = 'UNLOCK' + + layout.separator() + + layout.operator("clip.join_tracks") + + layout.separator() + + layout.operator("clip.delete_track") + + elif mode == 'MASK': + + layout.menu("CLIP_MT_mask_handle_type_menu") + layout.operator("mask.switch_direction") + layout.operator("mask.cyclic_toggle") + + layout.separator() + + layout.operator("mask.copy_splines", icon='COPYDOWN') + layout.operator("mask.paste_splines", icon='PASTEDOWN') + + layout.separator() + + layout.operator("mask.shape_key_rekey", text="Re-key Shape Points") + layout.operator("mask.feather_weight_clear") + layout.operator("mask.shape_key_feather_reset", text="Reset Feather Animation") + + layout.separator() + + layout.operator("mask.parent_set") + layout.operator("mask.parent_clear") + + layout.separator() + layout.operator("mask.delete") class CLIP_PT_camera_presets(PresetPanel, Panel): """Predefined tracking camera intrinsics""" @@ -1696,6 +1757,7 @@ classes = ( CLIP_PT_active_mask_spline, CLIP_PT_active_mask_point, CLIP_PT_tools_mask_transforms, + CLIP_PT_tools_mask_tools, CLIP_PT_tools_scenesetup, CLIP_PT_grease_pencil, CLIP_PT_tools_grease_pencil_draw, @@ -1717,7 +1779,8 @@ classes = ( CLIP_MT_marker_pie, CLIP_MT_tracking_pie, CLIP_MT_reconstruction_pie, - CLIP_MT_solving_pie + CLIP_MT_solving_pie, + CLIP_MT_mask_handle_type_menu ) if __name__ == "__main__": # only for live edit. |