diff options
author | Richard Antalik <richardantalik@gmail.com> | 2021-06-16 01:29:17 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2021-06-16 01:29:17 +0300 |
commit | 1a5fa2b319e06ebbd2666987aa11240a371dcc09 (patch) | |
tree | fa19d3c2f8b603e302b063a600e78f16733b5c5d /source/blender/sequencer/intern/utils.c | |
parent | 143a81ccceaf7d3abccc5a9dd4bb3520813dd222 (diff) |
VSE: Improve animation evaluation performance
Use lookup string callback function for `sequences_all` RNA property
`rna_SequenceEditor_sequences_all_lookup_string` using a GHash for faster lookups.
When names are changed or strips are added/removed the lookup is tagged invalid.
The next time the lookup is used it will rebuild it.
Reviewed By: sergey, jbakker
Differential Revision: https://developer.blender.org/D11544
Diffstat (limited to 'source/blender/sequencer/intern/utils.c')
-rw-r--r-- | source/blender/sequencer/intern/utils.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/sequencer/intern/utils.c b/source/blender/sequencer/intern/utils.c index 9aeb2961751..a287466dfb2 100644 --- a/source/blender/sequencer/intern/utils.c +++ b/source/blender/sequencer/intern/utils.c @@ -39,6 +39,7 @@ #include "BKE_main.h" #include "BKE_scene.h" +#include "SEQ_edit.h" #include "SEQ_iterator.h" #include "SEQ_relations.h" #include "SEQ_select.h" @@ -140,7 +141,9 @@ static int seqbase_unique_name_recursive_fn(Sequence *seq, void *arg_pt) return 1; } -void SEQ_sequence_base_unique_name_recursive(ListBase *seqbasep, Sequence *seq) +void SEQ_sequence_base_unique_name_recursive(struct Scene *scene, + ListBase *seqbasep, + Sequence *seq) { SeqUniqueInfo sui; char *dot; @@ -167,7 +170,7 @@ void SEQ_sequence_base_unique_name_recursive(ListBase *seqbasep, Sequence *seq) SEQ_seqbase_recursive_apply(seqbasep, seqbase_unique_name_recursive_fn, &sui); } - BLI_strncpy(seq->name + 2, sui.name_dest, sizeof(seq->name) - 2); + SEQ_edit_sequence_name_set(scene, seq, sui.name_dest); } static const char *give_seqname_by_type(int type) @@ -629,7 +632,7 @@ void SEQ_ensure_unique_name(Sequence *seq, Scene *scene) char name[SEQ_NAME_MAXSTR]; BLI_strncpy_utf8(name, seq->name + 2, sizeof(name)); - SEQ_sequence_base_unique_name_recursive(&scene->ed->seqbase, seq); + SEQ_sequence_base_unique_name_recursive(scene, &scene->ed->seqbase, seq); SEQ_dupe_animdata(scene, name, seq->name + 2); if (seq->type == SEQ_TYPE_META) { |