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:
authorRichard Antalik <richardantalik@gmail.com>2021-03-16 20:47:23 +0300
committerRichard Antalik <richardantalik@gmail.com>2021-03-16 20:56:44 +0300
commit04e1feb83051f75317309ec3659b9263a99dbd7e (patch)
treec2e71b1f62233b04bfab8f6f307e6d1838e8daa2 /source/blender/sequencer/intern/proxy.c
parente4f347783320d83e43bc650020013e19b2f22c7f (diff)
VSE: Automatic proxy building
Build proxies automatically when added to sequencer timeline and when switching preview size. This behavior can be disabled in user preferences. Reviewed By: sergey, fsiddi Differential Revision: https://developer.blender.org/D10363
Diffstat (limited to 'source/blender/sequencer/intern/proxy.c')
-rw-r--r--source/blender/sequencer/intern/proxy.c47
1 files changed, 33 insertions, 14 deletions
diff --git a/source/blender/sequencer/intern/proxy.c b/source/blender/sequencer/intern/proxy.c
index 562cd07ddee..a0e6bc7f4f1 100644
--- a/source/blender/sequencer/intern/proxy.c
+++ b/source/blender/sequencer/intern/proxy.c
@@ -55,6 +55,7 @@
#include "IMB_metadata.h"
#include "SEQ_proxy.h"
+#include "SEQ_relations.h"
#include "SEQ_render.h"
#include "SEQ_sequencer.h"
@@ -395,6 +396,17 @@ static int seq_proxy_context_count(Sequence *seq, Scene *scene)
return num_views;
}
+static bool seq_proxy_need_rebuild(Sequence *seq, struct anim *anim)
+{
+ if ((seq->strip->proxy->build_flags & SEQ_PROXY_SKIP_EXISTING) == 0) {
+ return true;
+ }
+
+ IMB_Proxy_Size required_proxies = seq->strip->proxy->build_size_flags;
+ IMB_Proxy_Size built_proxies = IMB_anim_proxy_get_existing(anim);
+ return (required_proxies & built_proxies) != required_proxies;
+}
+
bool SEQ_proxy_rebuild_context(Main *bmain,
Depsgraph *depsgraph,
Scene *scene,
@@ -423,6 +435,16 @@ bool SEQ_proxy_rebuild_context(Main *bmain,
continue;
}
+ /* Check if proxies are already built here, because actually opening anims takes a lot of
+ * time. */
+ seq_open_anim_file(scene, seq, false);
+ StripAnim *sanim = BLI_findlink(&seq->anims, i);
+ if (sanim->anim && !seq_proxy_need_rebuild(seq, sanim->anim)) {
+ continue;
+ }
+
+ SEQ_relations_sequence_free_anim(seq);
+
context = MEM_callocN(sizeof(SeqIndexBuildContext), "seq proxy rebuild context");
nseq = SEQ_sequence_dupli_recursive(scene, scene, NULL, seq, 0);
@@ -441,28 +463,25 @@ bool SEQ_proxy_rebuild_context(Main *bmain,
context->view_id = i; /* only for images */
if (nseq->type == SEQ_TYPE_MOVIE) {
- StripAnim *sanim;
-
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);
- }
- if (!context->index_context) {
- MEM_freeN(context);
- return false;
- }
+ context->index_context = IMB_anim_index_rebuild_context(sanim->anim,
+ context->tc_flags,
+ context->size_flags,
+ context->quality,
+ context->overwrite,
+ file_list);
+ }
+ if (!context->index_context) {
+ SEQ_proxy_rebuild_finish(context, false);
+ return false;
}
link = BLI_genericNodeN(context);
BLI_addtail(queue, link);
}
+
return true;
}