diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-03-06 05:41:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-03-06 06:16:38 +0300 |
commit | b15c658801e191e09a4e9e8933a9ac79a3805e1b (patch) | |
tree | c840c2b20564898b1c7c528cba964bf485bb83a6 /source/blender/editors/object | |
parent | 07d13be678c6b8d5c5c793f664668831ac265f9e (diff) |
Cleanup: keyframe API naming, high level keyframe API
- Split 'verify_fcurve' into two functions:
ED_action_fcurve_ensure which adds the f-curve if needed.
ED_action_fcurve_find which returns NULL when not found.
Callers of ED_action_fcurve_find had unused 'group'
argument which has been removed.
- Rename verify_adt_action to ED_id_action_ensure
It had an argument to add data which was always true,
remove this instead of splitting in into a separate function.
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r-- | source/blender/editors/object/object_constraint.c | 8 | ||||
-rw-r--r-- | source/blender/editors/object/object_relations.c | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index bfff36bb83a..4db7ee9594e 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -1024,8 +1024,8 @@ static int followpath_path_animate_exec(bContext *C, wmOperator *op) if (ELEM(NULL, cu->adt, cu->adt->action) || (list_find_fcurve(&cu->adt->action->curves, "eval_time", 0) == NULL)) { /* create F-Curve for path animation */ - act = verify_adt_action(bmain, &cu->id, 1); - fcu = verify_fcurve(bmain, act, NULL, NULL, "eval_time", 0, 1); + act = ED_id_action_ensure(bmain, &cu->id); + fcu = ED_action_fcurve_ensure(bmain, act, NULL, NULL, "eval_time", 0); /* standard vertical range - 1:1 = 100 frames */ standardRange = 100.0f; @@ -1049,8 +1049,8 @@ static int followpath_path_animate_exec(bContext *C, wmOperator *op) path = RNA_path_from_ID_to_property(&ptr, prop); /* create F-Curve for constraint */ - act = verify_adt_action(bmain, &ob->id, 1); - fcu = verify_fcurve(bmain, act, NULL, NULL, path, 0, 1); + act = ED_id_action_ensure(bmain, &ob->id); + fcu = ED_action_fcurve_ensure(bmain, act, NULL, NULL, path, 0); /* standard vertical range - 0.0 to 1.0 */ standardRange = 1.0f; diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 006e1ebc6be..c7bba43758f 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -707,8 +707,8 @@ bool ED_object_parent_set(ReportList *reports, /* if follow, add F-Curve for ctime (i.e. "eval_time") so that path-follow works */ if (partype == PAR_FOLLOW) { /* get or create F-Curve */ - bAction *act = verify_adt_action(bmain, &cu->id, 1); - FCurve *fcu = verify_fcurve(bmain, act, NULL, NULL, "eval_time", 0, 1); + bAction *act = ED_id_action_ensure(bmain, &cu->id); + FCurve *fcu = ED_action_fcurve_ensure(bmain, act, NULL, NULL, "eval_time", 0); /* setup dummy 'generator' modifier here to get 1-1 correspondence still working */ if (!fcu->bezt && !fcu->fpt && !fcu->modifiers.first) { |