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-16 12:20:29 +0300
committerTianwei Shen <shentianweipku@gmail.com>2016-08-16 12:20:29 +0300
commit59b5bdbb7cb868467a978c9e8ce13b892a0edefe (patch)
tree3d6e1fed46af02b01d451a91ea0d6ad85792d8ce /source/blender/editors/space_clip
parentc493fff3d5abd547f096c375f9912070c709cbf9 (diff)
now multi-view can work with more than 2 cameras
solve the camera number limitation by iterating over main->movieclip.
Diffstat (limited to 'source/blender/editors/space_clip')
-rw-r--r--source/blender/editors/space_clip/tracking_ops_correspondence.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/source/blender/editors/space_clip/tracking_ops_correspondence.c b/source/blender/editors/space_clip/tracking_ops_correspondence.c
index 208ea0dab5c..555575dd1c8 100644
--- a/source/blender/editors/space_clip/tracking_ops_correspondence.c
+++ b/source/blender/editors/space_clip/tracking_ops_correspondence.c
@@ -223,23 +223,18 @@ static bool solve_multiview_initjob(bContext *C,
smj->clips = MEM_callocN(smj->clip_num * sizeof(MovieClip*), "multiview clip pointers");
smj->clips[0] = clip;
- /* do multi-view reconstruction
- * TODO(tianwei): it cannot count clip other than primary and secondary clips.
- * */
- //if (smj->clip_num > 1) {
- // int count = 1; // witness cameras start from 1
- // 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) {
- // MovieClip *other_clip;
- // other_clip = ED_space_clip_get_clip(other_sc);
- // smj->clips[count++] = other_clip;
- // }
- // }
- // }
- //}
- smj->clips[1] = ED_space_clip_get_secondary_clip(sc);
+ /* do multi-view reconstruction, fill in witness clips from Main.movieclip */
+ int mc_counter = 1;
+ for (Link *link = main->movieclip.first;
+ link != NULL;
+ link = link->next)
+ {
+ MovieClip *mc_link = (MovieClip*) link;
+ if (mc_link != smj->clips[0]) {
+ smj->clips[mc_counter++] = mc_link;
+ }
+ }
+ BLI_assert(mc_counter == smj->clip_num);
if (!BKE_tracking_multiview_reconstruction_check(smj->clips,
object,