Refactor: Rename functions in ANIM_animdata.hh
No functional changes. Renaming the following functions `ANIM_remove_empty_action_from_animdata` and `ANIM_fcurve_delete_from_animdata` to `animdata_remove_empty_action` and `animdata_fcurve_delete` The `ANIM` prefix was no longer needed since the code is now in a namespace. In order to make the function name consistent with the functions in `fcurve.cc` the thing it modifies is now at the start of the function name Pull Request: https://projects.blender.org/blender/blender/pulls/114584
This commit is contained in:
committed by
Christoph Lendenfeld
parent
fc74f341a5
commit
c8ccd3d58a
@@ -18,7 +18,7 @@ namespace blender::animrig {
|
||||
* Delete the F-Curve from the given AnimData block (if possible),
|
||||
* as appropriate according to animation context.
|
||||
*/
|
||||
void ANIM_fcurve_delete_from_animdata(bAnimContext *ac, AnimData *adt, FCurve *fcu);
|
||||
void animdata_fcurve_delete(bAnimContext *ac, AnimData *adt, FCurve *fcu);
|
||||
|
||||
/**
|
||||
* Unlink the action from animdata if it's empty.
|
||||
@@ -26,6 +26,6 @@ void ANIM_fcurve_delete_from_animdata(bAnimContext *ac, AnimData *adt, FCurve *f
|
||||
* If the action has no F-Curves, unlink it from AnimData if it did not
|
||||
* come from a NLA Strip being tweaked.
|
||||
*/
|
||||
bool ANIM_remove_empty_action_from_animdata(AnimData *adt);
|
||||
bool animdata_remove_empty_action(AnimData *adt);
|
||||
|
||||
} // namespace blender::animrig
|
||||
@@ -20,7 +20,7 @@ namespace blender::animrig {
|
||||
/** \name Public F-Curves API
|
||||
* \{ */
|
||||
|
||||
void ANIM_fcurve_delete_from_animdata(bAnimContext *ac, AnimData *adt, FCurve *fcu)
|
||||
void animdata_fcurve_delete(bAnimContext *ac, AnimData *adt, FCurve *fcu)
|
||||
{
|
||||
/* - if no AnimData, we've got nowhere to remove the F-Curve from
|
||||
* (this doesn't guarantee that the F-Curve is in there, but at least we tried
|
||||
@@ -68,14 +68,14 @@ void ANIM_fcurve_delete_from_animdata(bAnimContext *ac, AnimData *adt, FCurve *f
|
||||
* channel list that are empty, and linger around long after the data they
|
||||
* are for has disappeared (and probably won't come back).
|
||||
*/
|
||||
ANIM_remove_empty_action_from_animdata(adt);
|
||||
animdata_remove_empty_action(adt);
|
||||
}
|
||||
|
||||
/* free the F-Curve itself */
|
||||
BKE_fcurve_free(fcu);
|
||||
}
|
||||
|
||||
bool ANIM_remove_empty_action_from_animdata(AnimData *adt)
|
||||
bool animdata_remove_empty_action(AnimData *adt)
|
||||
{
|
||||
if (adt->action != nullptr) {
|
||||
bAction *act = adt->action;
|
||||
|
||||
@@ -33,7 +33,7 @@ bool delete_keyframe_fcurve(AnimData *adt, FCurve *fcu, float cfra)
|
||||
|
||||
/* Empty curves get automatically deleted. */
|
||||
if (BKE_fcurve_is_empty(fcu)) {
|
||||
ANIM_fcurve_delete_from_animdata(nullptr, adt, fcu);
|
||||
animdata_fcurve_delete(nullptr, adt, fcu);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -937,7 +937,7 @@ int clear_keyframe(Main *bmain,
|
||||
continue;
|
||||
}
|
||||
|
||||
ANIM_fcurve_delete_from_animdata(nullptr, adt, fcu);
|
||||
animdata_fcurve_delete(nullptr, adt, fcu);
|
||||
|
||||
key_count++;
|
||||
}
|
||||
|
||||
@@ -2136,7 +2136,7 @@ static int animchannels_delete_exec(bContext *C, wmOperator * /*op*/)
|
||||
FCurve *fcu = (FCurve *)ale->data;
|
||||
|
||||
/* try to free F-Curve */
|
||||
blender::animrig::ANIM_fcurve_delete_from_animdata(&ac, adt, fcu);
|
||||
blender::animrig::animdata_fcurve_delete(&ac, adt, fcu);
|
||||
tag_update_animation_element(ale);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ void clean_fcurve(bAnimContext *ac,
|
||||
/* check if curve is really unused and if it is, return signal for deletion */
|
||||
if (BKE_fcurve_is_empty(fcu)) {
|
||||
AnimData *adt = ale->adt;
|
||||
blender::animrig::ANIM_fcurve_delete_from_animdata(ac, adt, fcu);
|
||||
blender::animrig::animdata_fcurve_delete(ac, adt, fcu);
|
||||
ale->key_data = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -628,14 +628,14 @@ static int clear_anim_v3d_exec(bContext *C, wmOperator * /*op*/)
|
||||
|
||||
/* delete F-Curve completely */
|
||||
if (can_delete) {
|
||||
blender::animrig::ANIM_fcurve_delete_from_animdata(nullptr, adt, fcu);
|
||||
blender::animrig::animdata_fcurve_delete(nullptr, adt, fcu);
|
||||
DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* Delete the action itself if it is empty. */
|
||||
if (blender::animrig::ANIM_remove_empty_action_from_animdata(adt)) {
|
||||
if (blender::animrig::animdata_remove_empty_action(adt)) {
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1111,7 +1111,7 @@ static bool delete_action_keys(bAnimContext *ac)
|
||||
|
||||
/* Only delete curve too if it won't be doing anything anymore */
|
||||
if (BKE_fcurve_is_empty(fcu)) {
|
||||
blender::animrig::ANIM_fcurve_delete_from_animdata(ac, adt, fcu);
|
||||
blender::animrig::animdata_fcurve_delete(ac, adt, fcu);
|
||||
ale->key_data = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -766,7 +766,7 @@ static bool delete_graph_keys(bAnimContext *ac)
|
||||
|
||||
/* Only delete curve too if it won't be doing anything anymore. */
|
||||
if (BKE_fcurve_is_empty(fcu)) {
|
||||
blender::animrig::ANIM_fcurve_delete_from_animdata(ac, adt, fcu);
|
||||
blender::animrig::animdata_fcurve_delete(ac, adt, fcu);
|
||||
ale->key_data = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user