Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/animation/drivers.c')
-rw-r--r--source/blender/editors/animation/drivers.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c
index ee0f403a155..328e435877c 100644
--- a/source/blender/editors/animation/drivers.c
+++ b/source/blender/editors/animation/drivers.c
@@ -36,9 +36,11 @@
#include "DNA_space_types.h"
#include "DNA_texture_types.h"
+#include "BKE_anim_data.h"
#include "BKE_animsys.h"
#include "BKE_context.h"
#include "BKE_fcurve.h"
+#include "BKE_fcurve_driver.h"
#include "BKE_report.h"
#include "DEG_depsgraph.h"
@@ -90,7 +92,7 @@ FCurve *verify_driver_fcurve(ID *id,
* - add if not found and allowed to add one
* TODO: add auto-grouping support? how this works will need to be resolved
*/
- fcu = list_find_fcurve(&adt->drivers, rna_path, array_index);
+ fcu = BKE_fcurve_find(&adt->drivers, rna_path, array_index);
if (fcu == NULL && creation_mode != DRIVER_FCURVE_LOOKUP_ONLY) {
/* use default settings to make a F-Curve */
@@ -108,7 +110,7 @@ struct FCurve *alloc_driver_fcurve(const char rna_path[],
const int array_index,
eDriverFCurveCreationMode creation_mode)
{
- FCurve *fcu = MEM_callocN(sizeof(FCurve), "FCurve");
+ FCurve *fcu = BKE_fcurve_create();
fcu->flag = (FCURVE_VISIBLE | FCURVE_SELECTED);
fcu->auto_smoothing = U.auto_smoothing_new;
@@ -568,13 +570,13 @@ bool ANIM_remove_driver(ReportList *UNUSED(reports),
/* step through all drivers, removing all of those with the same base path */
FCurve *fcu_iter = adt->drivers.first;
- while ((fcu = iter_step_fcurve(fcu_iter, rna_path)) != NULL) {
+ while ((fcu = BKE_fcurve_iter_step(fcu_iter, rna_path)) != NULL) {
/* store the next fcurve for looping */
fcu_iter = fcu->next;
/* remove F-Curve from driver stack, then free it */
BLI_remlink(&adt->drivers, fcu);
- free_fcurve(fcu);
+ BKE_fcurve_free(fcu);
/* done successfully */
success = true;
@@ -588,7 +590,7 @@ bool ANIM_remove_driver(ReportList *UNUSED(reports),
fcu = verify_driver_fcurve(id, rna_path, array_index, DRIVER_FCURVE_LOOKUP_ONLY);
if (fcu) {
BLI_remlink(&adt->drivers, fcu);
- free_fcurve(fcu);
+ BKE_fcurve_free(fcu);
success = true;
}
@@ -609,7 +611,7 @@ void ANIM_drivers_copybuf_free(void)
{
/* free the buffer F-Curve if it exists, as if it were just another F-Curve */
if (channeldriver_copypaste_buf) {
- free_fcurve(channeldriver_copypaste_buf);
+ BKE_fcurve_free(channeldriver_copypaste_buf);
}
channeldriver_copypaste_buf = NULL;
}
@@ -660,7 +662,7 @@ bool ANIM_copy_driver(
fcu->rna_path = NULL;
/* make a copy of the F-Curve with */
- channeldriver_copypaste_buf = copy_fcurve(fcu);
+ channeldriver_copypaste_buf = BKE_fcurve_copy(fcu);
/* restore the path */
fcu->rna_path = tmp_path;
@@ -979,7 +981,8 @@ static bool add_driver_button_poll(bContext *C)
}
/* Don't do anything if there is an fcurve for animation without a driver. */
- FCurve *fcu = rna_get_fcurve_context_ui(C, &ptr, prop, index, NULL, NULL, &driven, &special);
+ FCurve *fcu = BKE_fcurve_find_by_rna_context_ui(
+ C, &ptr, prop, index, NULL, NULL, &driven, &special);
return (fcu == NULL || fcu->driver);
}