WIP: VSE: share ImBufAnim resource between strips #118670

Draft
Richard Antalik wants to merge 28 commits from iss/blender:anim-sharing-2 into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
2 changed files with 6 additions and 5 deletions
Showing only changes of commit e7830a92c9 - Show all commits

View File

@ -1245,7 +1245,7 @@ static ImBuf *seq_render_movie_strip(const SeqRenderData *context,
SeqRenderData localcontext = *context;
localcontext.view_id = view_id;
if (view_id != context->view_id) {
if (view_id != context->view_id && ibuf_arr[view_id]) {
ibuf_arr[view_id] = seq_render_preprocess_ibuf(
&localcontext, seq, ibuf_arr[view_id], timeline_frame, true, false);
}

View File

@ -257,7 +257,7 @@ static void index_dir_set(Editing *ed, Sequence *seq, StripAnim *sanim)
seq_proxy_index_dir_set(sanim->anim, proxy_dirpath);
}
static bool open_anim_file_multiview(Scene *scene, Sequence *seq, char *filepath, bool openfile)
static bool open_anim_file_multiview(Scene *scene, Sequence *seq, char *filepath)
{
char prefix[FILE_MAX];
const char *ext = nullptr;
@ -277,10 +277,11 @@ static bool open_anim_file_multiview(Scene *scene, Sequence *seq, char *filepath
SNPRINTF(filepath_view, "%s%s%s", prefix, suffix, ext);
StripAnim *sanim = static_cast<StripAnim *>(MEM_mallocN(sizeof(StripAnim), "Strip Anim"));
open_anim_filepath(seq, sanim, filepath_view, openfile);
/* Multiview files must be loaded, otherwise it is not possible to detect failure. */
open_anim_filepath(seq, sanim, filepath_view, true);
if (sanim->anim == nullptr) {
MEM_freeN(sanim);
SEQ_relations_sequence_free_anim(seq);
return false; /* Multiview render failed. */
}
@ -313,7 +314,7 @@ void seq_open_anim_file(Scene *scene, Sequence *seq, bool openfile)
bool multiview_is_loaded = false;
if (is_multiview) {
multiview_is_loaded = open_anim_file_multiview(scene, seq, filepath, openfile);
multiview_is_loaded = open_anim_file_multiview(scene, seq, filepath);
}
if (!is_multiview || !multiview_is_loaded) {