Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2011-11-28 17:26:46 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2011-11-28 17:26:46 +0400
commita3623a046bdc10f80319c1bedf2740bda072f53a (patch)
tree78274ab89cf64645bc956ff5225845163ab99849 /release
parent911be02fcd5c818b626482e313cb9f37da2bf054 (diff)
Camera tracking: merging tracking presets stuff from tomato branch
This commit implements: - Configurable settings for newly creating tracks Now it's possible to set tracking algorithm and it's settings for all newly creating tracks including manual tracks creation and tracks creation by "Detect Features" operator. - Moves margin, frames limit and adjust frame inside per-track settings. Was request from Francois for this. - Adjust Frames replaced with menu called Pattern Match where it's possible to choose between matching pattern from keyframe frame or from previously tracked frame. Didn't see somebody used adjust frames values differ from 0 and 1, and this menu should make things more clear here/
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_operators/presets.py24
-rw-r--r--release/scripts/startup/bl_ui/space_clip.py69
2 files changed, 86 insertions, 7 deletions
diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py
index 100b21fc303..a5c8c280616 100644
--- a/release/scripts/startup/bl_operators/presets.py
+++ b/release/scripts/startup/bl_operators/presets.py
@@ -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"
diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py
index b04d81b6b2a..22d44ed4793 100644
--- a/release/scripts/startup/bl_ui/space_clip.py
+++ b/release/scripts/startup/bl_ui/space_clip.py
@@ -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="Default 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")
+ col.prop(active, "tracker")
+
if active.tracker == 'KLT':
- layout.prop(active, "pyramid_levels")
+ col.prop(active, "pyramid_levels")
elif active.tracker == 'SAD':
- layout.prop(active, "correlation_min")
+ col.prop(active, "correlation_min")
- layout.prop(settings, "frames_adjust")
- layout.prop(settings, "speed")
- layout.prop(settings, "frames_limit")
- layout.prop(settings, "margin")
+ 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"