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>2012-06-12 21:10:24 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-06-12 21:10:24 +0400
commit55ca0e7636b77a408ea70bf3117eff569e49954b (patch)
tree88560249a92547e6f94698e369b11201cf28ea39 /source/blender/blenkernel/intern/tracking.c
parent1719b86f74a757998c6edc8ffc578a14c724d1ff (diff)
Make dopesheet settings per-tracking data
It was a bit confusing to synchronize settings used in pre-calculated dopesheet channels which was storing in tracking data with settings used for display which is in space data. This was initially done by converting one flags to other and checking if space's settings matches pre-calculated one, but that had several issues if two different dopesheet are using different settings: - Channels would be re-calculated on every redraw for each of spaces - Dopesheet operators could fail due to the could be using channels calculated for other space. That was also quite nasty code checking if requested settings matches pre-calculated one.
Diffstat (limited to 'source/blender/blenkernel/intern/tracking.c')
-rw-r--r--source/blender/blenkernel/intern/tracking.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index a9e75449811..33f7b22f64a 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -3545,40 +3545,34 @@ static void tracking_dopesheet_sort(MovieTracking *tracking, int sort_method, i
{
MovieTrackingDopesheet *dopesheet = &tracking->dopesheet;
- if (dopesheet->sort_method == sort_method && dopesheet->sort_inverse == inverse)
- return;
-
if (inverse) {
- if (sort_method == TRACK_SORT_NAME) {
+ if (sort_method == TRACKING_DOPE_SORT_NAME) {
BLI_sortlist(&dopesheet->channels, channels_alpha_inverse_sort);
}
- else if (sort_method == TRACK_SORT_LONGEST) {
+ else if (sort_method == TRACKING_DOPE_SORT_LONGEST) {
BLI_sortlist(&dopesheet->channels, channels_longest_segment_inverse_sort);
}
- else if (sort_method == TRACK_SORT_TOTAL) {
+ else if (sort_method == TRACKING_DOPE_SORT_TOTAL) {
BLI_sortlist(&dopesheet->channels, channels_total_track_inverse_sort);
}
- else if (sort_method == TRACK_SORT_AVERAGE_ERROR) {
+ else if (sort_method == TRACKING_DOPE_SORT_AVERAGE_ERROR) {
BLI_sortlist(&dopesheet->channels, channels_average_error_inverse_sort);
}
}
else {
- if (sort_method == TRACK_SORT_NAME) {
+ if (sort_method == TRACKING_DOPE_SORT_NAME) {
BLI_sortlist(&dopesheet->channels, channels_alpha_sort);
}
- else if (sort_method == TRACK_SORT_LONGEST) {
+ else if (sort_method == TRACKING_DOPE_SORT_LONGEST) {
BLI_sortlist(&dopesheet->channels, channels_longest_segment_sort);
}
- else if (sort_method == TRACK_SORT_TOTAL) {
+ else if (sort_method == TRACKING_DOPE_SORT_TOTAL) {
BLI_sortlist(&dopesheet->channels, channels_total_track_sort);
}
- else if (sort_method == TRACK_SORT_AVERAGE_ERROR) {
+ else if (sort_method == TRACKING_DOPE_SORT_AVERAGE_ERROR) {
BLI_sortlist(&dopesheet->channels, channels_average_error_sort);
}
}
-
- dopesheet->sort_method = sort_method;
- dopesheet->sort_inverse = inverse;
}
void BKE_tracking_dopesheet_tag_update(MovieTracking *tracking)
@@ -3588,17 +3582,17 @@ void BKE_tracking_dopesheet_tag_update(MovieTracking *tracking)
dopesheet->ok = FALSE;
}
-void BKE_tracking_dopesheet_update(MovieTracking *tracking, int sort_method, int inverse)
+void BKE_tracking_dopesheet_update(MovieTracking *tracking)
{
MovieTrackingObject *object = BKE_tracking_active_object(tracking);
MovieTrackingDopesheet *dopesheet = &tracking->dopesheet;
MovieTrackingTrack *track;
ListBase *tracksbase = BKE_tracking_object_tracks(tracking, object);
+ short sort_method = dopesheet->sort_method;
+ short inverse = dopesheet->flag & TRACKING_DOPE_SORT_INVERSE;
- if (dopesheet->ok) {
- tracking_dopesheet_sort(tracking, sort_method, inverse);
+ if (dopesheet->ok)
return;
- }
tracking_dopesheet_free(dopesheet);
@@ -3616,8 +3610,6 @@ void BKE_tracking_dopesheet_update(MovieTracking *tracking, int sort_method, int
}
}
- dopesheet->sort_method = TRACK_SORT_NONE;
-
tracking_dopesheet_sort(tracking, sort_method, inverse);
dopesheet->ok = TRUE;