Commit: 39037fe06c36f2eddc8394018ae561270cfa04e0 Author: Dalai Felinto Date: Wed Feb 4 17:41:39 2015 -0200 Branches: multiview https://developer.blender.org/rB39037fe06c36f2eddc8394018ae561270cfa04e0
Merge commit 'origin/master~' into multiview Conflicts: source/blender/blenkernel/intern/sequencer.c =================================================================== =================================================================== diff --cc source/blender/blenkernel/intern/image.c index 8d7ddd4,b130372..230a1c2 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@@ -2273,11 -2102,19 +2273,19 @@@ void BKE_image_path_from_imformat void BKE_image_path_from_imtype( char *string, const char *base, const char *relbase, int frame, - const char imtype, const bool use_ext, const bool use_frames) + const char imtype, const bool use_ext, const bool use_frames, const char *view) { - image_path_makepicstring(string, base, relbase, frame, imtype, NULL, use_ext, use_frames); + do_makepicstring(string, base, relbase, frame, imtype, NULL, use_ext, use_frames, view); } + struct anim *openanim_noload(const char *name, int flags, int streamindex, char colorspace[IMA_MAX_SPACE]) + { + struct anim *anim; + + anim = IMB_open_anim(name, flags, streamindex, colorspace); + return anim; + } + /* used by sequencer too */ struct anim *openanim(const char *name, int flags, int streamindex, char colorspace[IMA_MAX_SPACE]) { diff --cc source/blender/blenkernel/intern/sequencer.c index cd9e546,dd46fdc..0689a2a --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@@ -1408,31 -1330,12 +1408,31 @@@ static double seq_rendersize_to_scale_f return 0.25; } -static void seq_open_anim_file(Sequence *seq, bool openfile) +/* the number of files will vary according to the stereo format */ +static size_t seq_num_files(Scene *scene, char views_format) { + const bool is_multiview = (scene->r.scemode & R_MULTIVIEW) != 0; + + if (!is_multiview) { + return 1; + } + else if (views_format == R_IMF_VIEWS_STEREO_3D) { + return 1; + } + /* R_IMF_VIEWS_INDIVIDUAL */ + else { + return BKE_scene_num_views_get(&scene->r); + } +} + - static void seq_open_anim_file(Scene *scene, Sequence *seq) ++static void seq_open_anim_file(Scene *scene, Sequence *seq, bool openfile) +{ + char dir[FILE_MAX]; char name[FILE_MAX]; StripProxy *proxy; + const bool is_multiview = (scene->r.scemode & R_MULTIVIEW) != 0; - if (seq->anim != NULL) { + if ((seq->anims.first != NULL) && (((StripAnim *)seq->anims.first)->anim != NULL)) { return; } @@@ -1442,72 -1342,32 +1442,91 @@@ BLI_join_dirfile(name, sizeof(name), seq->strip->dir, seq->strip->stripdata->name); BLI_path_abs(name, G.main->name); - - if (openfile) { - seq->anim = openanim(name, IB_rect | ((seq->flag & SEQ_FILTERY) ? IB_animdeinterlace : 0), - seq->streamindex, seq->strip->colorspace_settings.name); - } - else { - seq->anim = openanim_noload(name, IB_rect | ((seq->flag & SEQ_FILTERY) ? IB_animdeinterlace : 0), - seq->streamindex, seq->strip->colorspace_settings.name); - } - if (seq->anim == NULL) { - return; + proxy = seq->strip->proxy; + + if (proxy && (seq->flag & SEQ_USE_PROXY_CUSTOM_DIR)) { + BLI_strncpy(dir, seq->strip->proxy->dir, sizeof(dir)); + BLI_path_abs(dir, G.main->name); } - proxy = seq->strip->proxy; + if (is_multiview && seq->views_format == R_IMF_VIEWS_INDIVIDUAL) { + size_t totfiles = seq_num_files(scene, seq->views_format); + char prefix[FILE_MAX] = {'\0'}; + char *ext = NULL; + int i; - if (proxy == NULL) { - return; + BKE_scene_view_prefix_get(scene, name, prefix, &ext); + + if (prefix[0] == '\0') + goto monoview; + + for (i = 0; i < totfiles; i++) { + const char *suffix = BKE_scene_view_id_suffix_get(&scene->r, i); + char str[FILE_MAX] = {'\0'}; + StripAnim *sanim = MEM_mallocN(sizeof(StripAnim), "Strip Anim"); + + BLI_addtail(&seq->anims, sanim); + + BLI_snprintf(str, sizeof(str), "%s%s%s", prefix, suffix, ext); + - sanim->anim = openanim(str, IB_rect | ((seq->flag & SEQ_FILTERY) ? IB_animdeinterlace : 0), - seq->streamindex, seq->strip->colorspace_settings.name); ++ if (openfile) { ++ sanim->anim = openanim(str, IB_rect | ((seq->flag & SEQ_FILTERY) ? IB_animdeinterlace : 0), ++ seq->streamindex, seq->strip->colorspace_settings.name); ++ } ++ else { ++ sanim->anim = openanim_noload(str, IB_rect | ((seq->flag & SEQ_FILTERY) ? IB_animdeinterlace : 0), ++ seq->streamindex, seq->strip->colorspace_settings.name); ++ } ++ + seq_anim_add_suffix(scene, sanim->anim, i); + + if (sanim->anim == NULL) { - sanim->anim = openanim(name, IB_rect | ((seq->flag & SEQ_FILTERY) ? IB_animdeinterlace : 0), - seq->streamindex, seq->strip->colorspace_settings.name); ++ if (openfile) { ++ sanim->anim = openanim(name, IB_rect | ((seq->flag & SEQ_FILTERY) ? IB_animdeinterlace : 0), ++ seq->streamindex, seq->strip->colorspace_settings.name); ++ } ++ else { ++ sanim->anim = openanim_noload(name, IB_rect | ((seq->flag & SEQ_FILTERY) ? IB_animdeinterlace : 0), ++ seq->streamindex, seq->strip->colorspace_settings.name); ++ } + + /* no individual view files - monoscopic, stereo 3d or exr multiview */ + totfiles = 1; + } + + if (proxy && (seq->flag & SEQ_USE_PROXY_CUSTOM_DIR)) { + IMB_anim_set_index_dir(sanim->anim, dir); + } + } } + else { + StripAnim *sanim; +monoview: - if (seq->flag & SEQ_USE_PROXY_CUSTOM_DIR) { - char dir[FILE_MAX]; - BLI_strncpy(dir, seq->strip->proxy->dir, sizeof(dir)); - BLI_path_abs(dir, G.main->name); + sanim = MEM_mallocN(sizeof(StripAnim), "Strip Anim"); + BLI_addtail(&seq->anims, sanim); + - sanim->anim = openanim(name, IB_rect | ((seq->flag & SEQ_FILTERY) ? IB_animdeinterlace : 0), - seq->streamindex, seq->strip->colorspace_settings.name); ++ if (openfile) { ++ sanim->anim = openanim(name, IB_rect | ((seq->flag & SEQ_FILTERY) ? IB_animdeinterlace : 0), ++ seq->streamindex, seq->strip->colorspace_settings.name); ++ } ++ else { ++ sanim->anim = openanim_noload(name, IB_rect | ((seq->flag & SEQ_FILTERY) ? IB_animdeinterlace : 0), ++ seq->streamindex, seq->strip->colorspace_settings.name); ++ } + + if (sanim->anim == NULL) { + return; + } - IMB_anim_set_index_dir(seq->anim, dir); + if (proxy == NULL) { + return; + } + + if (seq->flag & SEQ_USE_PROXY_CUSTOM_DIR) { + IMB_anim_set_index_dir(sanim->anim, dir); + } } } @@@ -1609,10 -1464,9 +1628,10 @@@ static ImBuf *seq_proxy_fetch(const Seq return NULL; } - seq_open_anim_file(context->scene, seq); - seq_open_anim_file(seq, true); ++ seq_open_anim_file(context->scene, seq, true); + sanim = seq->anims.first; - frameno = IMB_anim_index_get_frame_index(seq->anim, seq->strip->proxy->tc, frameno); + frameno = IMB_anim_index_get_frame_index(sanim ? sanim->anim : NULL, seq->strip->proxy->tc, frameno); return IMB_anim_absolute(seq->strip->proxy->anim, frameno, IMB_TC_NONE, IMB_PROXY_NONE); } @@@ -1767,46 -1548,34 +1786,47 @@@ void BKE_sequencer_proxy_rebuild_contex } if (!(seq->flag & SEQ_USE_PROXY)) { - return NULL; + return; } - context = MEM_callocN(sizeof(SeqIndexBuildContext), "seq proxy rebuild context"); + num_files = seq_proxy_context_count(seq, scene); + + for (i = 0; i < num_files; i++) { + if (seq_proxy_multiview_context_invalid(seq, scene, i)) + continue; + + context = MEM_callocN(sizeof(SeqIndexBuildContext), "seq proxy rebuild context"); + + nseq = BKE_sequence_dupli_recursive(scene, scene, seq, 0); - nseq = BKE_sequence_dupli_recursive(scene, scene, seq, 0); + context->tc_flags = nseq->strip->proxy->build_tc_flags; + context->size_flags = nseq->strip->proxy->build_size_flags; + context->quality = nseq->strip->proxy->quality; + context->overwrite = (nseq->strip->proxy->build_flags & SEQ_PROXY_SKIP_EXISTING) == 0; - context->tc_flags = nseq->strip->proxy->build_tc_flags; - context->size_flags = nseq->strip->proxy->build_size_flags; - context->quality = nseq->strip->proxy->quality; - context->overwrite = (nseq->strip->proxy->build_flags & SEQ_PROXY_SKIP_EXISTING) == 0; + context->bmain = bmain; + context->scene = scene; + context->orig_seq = seq; + context->seq = nseq; + - context->bmain = bmain; - context->scene = scene; - context->orig_seq = seq; - context->seq = nseq; + context->view_id = i; /* only for images */ - if (nseq->type == SEQ_TYPE_MOVIE) { - seq_open_anim_file(nseq, true); + link = BLI_genericNodeN(context); + BLI_addtail(queue, link); - if (nseq->anim) { - context->index_context = IMB_anim_index_rebuild_context(nseq->anim, - context->tc_flags, context->size_flags, context->quality, - context->overwrite, file_list); + if (nseq->type == SEQ_TYPE_MOVIE) { + StripAnim *sanim; + - seq_open_anim_file(scene, nseq); ++ seq_open_anim_file(scene, nseq, true); + sanim = BLI_findlink(&nseq->anims, i); + + if (sanim->anim) { + context->index_context = IMB_anim_index_rebuild_context(sanim->anim, + context->tc_flags, context->size_flags, context->quality, + context->overwrite, file_list); + } } } - - return context; } void BKE_sequencer_proxy_rebuild(SeqIndexBuildContext *context, short *stop, short *do_update, float *progress) @@@ -3099,116 -2786,35 +3119,116 @@@ monoview_image case SEQ_TYPE_MOVIE: { - seq_open_anim_file(seq, false); + StripAnim *sanim; + bool is_multiview = (context->scene->r.scemode & R_MULTIVIEW) != 0; + + /* load all the videos */ - seq_open_anim_file(context->scene, seq); ++ seq_open_anim_file(context->scene, seq, false); + + if (is_multiview) { + ImBuf **ibuf_arr; + size_t totviews; + size_t totfiles = seq_num_files(context->scene, seq->views_format); + int i; + + if (totfiles != BLI_listbase_count_ex(&seq->anims, totfiles + 1)) + goto monoview_movie; + + totviews = BKE_scene_num_views_get(&context->scene->r); + ibuf_arr = MEM_callocN(sizeof(ImBuf *) * totviews, "Sequence Image Views Imbu @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs