diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2019-05-15 22:26:58 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2019-05-15 22:35:15 +0300 |
commit | 40a69b2ad7fc03dd28e985ec95dcc18967c6454f (patch) | |
tree | 38e707bad4a3a6f427485e4db017bde6407c2777 /source/blender/blenkernel | |
parent | 198c00f4ed09f8b9c7273c40f93c7f2630f14624 (diff) |
Animation: treat F-Curves with no keys as if muted/not existing.
When normally editing curves, deleting the last keyframe also
deletes the curve. Thus if for some reason it didn't happen,
e.g. maybe due to removing keys directly via Python, skip the
bad curve instead of resetting the channel to zero.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/anim_sys.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index cc5cd3b03ae..663eb4027f6 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -1893,6 +1893,10 @@ static void animsys_evaluate_fcurves(Depsgraph *depsgraph, if ((fcu->flag & (FCURVE_MUTED | FCURVE_DISABLED))) { continue; } + /* Skip empty curves, as if muted. */ + if (fcu->totvert == 0) { + continue; + } PathResolvedRNA anim_rna; if (animsys_store_rna_setting(ptr, fcu->rna_path, fcu->array_index, &anim_rna)) { const float curval = calculate_fcurve(&anim_rna, fcu, ctime); @@ -2005,7 +2009,7 @@ void animsys_evaluate_action_group(PointerRNA *ptr, bAction *act, bActionGroup * /* calculate then execute each curve */ for (fcu = agrp->channels.first; (fcu) && (fcu->grp == agrp); fcu = fcu->next) { /* check if this curve should be skipped */ - if ((fcu->flag & (FCURVE_MUTED | FCURVE_DISABLED)) == 0) { + if ((fcu->flag & (FCURVE_MUTED | FCURVE_DISABLED)) == 0 && fcu->totvert != 0) { PathResolvedRNA anim_rna; if (animsys_store_rna_setting(ptr, fcu->rna_path, fcu->array_index, &anim_rna)) { const float curval = calculate_fcurve(&anim_rna, fcu, ctime); @@ -3101,6 +3105,9 @@ static void nlastrip_evaluate_actionclip(PointerRNA *ptr, if ((fcu->grp) && (fcu->grp->flag & AGRP_MUTED)) { continue; } + if (fcu->totvert == 0) { + continue; + } /* evaluate the F-Curve's value for the time given in the strip * NOTE: we use the modified time here, since strip's F-Curve Modifiers @@ -3327,6 +3334,9 @@ static void nla_eval_domain_action(PointerRNA *ptr, if ((fcu->grp) && (fcu->grp->flag & AGRP_MUTED)) { continue; } + if (fcu->totvert == 0) { + continue; + } NlaEvalChannel *nec = nlaevalchan_verify(ptr, channels, fcu->rna_path); |