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.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -82,6 +82,11 @@ void ui_but_anim_flag(uiBut *but, float cfra)
|
||||
|
||||
if (fcu) {
|
||||
if (!driven) {
|
||||
/* Empty curves are ignored by the animation evaluation system. */
|
||||
if (fcu->totvert == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
but->flag |= UI_BUT_ANIMATED;
|
||||
|
||||
/* T41525 - When the active action is a NLA strip being edited,
|
||||
|
||||
Reference in New Issue
Block a user