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:
authorTianwei Shen <shentianweipku@gmail.com>2016-08-21 19:35:33 +0300
committerTianwei Shen <shentianweipku@gmail.com>2016-08-21 19:35:33 +0300
commitf4dee67e8bdcd50059d348008be22efefeb380f8 (patch)
tree0094b383f97f75716fc2a21bfaf30853253a6c5a /source/blender/editors/space_clip
parent1d469973d4260594f737e42c32f5f185ec91811e (diff)
use name instead of pointer in correspondence
- remove self_track and other_track pointers in MovieTrackCorrespondence, instead use self_track_name and other_track_name. - now we can save and load correspondences reliably. - one issue after this change is that the color of linked tracks are not shown correctly.
Diffstat (limited to 'source/blender/editors/space_clip')
-rw-r--r--source/blender/editors/space_clip/clip_draw.c20
-rw-r--r--source/blender/editors/space_clip/tracking_ops_correspondence.c3
2 files changed, 14 insertions, 9 deletions
diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c
index 5d1145db756..78895502993 100644
--- a/source/blender/editors/space_clip/clip_draw.c
+++ b/source/blender/editors/space_clip/clip_draw.c
@@ -548,14 +548,16 @@ static void draw_marker_outline(SpaceClip *sc, ARegion *ar, MovieTrackingTrack *
glPopMatrix();
}
-// return whether the track is a linked track
-// by iterating the correpsondence base in tracking.
-static bool is_track_linked(MovieTracking *tracking, MovieTrackingTrack *track)
+/* return whether the track is a linked track by iterating the correspondence base in tracking. */
+static bool is_track_linked(MovieTracking *tracking, MovieClip *clip, MovieTrackingTrack *track)
{
MovieTrackingCorrespondence *corr = tracking->correspondences.first;
while (corr) {
- if (corr->self_track == track || corr->other_track == track)
+ if ((corr->self_clip == clip && strcmp(corr->self_track_name, track->name) == 0) ||
+ (corr->other_clip == clip && strcmp(corr->other_track_name, track->name) == 0))
+ {
return true;
+ }
corr = corr->next;
}
return false;
@@ -594,8 +596,9 @@ static void draw_marker_areas(SpaceClip *sc, ARegion *ar, MovieTrackingTrack *tr
bool show_search = false;
float col[3], scol[3], px[2];
- MovieTracking *tracking = &sc->clip->tracking;
- bool link = is_track_linked(tracking, track);
+ MovieClip *mc = ED_space_clip_get_clip_in_region(sc, ar);
+ MovieTracking *tracking = &mc->tracking;
+ bool link = is_track_linked(tracking, mc, track);
track_colors(track, act, link, col, scol);
RegionSpaceClip *rsc = (RegionSpaceClip*) ar->regiondata;
@@ -821,8 +824,9 @@ static void draw_marker_slide_zones(SpaceClip *sc, ARegion *ar, MovieTrackingTra
if (!TRACK_VIEW_SELECTED(sc, track) || track->flag & TRACK_LOCKED)
return;
- MovieTracking *tracking = &sc->clip->tracking;
- bool link = is_track_linked(tracking, track);
+ MovieClip *mc = ED_space_clip_get_clip_in_region(sc, ar);
+ MovieTracking *tracking = &mc->tracking;
+ bool link = is_track_linked(tracking, mc, track);
track_colors(track, act, link, col, scol);
if (outline) {
diff --git a/source/blender/editors/space_clip/tracking_ops_correspondence.c b/source/blender/editors/space_clip/tracking_ops_correspondence.c
index 555575dd1c8..4c48632634a 100644
--- a/source/blender/editors/space_clip/tracking_ops_correspondence.c
+++ b/source/blender/editors/space_clip/tracking_ops_correspondence.c
@@ -146,13 +146,14 @@ static int delete_correspondence_exec(bContext *C, wmOperator *UNUSED(op))
bool changed = false;
/* Remove track correspondences from correspondence base */
+ MovieTrackingObject *object = BKE_tracking_object_get_active(tracking);
ListBase *correspondence_base = &tracking->correspondences;
for (MovieTrackingCorrespondence *corr = correspondence_base->first;
corr != NULL;
corr = corr->next)
{
MovieTrackingTrack *track;
- track = corr->self_track;
+ track = BKE_tracking_track_get_named(tracking, object, corr->self_track_name);
if (TRACK_VIEW_SELECTED(sc, track)) {
BLI_freelinkN(correspondence_base, corr);
changed = true;