[Bf-blender-cvs] [1b8de1b] soc-2016-multiview: check witness_clip->mode == SC_VIEW_CLIP
Tianwei Shen
noreply at git.blender.org
Tue Jul 26 07:57:12 CEST 2016
Commit: 1b8de1bc1d40dcdcdcf77f4a3c8f46e70979c400
Author: Tianwei Shen
Date: Tue Jul 26 13:55:30 2016 +0800
Branches: soc-2016-multiview
https://developer.blender.org/rB1b8de1bc1d40dcdcdcf77f4a3c8f46e70979c400
check witness_clip->mode == SC_VIEW_CLIP
otherwise the multiview mode has problem in 'Motion Tracking' layout,
since dopsheet and graph are also counte when iterating through clips.
===================================================================
M source/blender/editors/space_clip/space_clip.c
M source/blender/editors/space_clip/tracking_ops_correspondence.c
===================================================================
diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c
index 8189494..1160afb 100644
--- a/source/blender/editors/space_clip/space_clip.c
+++ b/source/blender/editors/space_clip/space_clip.c
@@ -1291,12 +1291,6 @@ static void clip_main_region_draw(const bContext *C, ARegion *ar)
clip_draw_grease_pencil((bContext *)C, true);
}
- /* draw secondary clip in Correspondence mode */
- if (sc->mode == SC_MODE_CORRESPONDENCE) {
- //movieclip_secondary_clip_set_view2d(C, ar);
- clip_draw_secondary_clip(C, sc, ar);
- }
-
/* reset view matrix */
UI_view2d_view_restore(C);
diff --git a/source/blender/editors/space_clip/tracking_ops_correspondence.c b/source/blender/editors/space_clip/tracking_ops_correspondence.c
index d130ac4..c0a66ea 100644
--- a/source/blender/editors/space_clip/tracking_ops_correspondence.c
+++ b/source/blender/editors/space_clip/tracking_ops_correspondence.c
@@ -86,14 +86,13 @@ static int add_correspondence_exec(bContext *C, wmOperator *op)
}
}
- // get number of selected tracks in the witness camera
- // TODO(tianwei): there might be multiple witness cameras, now just work with one witness camera
+ // get number of selected tracks in the witness camera, only one witness camera is allowed
wmWindow *window = CTX_wm_window(C);
MovieClip *second_clip;
for (ScrArea *sa = window->screen->areabase.first; sa != NULL; sa = sa->next) {
if (sa->spacetype == SPACE_CLIP) {
SpaceClip *second_sc = sa->spacedata.first;
- if (second_sc != sc) {
+ if (second_sc != sc && second_sc->mode == SC_VIEW_CLIP) {
second_clip = ED_space_clip_get_clip(second_sc);
MovieTracking *second_tracking = &second_clip->tracking;
ListBase *second_tracksbase = BKE_tracking_get_active_tracks(second_tracking);
@@ -217,16 +216,13 @@ static bool solve_multiview_initjob(bContext *C,
MovieTrackingObject *object = BKE_tracking_object_get_active(tracking);
int width, height;
- // count primary clip, will always be the first
+ // count all clips number, primary clip will always be the first
smj->clip_num = 1;
- // count other clips
wmWindow *window = CTX_wm_window(C);
for (ScrArea *sa = window->screen->areabase.first; sa != NULL; sa = sa->next) {
if (sa->spacetype == SPACE_CLIP) {
SpaceClip *other_sc = sa->spacedata.first;
- if(other_sc != sc) {
- MovieClip *other_clip;
- other_clip = ED_space_clip_get_clip(other_sc);
+ if(other_sc != sc && other_sc->mode == SC_VIEW_CLIP) {
smj->clip_num++;
}
}
@@ -241,7 +237,7 @@ static bool solve_multiview_initjob(bContext *C,
for (ScrArea *sa = window->screen->areabase.first; sa != NULL; sa = sa->next) {
if (sa->spacetype == SPACE_CLIP) {
SpaceClip *other_sc = sa->spacedata.first;
- if(other_sc != sc) {
+ if(other_sc != sc && other_sc->mode == SC_VIEW_CLIP) {
MovieClip *other_clip;
other_clip = ED_space_clip_get_clip(other_sc);
smj->clips[count++] = other_clip;
More information about the Bf-blender-cvs
mailing list