This change was initially spurred by the fact that delete_fcurve_keys was improperly named, but this was a good opportunity to fix the location and naming of a few of these functions.
The functions formerly known as delete_fcurve_key, delete_fcurve_keys, and clear_fcurve_keys have been moved out of ED_keyframes_edit.h and have been moved to BKE_fcurve.h and have been renamed according to hierarchical naming rules.
Below is a table of the naming changes.
| From | To |
|---|---|
| delete_fcurve_key(fcu, index, do_recalc) | BKE_fcurve_delete_key(fcu, index) |
| delete_fcurve_keys(fcu) | BKE_fcurve_delete_keys_selected(fcu) |
| clear_fcurve_keys(fcu) | BKE_fcurve_delete_keys_all(fcu) |
| calchandles_fcurve() | BKE_fcurve_handles_recalc() |
| calchandles_fcurve_ex() | BKE_fcurve_handles_recalc_ex() |
The function formerly known as delete_fcurve_key no longer takes a do_fast parameter, which determined whether or not to call calchandles_fcurve. Now, the responsibility is on the caller to run the new BKE_fcurve_handles_recalc function if they have want to recalculate the handles.
In addition, there is now a new static private function called fcurve_bezt_free which sets the key count to zero and frees the key array. This function is now used in couple of instances of functionally equivalent code. Note that BKE_fcurve_delete_keys_all is just a wrapper around fcurve_bezt_free.