[Bf-blender-cvs] [e8b8e16b24a] master: Code Cleanup: fcurve function naming
Jeroen Bakker
noreply at git.blender.org
Fri Jun 5 09:30:45 CEST 2020
Commit: e8b8e16b24ade2ca0861cb40a8b4e800a3fb0729
Author: Jeroen Bakker
Date: Fri Jun 5 09:30:15 2020 +0200
Branches: master
https://developer.blender.org/rBe8b8e16b24ade2ca0861cb40a8b4e800a3fb0729
Code Cleanup: fcurve function naming
===================================================================
M source/blender/blenkernel/BKE_fcurve.h
M source/blender/blenkernel/intern/action.c
M source/blender/blenkernel/intern/anim_data.c
M source/blender/blenkernel/intern/fcurve.c
M source/blender/blenkernel/intern/ipo.c
M source/blender/blenkernel/intern/nla.c
M source/blender/blenkernel/intern/object.c
M source/blender/blenkernel/intern/scene.c
M source/blender/blenkernel/intern/sequencer.c
M source/blender/blenloader/intern/versioning_280.c
M source/blender/editors/animation/anim_channels_edit.c
M source/blender/editors/animation/anim_filter.c
M source/blender/editors/animation/drivers.c
M source/blender/editors/animation/keyframing.c
M source/blender/editors/armature/armature_add.c
M source/blender/editors/curve/editcurve.c
M source/blender/editors/curve/editcurve_undo.c
M source/blender/editors/interface/interface_anim.c
M source/blender/editors/object/object_constraint.c
M source/blender/editors/screen/screen_ops.c
M source/blender/editors/space_action/action_edit.c
M source/blender/editors/space_graph/graph_buttons.c
M source/blender/editors/space_graph/graph_draw.c
M source/blender/editors/space_graph/graph_edit.c
M source/blender/editors/space_graph/graph_utils.c
M source/blender/editors/space_graph/space_graph.c
M source/blender/editors/space_nla/nla_draw.c
M source/blender/editors/space_outliner/outliner_tools.c
M source/blender/io/collada/AnimationImporter.cpp
M source/blender/io/collada/BCAnimationCurve.cpp
M source/blender/makesrna/intern/rna_access.c
M source/blender/makesrna/intern/rna_action.c
M source/blender/makesrna/intern/rna_animation.c
M source/blender/makesrna/intern/rna_fcurve.c
M source/blender/makesrna/intern/rna_nla.c
M source/blender/python/intern/bpy_rna_anim.c
M tests/gtests/blenkernel/BKE_fcurve_test.cc
===================================================================
diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h
index b310d66d4bd..c3a597e29b9 100644
--- a/source/blender/blenkernel/BKE_fcurve.h
+++ b/source/blender/blenkernel/BKE_fcurve.h
@@ -180,18 +180,18 @@ int BKE_fcm_envelope_find_index(struct FCM_EnvelopeData *array,
/* -------- Data Management -------- */
struct FCurve *BKE_fcurve_create(void);
-void free_fcurve(struct FCurve *fcu);
-struct FCurve *copy_fcurve(const struct FCurve *fcu);
+void BKE_fcurve_free(struct FCurve *fcu);
+struct FCurve *BKE_fcurve_copy(const struct FCurve *fcu);
-void free_fcurves(ListBase *list);
-void copy_fcurves(ListBase *dst, ListBase *src);
+void BKE_fcurves_free(ListBase *list);
+void BKE_fcurves_copy(ListBase *dst, ListBase *src);
void BKE_fcurve_foreach_id(struct FCurve *fcu, struct LibraryForeachIDData *data);
/* find matching F-Curve in the given list of F-Curves */
-struct FCurve *list_find_fcurve(ListBase *list, const char rna_path[], const int array_index);
+struct FCurve *BKE_fcurve_find(ListBase *list, const char rna_path[], const int array_index);
-struct FCurve *iter_step_fcurve(struct FCurve *fcu_iter, const char rna_path[]);
+struct FCurve *BKE_fcurve_iter_step(struct FCurve *fcu_iter, const char rna_path[]);
/* high level function to get an fcurve from C without having the rna */
struct FCurve *id_data_find_fcurve(
@@ -199,31 +199,28 @@ struct FCurve *id_data_find_fcurve(
/* Get list of LinkData's containing pointers to the F-Curves which control the types of data
* indicated
- * e.g. numMatches = list_find_data_fcurves(matches, &act->curves, "pose.bones[", "MyFancyBone");
+ * e.g. numMatches = BKE_fcurves_filter(matches, &act->curves, "pose.bones[", "MyFancyBone");
*/
-int list_find_data_fcurves(ListBase *dst,
- ListBase *src,
- const char *dataPrefix,
- const char *dataName);
+int BKE_fcurves_filter(ListBase *dst, ListBase *src, const char *dataPrefix, const char *dataName);
/* Find an f-curve based on an rna property. */
-struct FCurve *rna_get_fcurve(struct PointerRNA *ptr,
- struct PropertyRNA *prop,
- int rnaindex,
- struct AnimData **r_adt,
- struct bAction **r_action,
- bool *r_driven,
- bool *r_special);
+struct FCurve *BKE_fcurve_find_by_rna(struct PointerRNA *ptr,
+ struct PropertyRNA *prop,
+ int rnaindex,
+ struct AnimData **r_adt,
+ struct bAction **r_action,
+ bool *r_driven,
+ bool *r_special);
/* Same as above, but takes a context data,
* temp hack needed for complex paths like texture ones. */
-struct FCurve *rna_get_fcurve_context_ui(struct bContext *C,
- struct PointerRNA *ptr,
- struct PropertyRNA *prop,
- int rnaindex,
- struct AnimData **r_animdata,
- struct bAction **r_action,
- bool *r_driven,
- bool *r_special);
+struct FCurve *BKE_fcurve_find_by_rna_context_ui(struct bContext *C,
+ struct PointerRNA *ptr,
+ struct PropertyRNA *prop,
+ int rnaindex,
+ struct AnimData **r_animdata,
+ struct bAction **r_action,
+ bool *r_driven,
+ bool *r_special);
/* Binary search algorithm for finding where to 'insert' BezTriple with given frame number.
* Returns the index to insert at (data already at that index will be offset if replace is 0)
@@ -231,25 +228,25 @@ struct FCurve *rna_get_fcurve_context_ui(struct bContext *C,
int binarysearch_bezt_index(struct BezTriple array[], float frame, int arraylen, bool *r_replace);
/* get the time extents for F-Curve */
-bool calc_fcurve_range(
+bool BKE_fcurve_calc_range(
struct FCurve *fcu, float *min, float *max, const bool do_sel_only, const bool do_min_length);
/* get the bounding-box extents for F-Curve */
-bool calc_fcurve_bounds(struct FCurve *fcu,
- float *xmin,
- float *xmax,
- float *ymin,
- float *ymax,
- const bool do_sel_only,
- const bool include_handles);
+bool BKE_fcurve_calc_bounds(struct FCurve *fcu,
+ float *xmin,
+ float *xmax,
+ float *ymin,
+ float *ymax,
+ const bool do_sel_only,
+ const bool include_handles);
/* .............. */
/* Are keyframes on F-Curve of any use (to final result, and to show in editors)? */
-bool fcurve_are_keyframes_usable(struct FCurve *fcu);
+bool BKE_fcurve_are_keyframes_usable(struct FCurve *fcu);
/* Can keyframes be added to F-Curve? */
-bool fcurve_is_keyframable(struct FCurve *fcu);
+bool BKE_fcurve_is_keyframable(struct FCurve *fcu);
bool BKE_fcurve_is_protected(struct FCurve *fcu);
/* The curve is an infinite cycle via Cycles modifier */
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index ca58b69689c..c776f0d077d 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -116,7 +116,7 @@ static void action_copy_data(Main *UNUSED(bmain),
/* XXX TODO pass subdata flag?
* But surprisingly does not seem to be doing any ID refcounting... */
- fcurve_dst = copy_fcurve(fcurve_src);
+ fcurve_dst = BKE_fcurve_copy(fcurve_src);
BLI_addtail(&action_dst->curves, fcurve_dst);
@@ -146,7 +146,7 @@ static void action_free_data(struct ID *id)
/* No animdata here. */
/* Free F-Curves. */
- free_fcurves(&action->curves);
+ BKE_fcurves_free(&action->curves);
/* Free groups. */
BLI_freelistN(&action->groups);
@@ -1310,7 +1310,7 @@ void calc_action_range(const bAction *act, float *start, float *end, short incl_
* single-keyframe curves will increase the overall length by
* a phantom frame (T50354)
*/
- calc_fcurve_range(fcu, &nmin, &nmax, false, false);
+ BKE_fcurve_calc_range(fcu, &nmin, &nmax, false, false);
/* compare to the running tally */
min = min_ff(min, nmin);
diff --git a/source/blender/blenkernel/intern/anim_data.c b/source/blender/blenkernel/intern/anim_data.c
index 726753a4e70..9ab4e5c028d 100644
--- a/source/blender/blenkernel/intern/anim_data.c
+++ b/source/blender/blenkernel/intern/anim_data.c
@@ -256,7 +256,7 @@ void BKE_animdata_free(ID *id, const bool do_id_user)
BKE_nla_tracks_free(&adt->nla_tracks, do_id_user);
/* free drivers - stored as a list of F-Curves */
- free_fcurves(&adt->drivers);
+ BKE_fcurves_free(&adt->drivers);
/* free driver array cache */
MEM_SAFE_FREE(adt->driver_array);
@@ -345,7 +345,7 @@ AnimData *BKE_animdata_copy(Main *bmain, AnimData *adt, const int flag)
BKE_nla_tracks_copy(bmain, &dadt->nla_tracks, &adt->nla_tracks, flag);
/* duplicate drivers (F-Curves) */
- copy_fcurves(&dadt->drivers, &adt->drivers);
+ BKE_fcurves_copy(&dadt->drivers, &adt->drivers);
dadt->driver_array = NULL;
/* don't copy overrides */
@@ -447,7 +447,7 @@ void BKE_animdata_merge_copy(
if (src->drivers.first) {
ListBase drivers = {NULL, NULL};
- copy_fcurves(&drivers, &src->drivers);
+ BKE_fcurves_copy(&drivers, &src->drivers);
/* Fix up all driver targets using the old target id
* - This assumes that the src ID is being merged into the dst ID
@@ -1101,7 +1101,7 @@ static bool fcurves_path_remove_fix(const char *prefix, ListBase *curves)
if (fcu->rna_path) {
if (STRPREFIX(fcu->rna_path, prefix)) {
BLI_remlink(curves, fcu);
- free_fcurve(fcu);
+ BKE_fcurve_free(fcu);
any_removed = true;
}
}
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index 5eb1b756ac7..d4754615c7f 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -66,7 +66,7 @@ FCurve *BKE_fcurve_create(void)
/* ---------------------- Freeing --------------------------- */
/* Frees the F-Curve itself too, so make sure BLI_remlink is called before calling this... */
-void free_fcurve(FCurve *fcu)
+void BKE_fcurve_free(FCurve *fcu)
{
if (fcu == NULL) {
return;
@@ -88,7 +88,7 @@ void free_fcurve(FCurve *fcu)
}
/* Frees a list of F-Curves */
-void free_fcurves(ListBase *list)
+void BKE_fcurves_free(ListBase *list)
{
FCurve *fcu, *fcn;
@@ -103,7 +103,7 @@ void free_fcurves(ListBase *list)
*/
for (fcu = list->first; fcu; fcu = fcn) {
fcn = fcu->next;
- free_fcurve(fcu);
+ BKE_fcurve_free(fcu);
}
/* clear pointers just in case */
@@ -113,7 +113,7 @@ void free_fcurves(ListBase *list)
/* ---------------------- Copy --------------------------- */
/* duplicate an F-Curve */
-FCurve *copy_fcurve(const FCurve *fcu)
+FCurve *BKE_fcurve_copy(const FCurve *fcu)
{
FCurve *fcu_d;
@@ -146,7 +146,7 @@ FCurve *copy_fcurve(const FCurve *fcu)
}
/* duplicate a list of F-Curves */
-void copy_fcurves(ListBase *dst, ListBase *src)
+void BKE_fcurves_copy(ListBase *dst, ListBase *src)
{
FCurve *dfcu, *sfcu;
@@ -160,7 +160,7 @@ void copy_fcurves(ListBase *dst, ListBase *src)
/* copy one-by-one */
for (sfcu = src->first; sfcu; s
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list