Refactor: remove ED_ prefix from autokeying functions #113612

Merged
Christoph Lendenfeld merged 2 commits from ChrisLend/blender:refactor_autokey_fn_naming into main 2023-10-12 16:32:35 +02:00
9 changed files with 32 additions and 35 deletions

View File

@ -127,10 +127,8 @@ bool is_autokey_flag(const Scene *scene, eAutokey_Flag flag);
bool autokeyframe_cfra_can_key(const Scene *scene, ID *id);
void autokeyframe_object(bContext *C, Scene *scene, ViewLayer *view_layer, Object *ob, int tmode);
bool ED_autokeyframe_object(bContext *C, Scene *scene, Object *ob, KeyingSet *ks);
bool ED_autokeyframe_pchan(
bContext *C, Scene *scene, Object *ob, bPoseChannel *pchan, KeyingSet *ks);
bool autokeyframe_object(bContext *C, Scene *scene, Object *ob, KeyingSet *ks);
bool autokeyframe_pchan(bContext *C, Scene *scene, Object *ob, bPoseChannel *pchan, KeyingSet *ks);
/**
* Use for auto-key-framing.
@ -138,13 +136,13 @@ bool ED_autokeyframe_pchan(
* properties. This is by design when using buttons. For other callers such as gizmos or sequencer
* preview transform, creating new animation/keyframes also on non-keyed properties is desired.
*/
bool ED_autokeyframe_property(bContext *C,
Scene *scene,
PointerRNA *ptr,
PropertyRNA *prop,
int rnaindex,
float cfra,
bool only_if_property_keyed);
bool autokeyframe_property(bContext *C,
Scene *scene,
PointerRNA *ptr,
PropertyRNA *prop,
int rnaindex,
float cfra,
bool only_if_property_keyed);
/** \} */

View File

@ -207,7 +207,7 @@ void autokeyframe_object(bContext *C, Scene *scene, ViewLayer *view_layer, Objec
}
}
bool ED_autokeyframe_object(bContext *C, Scene *scene, Object *ob, KeyingSet *ks)
bool autokeyframe_object(bContext *C, Scene *scene, Object *ob, KeyingSet *ks)
{
/* auto keyframing */
if (autokeyframe_cfra_can_key(scene, &ob->id)) {
@ -227,8 +227,7 @@ bool ED_autokeyframe_object(bContext *C, Scene *scene, Object *ob, KeyingSet *ks
return false;
}
bool ED_autokeyframe_pchan(
bContext *C, Scene *scene, Object *ob, bPoseChannel *pchan, KeyingSet *ks)
bool autokeyframe_pchan(bContext *C, Scene *scene, Object *ob, bPoseChannel *pchan, KeyingSet *ks)
{
if (autokeyframe_cfra_can_key(scene, &ob->id)) {
ListBase dsources = {nullptr, nullptr};
@ -248,13 +247,13 @@ bool ED_autokeyframe_pchan(
return false;
}
bool ED_autokeyframe_property(bContext *C,
Scene *scene,
PointerRNA *ptr,
PropertyRNA *prop,
int rnaindex,
float cfra,
const bool only_if_property_keyed)
bool autokeyframe_property(bContext *C,
Scene *scene,
PointerRNA *ptr,
PropertyRNA *prop,
int rnaindex,
float cfra,
const bool only_if_property_keyed)
{
Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);

View File

@ -825,7 +825,7 @@ static int pose_flip_quats_exec(bContext *C, wmOperator * /*op*/)
/* quaternions have 720 degree range */
negate_v4(pchan->quat);
blender::animrig::ED_autokeyframe_pchan(C, scene, ob_iter, pchan, ks);
blender::animrig::autokeyframe_pchan(C, scene, ob_iter, pchan, ks);
}
}
FOREACH_PCHAN_SELECTED_IN_OBJECT_END;

View File

@ -910,7 +910,7 @@ static int pose_paste_exec(bContext *C, wmOperator *op)
bPoseChannel *pchan = pose_bone_do_paste(ob, chan, selOnly, flip);
if (pchan != nullptr) {
/* Keyframing tagging for successful paste, */
blender::animrig::ED_autokeyframe_pchan(C, scene, ob, pchan, ks);
blender::animrig::autokeyframe_pchan(C, scene, ob, pchan, ks);
}
}
}

View File

@ -302,7 +302,7 @@ bool ui_but_anim_expression_create(uiBut *but, const char *str)
void ui_but_anim_autokey(bContext *C, uiBut *but, Scene *scene, float cfra)
{
blender::animrig::ED_autokeyframe_property(
blender::animrig::autokeyframe_property(
C, scene, &but->rnapoin, but->rnaprop, but->rnaindex, cfra, true);
}

View File

@ -349,7 +349,7 @@ static int object_clear_transform_generic_exec(bContext *C,
/* run provided clearing function */
clear_func(ob, clear_delta);
blender::animrig::ED_autokeyframe_object(C, scene, ob, ks);
blender::animrig::autokeyframe_object(C, scene, ob, ks);
/* tag for updates */
DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM);

View File

@ -158,7 +158,7 @@ static int snap_sel_to_grid_exec(bContext *C, wmOperator * /*op*/)
}
/* auto-keyframing */
blender::animrig::ED_autokeyframe_pchan(C, scene, ob, pchan, ks);
blender::animrig::autokeyframe_pchan(C, scene, ob, pchan, ks);
}
/* if the bone has a parent and is connected to the parent,
* don't do anything - will break chain unless we do auto-ik.
@ -238,7 +238,7 @@ static int snap_sel_to_grid_exec(bContext *C, wmOperator * /*op*/)
}
/* auto-keyframing */
blender::animrig::ED_autokeyframe_object(C, scene, ob, ks);
blender::animrig::autokeyframe_object(C, scene, ob, ks);
if (use_transform_data_origin) {
ED_object_data_xform_container_item_ensure(xds, ob);
@ -431,7 +431,7 @@ static bool snap_selected_to_location(bContext *C,
}
/* auto-keyframing */
blender::animrig::ED_autokeyframe_pchan(C, scene, ob, pchan, ks);
blender::animrig::autokeyframe_pchan(C, scene, ob, pchan, ks);
}
else {
copy_v3_v3(pchan->loc, cursor_pose);
@ -538,7 +538,7 @@ static bool snap_selected_to_location(bContext *C,
}
/* auto-keyframing */
blender::animrig::ED_autokeyframe_object(C, scene, ob, ks);
blender::animrig::autokeyframe_object(C, scene, ob, ks);
}
else {
add_v3_v3(ob->loc, cursor_parent);

View File

@ -179,23 +179,23 @@ static bool autokeyframe_sequencer_image(bContext *C,
bool changed = false;
if (do_rot) {
prop = RNA_struct_find_property(&ptr, "rotation");
changed |= blender::animrig::ED_autokeyframe_property(
changed |= blender::animrig::autokeyframe_property(
C, scene, &ptr, prop, -1, scene->r.cfra, false);
}
if (do_loc) {
prop = RNA_struct_find_property(&ptr, "offset_x");
changed |= blender::animrig::ED_autokeyframe_property(
changed |= blender::animrig::autokeyframe_property(
C, scene, &ptr, prop, -1, scene->r.cfra, false);
prop = RNA_struct_find_property(&ptr, "offset_y");
changed |= blender::animrig::ED_autokeyframe_property(
changed |= blender::animrig::autokeyframe_property(
C, scene, &ptr, prop, -1, scene->r.cfra, false);
}
if (do_scale) {
prop = RNA_struct_find_property(&ptr, "scale_x");
changed |= blender::animrig::ED_autokeyframe_property(
changed |= blender::animrig::autokeyframe_property(
C, scene, &ptr, prop, -1, scene->r.cfra, false);
prop = RNA_struct_find_property(&ptr, "scale_y");
changed |= blender::animrig::ED_autokeyframe_property(
changed |= blender::animrig::autokeyframe_property(
C, scene, &ptr, prop, -1, scene->r.cfra, false);
}

View File

@ -345,7 +345,7 @@ void WM_gizmo_target_property_anim_autokey(bContext *C,
Scene *scene = CTX_data_scene(C);
const float cfra = float(scene->r.cfra);
const int index = gz_prop->index == -1 ? 0 : gz_prop->index;
blender::animrig::ED_autokeyframe_property(
blender::animrig::autokeyframe_property(
C, scene, &gz_prop->ptr, gz_prop->prop, index, cfra, false);
}
}