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:
authorSybren A. Stüvel <sybren@blender.org>2022-06-21 16:27:22 +0300
committerSybren A. Stüvel <sybren@blender.org>2022-06-21 16:28:11 +0300
commit7f3af2aaeea3820543ed228c04ae329e6795a8ac (patch)
treed10829c1398160e193ec60c57c76e82c678f2389 /source/blender/blenkernel/intern/nla.c
parent15bc3d260d64b39d31a3102030088be347aa14fb (diff)
NLA: when searching for active track/strip, shortcut when none is active
In the `update_active_track()` function, add a shortcut that just sets `NULL`, instead of searching for `NULL` pointers. Should give a tiny speedup.
Diffstat (limited to 'source/blender/blenkernel/intern/nla.c')
-rw-r--r--source/blender/blenkernel/intern/nla.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index 1900ae2e9ad..10abb8f20df 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -303,6 +303,12 @@ static void update_active_strip(AnimData *adt_dest,
/* Set adt_dest->act_track to the track with the same index as adt_source->act_track. */
static void update_active_track(AnimData *adt_dest, const AnimData *adt_source)
{
+ adt_dest->act_track = NULL;
+ adt_dest->actstrip = NULL;
+ if (adt_source->act_track == NULL && adt_source->actstrip == NULL) {
+ return;
+ }
+
BLI_assert(BLI_listbase_count(&adt_source->nla_tracks) ==
BLI_listbase_count(&adt_dest->nla_tracks));