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
This commit is contained in:
Sergey Sharybin 2014-02-07 20:26:43 +06:00
parent e2e9c51900
commit 8614ed64ed
Notes: blender-bot 2023-02-14 11:21:39 +01:00
Referenced by issue #38172, Add Tabs for Movie Clip Editor
11 changed files with 384 additions and 192 deletions

View File

@ -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):
@ -285,10 +327,6 @@ class MASK_MT_mask(Menu):
layout.operator("mask.parent_clear")
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")
@ -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__)

View File

@ -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")
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"
def draw(self, context):
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
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)
col.separator()
sub = col.column(align=True)
sub.prop(settings, "default_pattern_size")
sub.prop(settings, "default_search_size")
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="Tracking Settings")
row.label(text="Extra 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
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)
col.separator()
sub = col.column(align=True)
sub.prop(settings, "default_pattern_size")
sub.prop(settings, "default_search_size")
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")
col.separator()
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")
col.prop(settings, "speed")
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")
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__)

View File

@ -2699,5 +2699,24 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
} FOREACH_NODETREE_END
{
bScreen *screen;
for (screen = main->screen.first; screen; screen = screen->id.next) {
ScrArea *area;
for (area = screen->areabase.first; area; area = area->next) {
SpaceLink *space_link;
for (space_link = area->spacedata.first; space_link; space_link = space_link->next) {
if (space_link->spacetype == SPACE_CLIP) {
SpaceClip *space_clip = (SpaceClip *) space_link;
if (space_clip->mode != SC_MODE_MASKEDIT) {
space_clip->mode = SC_MODE_TRACKING;
}
}
}
}
}
}
}
}

View File

@ -30,6 +30,8 @@
#include "DNA_freestyle_types.h"
#include "DNA_linestyle_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_userdef_types.h"
#include "BKE_main.h"
@ -56,5 +58,22 @@ void BLO_update_defaults_startup_blend(Main *main)
for (linestyle = main->linestyle.first; linestyle; linestyle = linestyle->id.next)
linestyle->flag = LS_SAME_OBJECT;
{
bScreen *screen;
for (screen = main->screen.first; screen; screen = screen->id.next) {
ScrArea *area;
for (area = screen->areabase.first; area; area = area->next) {
SpaceLink *space_link;
for (space_link = area->spacedata.first; space_link; space_link = space_link->next) {
if (space_link->spacetype == SPACE_CLIP) {
SpaceClip *space_clip = (SpaceClip *) space_link;
space_clip->flag &= ~SC_MANUAL_CALIBRATION;
}
}
}
}
}
}

View File

@ -1527,9 +1527,6 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip,
float dx = (float)width / n, dy = (float)height / n * aspy;
float offsx = 0.0f, offsy = 0.0f;
if (sc->mode != SC_MODE_DISTORTION)
return;
if (!tracking->camera.focal)
return;
@ -1818,7 +1815,7 @@ void clip_draw_grease_pencil(bContext *C, int onlyv2d)
if (onlyv2d) {
/* if manual calibration is used then grease pencil data is already
* drawn in draw_distortion */
if ((sc->flag & SC_MANUAL_CALIBRATION) == 0 || sc->mode != SC_MODE_DISTORTION) {
if ((sc->flag & SC_MANUAL_CALIBRATION) == 0) {
glPushMatrix();
glMultMatrixf(sc->unistabmat);

View File

@ -504,7 +504,7 @@ void ED_clip_mouse_pos(SpaceClip *sc, ARegion *ar, const int mval[2], float co[2
bool ED_space_clip_check_show_trackedit(SpaceClip *sc)
{
if (sc) {
return ELEM3(sc->mode, SC_MODE_TRACKING, SC_MODE_RECONSTRUCTION, SC_MODE_DISTORTION);
return sc->mode == SC_MODE_TRACKING;
}
return false;

View File

@ -246,7 +246,7 @@ static SpaceLink *clip_new(const bContext *C)
sc = MEM_callocN(sizeof(SpaceClip), "initclip");
sc->spacetype = SPACE_CLIP;
sc->flag = SC_SHOW_MARKER_PATTERN | SC_SHOW_TRACK_PATH | SC_MANUAL_CALIBRATION |
sc->flag = SC_SHOW_MARKER_PATTERN | SC_SHOW_TRACK_PATH |
SC_SHOW_GRAPH_TRACKS_MOTION | SC_SHOW_GRAPH_FRAMES | SC_SHOW_GPENCIL;
sc->zoom = 1.0f;
sc->path_length = 20;

View File

@ -1134,8 +1134,8 @@ typedef enum eSpaceClip_Flag {
/* SpaceClip->mode */
typedef enum eSpaceClip_Mode {
SC_MODE_TRACKING = 0,
SC_MODE_RECONSTRUCTION = 1,
SC_MODE_DISTORTION = 2,
/*SC_MODE_RECONSTRUCTION = 1,*/ /* DEPRECATED */
/*SC_MODE_DISTORTION = 2,*/ /* DEPRECATED */
SC_MODE_MASKEDIT = 3,
} eSpaceClip_Mode;

View File

@ -402,7 +402,8 @@ enum {
/* MovieTrackingSettings->flag */
enum {
TRACKING_SETTINGS_SHOW_DEFAULT_EXPANDED = (1 << 0)
TRACKING_SETTINGS_SHOW_DEFAULT_EXPANDED = (1 << 0),
TRACKING_SETTINGS_SHOW_EXTRA_EXPANDED = (1 << 1)
};
/* MovieTrackingSettings->motion_flag */

View File

@ -132,9 +132,6 @@ EnumPropertyItem viewport_shade_items[] = {
EnumPropertyItem clip_editor_mode_items[] = {
{SC_MODE_TRACKING, "TRACKING", ICON_ANIM_DATA, "Tracking", "Show tracking and solving tools"},
{SC_MODE_RECONSTRUCTION, "RECONSTRUCTION", ICON_SNAP_FACE, "Reconstruction",
"Show tracking/reconstruction tools"},
{SC_MODE_DISTORTION, "DISTORTION", ICON_GRID, "Distortion", "Show distortion tools"},
{SC_MODE_MASKEDIT, "MASK", ICON_MOD_MASK, "Mask", "Show mask editing tools"},
{0, NULL, 0, NULL, NULL}
};

View File

@ -819,7 +819,14 @@ static void rna_def_trackingSettings(BlenderRNA *brna)
prop = RNA_def_property(srna, "show_default_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_SETTINGS_SHOW_DEFAULT_EXPANDED);
RNA_def_property_ui_text(prop, "Show Expanded", "Show the expanded in the user interface");
RNA_def_property_ui_text(prop, "Show Expanded", "Show default options expanded in the user interface");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
/* ** extra tracker settings ** */
prop = RNA_def_property(srna, "show_extra_expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_SETTINGS_SHOW_EXTRA_EXPANDED);
RNA_def_property_ui_text(prop, "Show Expanded", "Show extra options expanded in the user interface");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
/* solver settings */