Fix T89805: NLA crash without active track

Was reported for a file which does not have an active track set in
AnimData even though it was in strip twek mode (but this was accessed in
is_nlatrack_evaluatable()).

Root cause for this is not totally clear, but I assume the situation is
described as part T87681 (and is fixed in D11052).

This patch here just prevents the crash for files that are already in the
borked state.

Reviewers: sybren

Maniphest Tasks: T89805

Differential Revision: https://developer.blender.org/D12085
This commit is contained in:
Philipp Oeser 2021-07-30 11:58:02 +02:00
parent dc8844f8ef
commit 333c3c92ab
Notes: blender-bot 2023-02-14 03:13:26 +01:00
Referenced by issue #88449, Blender LTS: Maintenance Task 2.93
Referenced by issue #89805, Blender Crashing when opening file
1 changed files with 1 additions and 1 deletions

View File

@ -2671,7 +2671,7 @@ static void animsys_create_action_track_strip(const AnimData *adt,
static bool is_nlatrack_evaluatable(const AnimData *adt, const NlaTrack *nlt)
{
/* Skip disabled tracks unless it contains the tweaked strip. */
const bool contains_tweak_strip = (adt->flag & ADT_NLA_EDIT_ON) &&
const bool contains_tweak_strip = (adt->flag & ADT_NLA_EDIT_ON) && adt->act_track &&
(nlt->index == adt->act_track->index);
if ((nlt->flag & NLATRACK_DISABLED) && !contains_tweak_strip) {
return false;