diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-02-07 18:26:43 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-02-07 18:27:59 +0400 |
commit | 8614ed64eddbf62d8e1a1346525398ec305896bd (patch) | |
tree | 19026189ecd5bb00284a01812613367a1e87bb3a /release | |
parent | e2e9c519009fae68eda6c31122e5b7f833476112 (diff) |
Add Tabs for Movie Clip Editor
Based on the patch from Sebastian Koenig, discussed with Jonathan Williamson
https://developer.blender.org/T38172
Also removed redundant modes from clip editor.
Reviewers: brecht, carter2422
Reviewed By: carter2422
CC: sebastian_k, carter2422
Differential Revision: https://developer.blender.org/D293
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_mask_common.py | 75 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_clip.py | 433 |
2 files changed, 330 insertions, 178 deletions
diff --git a/release/scripts/startup/bl_ui/properties_mask_common.py b/release/scripts/startup/bl_ui/properties_mask_common.py index 5e64129ade0..0efff3bf1af 100644 --- a/release/scripts/startup/bl_ui/properties_mask_common.py +++ b/release/scripts/startup/bl_ui/properties_mask_common.py @@ -216,21 +216,24 @@ class MASK_PT_display(): layout = self.layout space_data = context.space_data - - layout.prop(space_data, "mask_draw_type", text="") - layout.prop(space_data, "show_mask_smooth") - - layout.prop(space_data, "show_mask_overlay") - row = layout.row() + col = layout.column(align=True) + row = col.row(align=True) + row.prop(space_data, "show_mask_smooth", text="Smooth") + row.prop(space_data, "mask_draw_type", text="") + col = layout.column(align=True) + row = col.row(align=True) + row.prop(space_data, "show_mask_overlay", text="Overlay") row.active = space_data.show_mask_overlay row.prop(space_data, "mask_overlay_mode", text="") -class MASK_PT_tools(): +class MASK_PT_transforms(): # subclasses must define... #~ bl_space_type = 'CLIP_EDITOR' #~ bl_region_type = 'TOOLS' - bl_label = "Mask Tools" + bl_label = "Transforms" + bl_category = "Mask" + bl_options = {'DEFAULT_CLOSED'} @classmethod def poll(cls, context): @@ -247,24 +250,63 @@ class MASK_PT_tools(): col.operator("transform.resize", text="Scale") col.operator("transform.transform", text="Scale Feather").mode = 'MASK_SHRINKFATTEN' + +class MASK_PT_tools(): + # subclasses must define... + #~ bl_space_type = 'CLIP_EDITOR' + #~ bl_region_type = '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") + col.operator("mask.feather_weight_clear") col = layout.column(align=True) col.label(text="Parenting:") - col.operator("mask.parent_set") - col.operator("mask.parent_clear") + 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:") - col.operator("mask.shape_key_clear") - col.operator("mask.shape_key_insert") - col.operator("mask.shape_key_feather_reset") - col.operator("mask.shape_key_rekey") + row = col.row(align=True) + row.operator("mask.shape_key_clear", text="Insert Key") + row.operator("mask.shape_key_insert", 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_PT_add(): + # subclasses must define... + #~ bl_space_type = 'CLIP_EDITOR' + #~ bl_region_type = 'TOOLS' + bl_label = "Add" + bl_category = "Mask" + + @classmethod + def poll(cls, context): + space_data = context.space_data + return space_data.mode == 'MASK' + + def draw(self, context): + layout = self.layout + + col = layout.column(align=True) + col.operator("mask.primitive_circle_add", icon="MESH_CIRCLE") + col.operator("mask.primitive_square_add", icon="MESH_PLANE") class MASK_MT_mask(Menu): @@ -286,10 +328,6 @@ class MASK_MT_mask(Menu): layout.operator("mask.parent_set") layout.separator() - layout.operator("mask.copy_splines") - layout.operator("mask.paste_splines") - - layout.separator() layout.menu("MASK_MT_visibility") layout.menu("MASK_MT_transform") layout.menu("MASK_MT_animation") @@ -349,6 +387,7 @@ class MASK_MT_select(Menu): layout.operator("mask.select_all").action = 'TOGGLE' layout.operator("mask.select_all", text="Inverse").action = 'INVERT' + layout.operator("mask.select_linked", text="Select Linked") if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index ee6ddc87f36..8ffd73474fc 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -63,7 +63,7 @@ class CLIP_HT_header(Header): if sc.view == 'CLIP': layout.prop(sc, "mode", text="") layout.prop(sc, "view", text="", expand=True) - layout.prop(sc, "pivot_point", icon_only=True) + layout.prop(sc, "pivot_point", text="", icon_only=True) r = active_object.reconstruction @@ -127,14 +127,14 @@ class CLIP_HT_header(Header): row = layout.row() row.template_ID(sc, "mask", new="mask.new") - layout.prop(sc, "pivot_point", icon_only=True) + layout.prop(sc, "pivot_point", text="", icon_only=True) row = layout.row(align=True) row.prop(toolsettings, "use_proportional_edit_mask", - icon_only=True) + text="", icon_only=True) if toolsettings.use_proportional_edit_mask: row.prop(toolsettings, "proportional_edit_falloff", - icon_only=True) + text="", icon_only=True) def draw(self, context): layout = self.layout @@ -226,10 +226,34 @@ class CLIP_PT_reconstruction_panel: return clip and sc.mode == 'RECONSTRUCTION' and sc.view == 'CLIP' +class CLIP_PT_tools_clip(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'TOOLS' + bl_label = "Clip" + bl_translation_context = bpy.app.translations.contexts.id_movieclip + bl_category = "Track" + + @classmethod + def poll(cls, context): + sc = context.space_data + clip = sc.clip + + return clip and sc.view == 'CLIP' and sc.mode != 'MASK' + + def draw(self, context): + layout = self.layout + col = layout.column(align=True) + row = col.row(align=True) + row.operator("clip.prefetch", text="Prefetch") + row.operator("clip.reload", text="Reload") + col.operator("clip.set_scene_frames") + + class CLIP_PT_tools_marker(CLIP_PT_tracking_panel, Panel): bl_space_type = 'CLIP_EDITOR' bl_region_type = 'TOOLS' bl_label = "Marker" + bl_category = "Track" def draw(self, context): layout = self.layout @@ -239,71 +263,89 @@ class CLIP_PT_tools_marker(CLIP_PT_tracking_panel, Panel): settings = clip.tracking.settings col = layout.column(align=True) - col.operator("clip.add_marker_at_click", text="Add Marker") + row = col.row(align=True) + row.operator("clip.add_marker_at_click", text="Add") + row.operator("clip.delete_track", text="Delete") col.operator("clip.detect_features") - col.operator("clip.delete_track") - box = layout.box() - row = box.row(align=True) - row.prop(settings, "show_default_expanded", text="", emboss=False) - row.label(text="Tracking Settings") - if settings.show_default_expanded: - col = box.column() - row = col.row(align=True) - label = CLIP_MT_tracking_settings_presets.bl_label - row.menu('CLIP_MT_tracking_settings_presets', text=label) - row.operator("clip.tracking_settings_preset_add", - text="", icon='ZOOMIN') - row.operator("clip.tracking_settings_preset_add", - text="", icon='ZOOMOUT').remove_active = True +class CLIP_PT_tracking_settings(CLIP_PT_tracking_panel, Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'TOOLS' + bl_label = "Tracking Settings" + bl_category = "Track" - col.separator() + def draw(self, context): - row = col.row(align=True) - row.prop(settings, "use_default_red_channel", - text="R", toggle=True) - row.prop(settings, "use_default_green_channel", - text="G", toggle=True) - row.prop(settings, "use_default_blue_channel", - text="B", toggle=True) + sc = context.space_data + clip = sc.clip + settings = clip.tracking.settings + layout = self.layout + col = layout.column() + + row = col.row(align=True) + label = CLIP_MT_tracking_settings_presets.bl_label + row.menu('CLIP_MT_tracking_settings_presets', text=label) + row.operator("clip.tracking_settings_preset_add", + text="", icon='ZOOMIN') + row.operator("clip.tracking_settings_preset_add", + text="", icon='ZOOMOUT').remove_active = True - col.separator() + row = col.row(align=True) + row.prop(settings, "use_default_red_channel", + text="R", toggle=True) + row.prop(settings, "use_default_green_channel", + text="G", toggle=True) + row.prop(settings, "use_default_blue_channel", + text="B", toggle=True) - sub = col.column(align=True) - sub.prop(settings, "default_pattern_size") - sub.prop(settings, "default_search_size") + col.separator() - col.label(text="Tracker:") - col.prop(settings, "default_motion_model") - col.prop(settings, "use_default_brute") - col.prop(settings, "use_default_normalization") - col.prop(settings, "use_default_mask") - col.prop(settings, "default_correlation_min") + sub = col.column(align=True) + sub.prop(settings, "default_pattern_size") + sub.prop(settings, "default_search_size") - col.separator() + col.prop(settings, "default_motion_model") + + row = col.row(align=True) + row.label(text="Match:") + row.prop(settings, "default_pattern_match", text="") + + row = col.row(align=True) + row.prop(settings, "use_default_brute") + row.prop(settings, "use_default_normalization") + + col.separator() + col.operator("clip.track_settings_as_default", + text="Copy From Active Track") + + box = layout.box() + row = box.row(align=True) + row.prop(settings, "show_default_expanded", text="", emboss=False) + row.label(text="Extra Settings") + + if settings.show_default_expanded: + col = box.column() + row = col.row() + row.prop(settings, "use_default_mask") sub = col.column(align=True) + sub.prop(settings, "default_correlation_min") sub.prop(settings, "default_frames_limit") sub.prop(settings, "default_margin") - col.label(text="Match:") - col.prop(settings, "default_pattern_match", text="") - - col.separator() - col.operator("clip.track_settings_as_default", - text="Copy From Active Track") - class CLIP_PT_tools_tracking(CLIP_PT_tracking_panel, Panel): bl_space_type = 'CLIP_EDITOR' bl_region_type = 'TOOLS' bl_label = "Track" + bl_category = "Track" def draw(self, context): layout = self.layout row = layout.row(align=True) + row.label(text="Track:") props = row.operator("clip.track_markers", text="", icon='FRAME_PREV') props.backwards = True @@ -319,19 +361,32 @@ class CLIP_PT_tools_tracking(CLIP_PT_tracking_panel, Panel): props.backwards = False props.sequence = False - col = layout.column() - col.label(text="Refine:") + col = layout.column(align=True) row = col.row(align=True) - row.operator("clip.refine_markers", text="Backwards").backwards = True - row.operator("clip.refine_markers", text="Forwards").backwards = False + row.label(text="Clear:") + row.scale_x = 2.0 + + props = row.operator("clip.clear_track_path", icon="BACK", text="") + props.action = 'UPTO' + + props = row.operator("clip.clear_track_path", icon="FORWARD", text="") + props.action = 'REMAINED' col = layout.column() - col.label(text="Clear:") row = col.row(align=True) - row.operator("clip.clear_track_path", text="Before").action = 'UPTO' - row.operator("clip.clear_track_path", text="After").action = 'REMAINED' + row.label(text="Refine:") + row.scale_x = 2.0 - layout.operator("clip.join_tracks", text="Join") + props = row.operator("clip.refine_markers", icon='LOOP_BACK', text="") + props.backwards = True + + props = row.operator("clip.refine_markers", icon='LOOP_FORWARDS', text="") + props.backwards = False + + col = layout.column(align=True) + row = col.row(align=True) + row.label(text="Merge:") + row.operator("clip.join_tracks", text="Join Tracks") class CLIP_PT_tools_plane_tracking(CLIP_PT_tracking_panel, Panel): @@ -339,6 +394,7 @@ class CLIP_PT_tools_plane_tracking(CLIP_PT_tracking_panel, Panel): bl_region_type = 'TOOLS' bl_label = "Plane Track" bl_options = {'DEFAULT_CLOSED'} + bl_category = "Solve" def draw(self, context): layout = self.layout @@ -349,6 +405,7 @@ class CLIP_PT_tools_solve(CLIP_PT_tracking_panel, Panel): bl_space_type = 'CLIP_EDITOR' bl_region_type = 'TOOLS' bl_label = "Solve" + bl_category = "Solve" def draw(self, context): layout = self.layout @@ -358,16 +415,10 @@ class CLIP_PT_tools_solve(CLIP_PT_tracking_panel, Panel): settings = tracking.settings tracking_object = tracking.objects.active - col = layout.column(align=True) - - col.operator("clip.solve_camera", - text="Camera Motion" if tracking_object.is_camera - else "Object Motion") - col.operator("clip.clear_solution") - col = layout.column() - col.prop(settings, "use_tripod_solver") - col.prop(settings, "use_keyframe_selection") + row = col.row() + row.prop(settings, "use_tripod_solver", text="Tripod") + row.prop(settings, "use_keyframe_selection", text="Keyframe") col = layout.column(align=True) col.active = (not settings.use_tripod_solver and @@ -377,14 +428,24 @@ class CLIP_PT_tools_solve(CLIP_PT_tracking_panel, Panel): col = layout.column(align=True) col.active = tracking_object.is_camera - col.label(text="Refine:") - col.prop(settings, "refine_intrinsics", text="") + row = col.row(align=True) + row.label(text="Refine:") + row.prop(settings, "refine_intrinsics", text="") + + col = layout.column(align=True) + col.scale_y = 2.0 + + col.operator("clip.solve_camera", + text="Solve Camera Motion" if tracking_object.is_camera + else "Solve Object Motion") class CLIP_PT_tools_cleanup(CLIP_PT_tracking_panel, Panel): bl_space_type = 'CLIP_EDITOR' bl_region_type = 'TOOLS' bl_label = "Clean up" + bl_options = {'DEFAULT_CLOSED'} + bl_category = "Solve" def draw(self, context): layout = self.layout @@ -398,10 +459,12 @@ class CLIP_PT_tools_cleanup(CLIP_PT_tracking_panel, Panel): layout.prop(settings, "clean_action", text="") -class CLIP_PT_tools_geometry(CLIP_PT_reconstruction_panel, Panel): +class CLIP_PT_tools_geometry(CLIP_PT_tracking_panel, Panel): bl_space_type = 'CLIP_EDITOR' bl_region_type = 'TOOLS' bl_label = "Geometry" + bl_options = {'DEFAULT_CLOSED'} + bl_category = "Solve" def draw(self, context): layout = self.layout @@ -410,10 +473,11 @@ class CLIP_PT_tools_geometry(CLIP_PT_reconstruction_panel, Panel): layout.operator("clip.track_to_empty") -class CLIP_PT_tools_orientation(CLIP_PT_reconstruction_panel, Panel): +class CLIP_PT_tools_orientation(CLIP_PT_tracking_panel, Panel): bl_space_type = 'CLIP_EDITOR' bl_region_type = 'TOOLS' bl_label = "Orientation" + bl_category = "Solve" def draw(self, context): sc = context.space_data @@ -480,6 +544,7 @@ class CLIP_PT_tools_grease_pencil(Panel): bl_space_type = 'CLIP_EDITOR' bl_region_type = 'TOOLS' bl_label = "Grease Pencil" + bl_options = {'DEFAULT_CLOSED'} @classmethod def poll(cls, context): @@ -578,6 +643,12 @@ class CLIP_PT_track(CLIP_PT_tracking_panel, Panel): row.prop(act_track, "use_alpha_preview", text="", toggle=True, icon='IMAGE_ALPHA') + layout.prop(act_track, "weight") + + if act_track.has_bundle: + label_text = "Average Error: %.4f" % (act_track.average_error) + layout.label(text=label_text) + layout.separator() row = layout.row(align=True) @@ -593,12 +664,6 @@ class CLIP_PT_track(CLIP_PT_tracking_panel, Panel): if act_track.use_custom_color: row.prop(act_track, "color", text="") - layout.prop(act_track, "weight") - - if act_track.has_bundle: - label_text = "Average Error: %.4f" % (act_track.average_error) - layout.label(text=label_text) - class CLIP_PT_plane_track(CLIP_PT_tracking_panel, Panel): bl_space_type = 'CLIP_EDITOR' @@ -644,23 +709,34 @@ class CLIP_PT_track_settings(CLIP_PT_tracking_panel, Panel): active = clip.tracking.tracks.active if active: col.prop(active, "motion_model") - col.prop(active, "use_brute") - col.prop(active, "use_normalization") - col.prop(active, "use_mask") - col.prop(active, "correlation_min") - - col.separator() - col.prop(active, "frames_limit") - col.prop(active, "margin") col.prop(active, "pattern_match", text="Match") + col = layout.column() + row = col.row(align=True) + row.prop(active, "use_brute") + row.prop(active, "use_normalization") + + box = layout.box() + row = box.row(align=True) + row.prop(settings, "show_extra_expanded", text="", emboss=False) + row.label(text="Extra Settings") + + if settings.show_extra_expanded: + col = box.column() + row = col.row() + row.prop(active, "use_mask") - col.prop(settings, "speed") + sub = col.column(align=True) + sub.prop(active, "correlation_min") + sub.prop(active, "frames_limit") + sub.prop(active, "margin") + sub.separator() + sub.prop(settings, "speed") class CLIP_PT_tracking_camera(Panel): bl_space_type = 'CLIP_EDITOR' bl_region_type = 'UI' - bl_label = "Camera Data" + bl_label = "Camera" bl_options = {'DEFAULT_CLOSED'} @classmethod @@ -685,14 +761,6 @@ class CLIP_PT_tracking_camera(Panel): row.operator("clip.camera_preset_add", text="", icon='ZOOMOUT').remove_active = True - row = layout.row(align=True) - sub = row.split(percentage=0.65, align=True) - if clip.tracking.camera.units == 'MILLIMETERS': - sub.prop(clip.tracking.camera, "focal_length") - else: - sub.prop(clip.tracking.camera, "focal_length_pixels") - sub.prop(clip.tracking.camera, "units", text="") - col = layout.column(align=True) col.label(text="Sensor:") col.prop(clip.tracking.camera, "sensor_width", text="Width") @@ -704,6 +772,36 @@ class CLIP_PT_tracking_camera(Panel): row.prop(clip.tracking.camera, "principal", text="") col.operator("clip.set_center_principal", text="Center") + +class CLIP_PT_tracking_lens(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + bl_label = "Lens" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + if CLIP_PT_clip_view_panel.poll(context): + sc = context.space_data + + return sc.mode in {'TRACKING', 'DISTORTION'} and sc.clip + + return False + + def draw(self, context): + layout = self.layout + + sc = context.space_data + clip = sc.clip + + row = layout.row(align=True) + sub = row.split(percentage=0.65, align=True) + if clip.tracking.camera.units == 'MILLIMETERS': + sub.prop(clip.tracking.camera, "focal_length") + else: + sub.prop(clip.tracking.camera, "focal_length_pixels") + sub.prop(clip.tracking.camera, "units", text="") + col = layout.column(align=True) col.label(text="Lens Distortion:") col.prop(clip.tracking.camera, "k1") @@ -721,33 +819,25 @@ class CLIP_PT_display(CLIP_PT_clip_view_panel, Panel): sc = context.space_data row = layout.row(align=True) + sub = row.row(align=True) sub.prop(sc, "show_red_channel", text="R", toggle=True) sub.prop(sc, "show_green_channel", text="G", toggle=True) sub.prop(sc, "show_blue_channel", text="B", toggle=True) - row.separator() - row.prop(sc, "use_grayscale_preview", text="B/W", toggle=True) + row.separator() + row.prop(sc, "use_mute_footage", text="", icon="VISIBLE_IPO_ON", toggle=True) col = layout.column(align=True) - - col.prop(sc, "show_disabled", "Disabled Tracks") - col.prop(sc, "show_names", text="Names and Status") - if sc.mode != 'MASK': - col.prop(sc, "show_bundles", text="3D Markers") - - col.prop(sc, "use_mute_footage", text="Mute Footage") - col.prop(sc, "lock_selection") - + col.prop(sc.clip_user, "use_render_undistorted", text="Render Undistorted") + col.prop(sc, "lock_selection", text="Lock to Selection") + col.prop(sc, "show_stable", text="Display Stabilization") if sc.view == 'GRAPH': col.prop(sc, "lock_time_cursor") - - if sc.mode == 'DISTORTION': - col.prop(sc, "show_grid", text="Grid") - col.prop(sc, "use_manual_calibration") - elif sc.mode == 'RECONSTRUCTION': - col.prop(sc, "show_stable", text="Stable") + row = col.row(align=True) + row.prop(sc, "show_grid", text="Grid") + row.prop(sc, "use_manual_calibration", text="Calibration") clip = sc.clip if clip: @@ -772,18 +862,25 @@ class CLIP_PT_marker_display(CLIP_PT_clip_view_panel, Panel): sc = context.space_data col = layout.column(align=True) - row = col.row(align=True) row.prop(sc, "show_marker_pattern", text="Pattern") row.prop(sc, "show_marker_search", text="Search") - col.prop(sc, "show_tiny_markers", text="Thin Markers") - col.prop(sc, "show_track_path", text="Path") - row = col.row(align=True) row.active = sc.show_track_path + row.prop(sc, "show_track_path", text="Path") row.prop(sc, "path_length", text="Length") + col = layout.column(align=True) + row = col.row(align=True) + row.prop(sc, "show_disabled", "Disabled") + row.prop(sc, "show_names", text="Info") + + row = col.row(align=True) + if sc.mode != 'MASK': + row.prop(sc, "show_bundles", text="3D Markers") + row.prop(sc, "show_tiny_markers", text="Thin") + class CLIP_PT_stabilization(CLIP_PT_reconstruction_panel, Panel): bl_space_type = 'CLIP_EDITOR' @@ -913,8 +1010,61 @@ class CLIP_PT_proxy(CLIP_PT_clip_view_panel, Panel): col.prop(sc.clip_user, "proxy_render_size", text="") - col = layout.column() - col.prop(sc.clip_user, "use_render_undistorted") + +# ----------------------------------------------------------------------------- +# Mask (similar code in space_image.py, keep in sync) + + +from bl_ui.properties_mask_common import (MASK_PT_mask, + MASK_PT_layers, + MASK_PT_spline, + MASK_PT_point, + MASK_PT_display, + MASK_PT_tools, + MASK_PT_transforms, + MASK_PT_add) + + +class CLIP_PT_mask_layers(MASK_PT_layers, Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + + +class CLIP_PT_mask_display(MASK_PT_display, Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + + +class CLIP_PT_active_mask_spline(MASK_PT_spline, Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + + +class CLIP_PT_active_mask_point(MASK_PT_point, Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + + +class CLIP_PT_mask(MASK_PT_mask, Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + + +class CLIP_PT_tools_mask_add(MASK_PT_add, Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'TOOLS' + + +class CLIP_PT_tools_mask_transforms(MASK_PT_transforms, Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'TOOLS' + + +class CLIP_PT_tools_mask(MASK_PT_tools, Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'TOOLS' + +# --- end mask --- class CLIP_PT_footage(CLIP_PT_clip_view_panel, Panel): @@ -951,19 +1101,25 @@ class CLIP_PT_footage_info(CLIP_PT_clip_view_panel, Panel): col.template_movieclip_information(sc, "clip", sc.clip_user) -class CLIP_PT_tools_clip(CLIP_PT_clip_view_panel, Panel): +class CLIP_PT_tools_scenesetup(Panel): bl_space_type = 'CLIP_EDITOR' bl_region_type = 'TOOLS' - bl_label = "Clip" + bl_label = "Scene Setup" bl_translation_context = bpy.app.translations.contexts.id_movieclip + bl_category = "Solve" + + @classmethod + def poll(cls, context): + sc = context.space_data + clip = sc.clip + + return clip and sc.view == 'CLIP' and sc.mode != 'MASK' def draw(self, context): layout = self.layout layout.operator("clip.set_viewport_background") layout.operator("clip.setup_tracking_scene") - layout.operator("clip.prefetch") - layout.operator("clip.set_scene_frames") class CLIP_MT_view(Menu): @@ -1246,48 +1402,5 @@ class CLIP_MT_stabilize_2d_specials(Menu): layout.operator("clip.stabilize_2d_select") -# ----------------------------------------------------------------------------- -# Mask (similar code in space_image.py, keep in sync) - - -from bl_ui.properties_mask_common import (MASK_PT_mask, - MASK_PT_layers, - MASK_PT_spline, - MASK_PT_point, - MASK_PT_display, - MASK_PT_tools) - - -class CLIP_PT_mask(MASK_PT_mask, Panel): - bl_space_type = 'CLIP_EDITOR' - bl_region_type = 'UI' - - -class CLIP_PT_mask_layers(MASK_PT_layers, Panel): - bl_space_type = 'CLIP_EDITOR' - bl_region_type = 'UI' - - -class CLIP_PT_mask_display(MASK_PT_display, Panel): - bl_space_type = 'CLIP_EDITOR' - bl_region_type = 'UI' - - -class CLIP_PT_active_mask_spline(MASK_PT_spline, Panel): - bl_space_type = 'CLIP_EDITOR' - bl_region_type = 'UI' - - -class CLIP_PT_active_mask_point(MASK_PT_point, Panel): - bl_space_type = 'CLIP_EDITOR' - bl_region_type = 'UI' - - -class CLIP_PT_tools_mask(MASK_PT_tools, Panel): - bl_space_type = 'CLIP_EDITOR' - bl_region_type = 'TOOLS' - -# --- end mask --- - if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) |