svn merge ^/trunk/blender -r42197:42221
This commit is contained in:
@@ -360,6 +360,30 @@ class AddPresetTrackingTrackColor(AddPresetBase, Operator):
|
||||
preset_subdir = "tracking_track_color"
|
||||
|
||||
|
||||
class AddPresetTrackingSettings(AddPresetBase, Operator):
|
||||
'''Add a motion tracking settings preset'''
|
||||
bl_idname = "clip.tracking_settings_preset_add"
|
||||
bl_label = "Add Tracking Settings Preset"
|
||||
preset_menu = "CLIP_MT_tracking_settings_presets"
|
||||
|
||||
preset_defines = [
|
||||
"settings = bpy.context.edit_movieclip.tracking.settings"
|
||||
]
|
||||
|
||||
preset_values = [
|
||||
"settings.default_tracker",
|
||||
"settings.default_pyramid_levels",
|
||||
"settings.default_correlation_min",
|
||||
"settings.default_pattern_size",
|
||||
"settings.default_search_size",
|
||||
"settings.default_frames_limit",
|
||||
"settings.default_pattern_match",
|
||||
"settings.default_margin"
|
||||
]
|
||||
|
||||
preset_subdir = "tracking_settings"
|
||||
|
||||
|
||||
class AddPresetKeyconfig(AddPresetBase, Operator):
|
||||
'''Add a Keyconfig Preset'''
|
||||
bl_idname = "wm.keyconfig_preset_add"
|
||||
|
||||
@@ -92,6 +92,9 @@ class CLIP_PT_tools_marker(Panel):
|
||||
return clip and sc.mode == 'TRACKING'
|
||||
|
||||
def draw(self, context):
|
||||
sc = context.space_data
|
||||
clip = sc.clip
|
||||
settings = clip.tracking.settings
|
||||
layout = self.layout
|
||||
|
||||
col = layout.column(align=True)
|
||||
@@ -99,6 +102,45 @@ class CLIP_PT_tools_marker(Panel):
|
||||
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 = bpy.types.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')
|
||||
props = row.operator("clip.track_color_preset_add",
|
||||
text="", icon='ZOOMOUT')
|
||||
props.remove_active = True
|
||||
|
||||
col.separator()
|
||||
|
||||
col2 = col.column(align=True)
|
||||
col2.prop(settings, "default_pattern_size")
|
||||
col2.prop(settings, "default_search_size")
|
||||
|
||||
col.label(text="Tracker:")
|
||||
col.prop(settings, "default_tracker", text="")
|
||||
|
||||
if settings.default_tracker == 'KLT':
|
||||
col.prop(settings, "default_pyramid_levels")
|
||||
else:
|
||||
col.prop(settings, "default_correlation_min")
|
||||
|
||||
col.separator()
|
||||
|
||||
col2 = col.column(align=True)
|
||||
col2.prop(settings, "default_frames_limit")
|
||||
col2.prop(settings, "default_margin")
|
||||
|
||||
col.label(text="Match:")
|
||||
col.prop(settings, "default_pattern_match", text="")
|
||||
|
||||
|
||||
class CLIP_PT_tools_tracking(Panel):
|
||||
bl_space_type = 'CLIP_EDITOR'
|
||||
@@ -447,18 +489,23 @@ class CLIP_PT_track_settings(Panel):
|
||||
clip = context.space_data.clip
|
||||
settings = clip.tracking.settings
|
||||
|
||||
col = layout.column()
|
||||
|
||||
active = clip.tracking.tracks.active
|
||||
if active:
|
||||
layout.prop(active, "tracker")
|
||||
if active.tracker == 'KLT':
|
||||
layout.prop(active, "pyramid_levels")
|
||||
elif active.tracker == 'SAD':
|
||||
layout.prop(active, "correlation_min")
|
||||
col.prop(active, "tracker")
|
||||
|
||||
layout.prop(settings, "frames_adjust")
|
||||
layout.prop(settings, "speed")
|
||||
layout.prop(settings, "frames_limit")
|
||||
layout.prop(settings, "margin")
|
||||
if active.tracker == 'KLT':
|
||||
col.prop(active, "pyramid_levels")
|
||||
elif active.tracker == 'SAD':
|
||||
col.prop(active, "correlation_min")
|
||||
|
||||
col.separator()
|
||||
col.prop(active, "frames_limit")
|
||||
col.prop(active, "margin")
|
||||
col.prop(active, "pattern_match", text="Match")
|
||||
|
||||
col.prop(settings, "speed")
|
||||
|
||||
|
||||
class CLIP_PT_stabilization(Panel):
|
||||
@@ -866,6 +913,14 @@ class CLIP_MT_track_color_presets(Menu):
|
||||
draw = bpy.types.Menu.draw_preset
|
||||
|
||||
|
||||
class CLIP_MT_tracking_settings_presets(Menu):
|
||||
"""Predefined tracking settings"""
|
||||
bl_label = "Tracking Presets"
|
||||
preset_subdir = "tracking_settings"
|
||||
preset_operator = "script.execute_preset"
|
||||
draw = bpy.types.Menu.draw_preset
|
||||
|
||||
|
||||
class CLIP_MT_track_color_specials(Menu):
|
||||
bl_label = "Track Color Specials"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user