[Bf-blender-cvs] [c493fff] soc-2016-multiview: Multiview tracking count clip using main.movieclip

Tianwei Shen noreply at git.blender.org
Tue Aug 16 11:22:04 CEST 2016


Commit: c493fff3d5abd547f096c375f9912070c709cbf9
Author: Tianwei Shen
Date:   Tue Aug 16 15:04:37 2016 +0800
Branches: soc-2016-multiview
https://developer.blender.org/rBc493fff3d5abd547f096c375f9912070c709cbf9

Multiview tracking count clip using main.movieclip

- using open clip given by main->movieclip
- haven't set up clip pointer using main.movieclip

===================================================================

M	source/blender/editors/space_clip/tracking_ops_correspondence.c

===================================================================

diff --git a/source/blender/editors/space_clip/tracking_ops_correspondence.c b/source/blender/editors/space_clip/tracking_ops_correspondence.c
index 5f73d11..208ea0d 100644
--- a/source/blender/editors/space_clip/tracking_ops_correspondence.c
+++ b/source/blender/editors/space_clip/tracking_ops_correspondence.c
@@ -42,6 +42,7 @@
 #include "BLI_blenlib.h"
 #include "BLI_string.h"
 
+#include "BKE_main.h"
 #include "BKE_context.h"
 #include "BKE_movieclip.h"
 #include "BKE_tracking.h"
@@ -212,19 +213,13 @@ static bool solve_multiview_initjob(bContext *C,
 	MovieTrackingObject *object = BKE_tracking_object_get_active(tracking);
 	int width, height;
 
-	/* count all clips number, primary clip will always be the first */
-	// TODO(tianwei): don't count clips for now, because we can only do with two cameras.
-	smj->clip_num = 2;
-	//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 && other_sc->view == SC_VIEW_CLIP) {
-	//			smj->clip_num++;
-	//		}
-	//	}
-	//}
-	printf("%d active clips for reconstruction\n", smj->clip_num);
+	/* count all clips number, primary clip will always be the first
+	 * iterate over bContext->data.main.movieclip to get open clips.
+	 */
+	Main *main = CTX_data_main(C);
+	ListBase *mc_base = &(main->movieclip);
+	smj->clip_num = BLI_listbase_count(mc_base);
+	printf("%d open clips for reconstruction\n", smj->clip_num);
 	smj->clips = MEM_callocN(smj->clip_num * sizeof(MovieClip*), "multiview clip pointers");
 	smj->clips[0] = clip;




More information about the Bf-blender-cvs mailing list