Merge branch 'blender-v4.5-release'

This commit is contained in:
Campbell Barton
2025-06-18 15:19:16 +10:00
2 changed files with 18 additions and 1 deletions

View File

@@ -33,6 +33,8 @@ bAction *id_action_ensure(Main *bmain, ID *id);
/**
* Delete the F-Curve from the given AnimData block (if possible),
* as appropriate according to animation context.
*
* \note This function cannot be used to delete F-Curves from an NLA strip's Action.
*/
void animdata_fcurve_delete(AnimData *adt, FCurve *fcu);

View File

@@ -2942,7 +2942,22 @@ static wmOperatorStatus animchannels_delete_exec(bContext *C, wmOperator * /*op*
/* try to free F-Curve */
BLI_assert_msg((fcu->driver != nullptr) == (ac.datatype == ANIMCONT_DRIVERS),
"Expecting only driver F-Curves in the drivers editor");
blender::animrig::animdata_fcurve_delete(adt, fcu);
if (ale->fcurve_owner_id && GS(ale->fcurve_owner_id->name) == ID_AC) {
/* F-Curves can be owned by Actions assigned to NLA strips, which
* `animrig::animdata_fcurve_delete()` (below) cannot handle. */
BLI_assert_msg(!fcu->driver, "Drivers are not expected to be owned by Actions");
blender::animrig::Action &action =
reinterpret_cast<bAction *>(ale->fcurve_owner_id)->wrap();
BLI_assert(!action.is_action_legacy());
action_fcurve_remove(action, *fcu);
}
else if (fcu->driver || adt->action) {
/* This function only works for drivers & directly-assigned Actions: */
blender::animrig::animdata_fcurve_delete(adt, fcu);
}
else {
BLI_assert_unreachable();
}
tag_update_animation_element(ale);
break;
}