Added track weight to presets

Useful for cases when you need to create bunch of witness tracks.
This commit is contained in:
Sergey Sharybin 2014-02-19 18:42:32 +06:00
parent bff99b10a3
commit 57b62881f4
10 changed files with 23 additions and 2 deletions

@ -15,3 +15,4 @@ settings.use_default_red_channel = True
settings.use_default_green_channel = True
settings.use_default_blue_channel = True
settings.default_correlation_min = 0.6
settings.default_weight = 1.0

@ -15,3 +15,4 @@ settings.use_default_red_channel = True
settings.use_default_green_channel = True
settings.use_default_blue_channel = True
settings.default_correlation_min = 0.75
settings.default_weight = 1.0

@ -15,3 +15,4 @@ settings.use_default_red_channel = True
settings.use_default_green_channel = True
settings.use_default_blue_channel = True
settings.default_correlation_min = 0.6
settings.default_weight = 1.0

@ -15,3 +15,4 @@ settings.use_default_red_channel = True
settings.use_default_green_channel = True
settings.use_default_blue_channel = True
settings.default_correlation_min = 0.75
settings.default_weight = 1.0

@ -476,6 +476,7 @@ class AddPresetTrackingSettings(AddPresetBase, Operator):
"settings.use_default_red_channel",
"settings.use_default_green_channel",
"settings.use_default_blue_channel"
"settings.default_weight"
]
preset_subdir = "tracking_settings"

@ -335,6 +335,9 @@ class CLIP_PT_tracking_settings(CLIP_PT_tracking_panel, Panel):
sub.prop(settings, "default_frames_limit")
sub.prop(settings, "default_margin")
col = box.column()
col.prop(settings, "default_weight")
class CLIP_PT_tools_tracking(CLIP_PT_tracking_panel, Panel):
bl_space_type = 'CLIP_EDITOR'

@ -200,6 +200,7 @@ void BKE_tracking_settings_init(MovieTracking *tracking)
tracking->settings.default_pattern_size = 15;
tracking->settings.default_search_size = 61;
tracking->settings.default_algorithm_flag |= TRACK_ALGORITHM_FLAG_USE_BRUTE;
tracking->settings.default_weight = 1.0f;
tracking->settings.dist = 1;
tracking->settings.object_distance = 1;
@ -418,7 +419,7 @@ MovieTrackingTrack *BKE_tracking_track_add(MovieTracking *tracking, ListBase *tr
track->frames_limit = settings->default_frames_limit;
track->flag = settings->default_flag;
track->algorithm_flag = settings->default_algorithm_flag;
track->weight = 1.0f;
track->weight = settings->default_weight;
memset(&marker, 0, sizeof(marker));
marker.pos[0] = x;

@ -2719,4 +2719,11 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
}
if (!DNA_struct_elem_find(fd->filesdna, "MovieTrackingSettings", "float", "default_weight")) {
MovieClip *clip;
for (clip = main->movieclip.first; clip; clip = clip->id.next) {
clip->tracking.settings.default_weight = 1.0f;
}
}
}

@ -210,6 +210,7 @@ typedef struct MovieTrackingSettings {
short default_margin; /* margin from frame boundaries */
short default_pattern_match; /* re-adjust every N frames */
short default_flag; /* default flags like color channels used by default */
float default_weight; /* default weight of the track */
short motion_flag; /* flags describes motion type */
@ -222,7 +223,7 @@ typedef struct MovieTrackingSettings {
* were moved to per-tracking object settings
*/
int reconstruction_flag, pad;
int reconstruction_flag;
/* which camera intrinsics to refine. uses on the REFINE_* flags */
short refine_camera_intrinsics, pad2;

@ -930,6 +930,10 @@ static void rna_def_trackingSettings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Use Blue Channel", "Use blue channel from footage for tracking");
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
prop = RNA_def_property(srna, "default_weight", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Weight", "Influence of newly created track on a final solution");
/* ** object tracking ** */
/* object distance */