From b15c658801e191e09a4e9e8933a9ac79a3805e1b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 6 Mar 2020 13:41:27 +1100 Subject: 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. --- source/blender/collada/AnimationImporter.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source/blender/collada') diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp index 18ca6ae7a0f..715cd9e1a12 100644 --- a/source/blender/collada/AnimationImporter.cpp +++ b/source/blender/collada/AnimationImporter.cpp @@ -197,7 +197,7 @@ void AnimationImporter::add_fcurves_to_object(Main *bmain, bAction *act; if (!ob->adt || !ob->adt->action) { - act = verify_adt_action(bmain, (ID *)&ob->id, 1); + act = ED_id_action_ensure(bmain, (ID *)&ob->id); } else { act = ob->adt->action; @@ -941,7 +941,7 @@ void AnimationImporter::apply_matrix_curves(Object *ob, } } Main *bmain = CTX_data_main(mContext); - verify_adt_action(bmain, (ID *)&ob->id, 1); + ED_id_action_ensure(bmain, (ID *)&ob->id); ListBase *curves = &ob->adt->action->curves; @@ -1006,7 +1006,7 @@ static ListBase &get_animation_curves(Main *bmain, Material *ma) { bAction *act; if (!ma->adt || !ma->adt->action) { - act = verify_adt_action(bmain, (ID *)&ma->id, 1); + act = ED_id_action_ensure(bmain, (ID *)&ma->id); } else { act = ma->adt->action; @@ -1052,7 +1052,7 @@ void AnimationImporter::translate_Animations( } if (!ob->adt || !ob->adt->action) { - act = verify_adt_action(bmain, (ID *)&ob->id, 1); + act = ED_id_action_ensure(bmain, (ID *)&ob->id); } else { act = ob->adt->action; @@ -1115,7 +1115,7 @@ void AnimationImporter::translate_Animations( if ((animType->light) != 0) { Light *lamp = (Light *)ob->data; if (!lamp->adt || !lamp->adt->action) { - act = verify_adt_action(bmain, (ID *)&lamp->id, 1); + act = ED_id_action_ensure(bmain, (ID *)&lamp->id); } else { act = lamp->adt->action; @@ -1153,7 +1153,7 @@ void AnimationImporter::translate_Animations( Camera *cam = (Camera *)ob->data; if (!cam->adt || !cam->adt->action) { - act = verify_adt_action(bmain, (ID *)&cam->id, 1); + act = ED_id_action_ensure(bmain, (ID *)&cam->id); } else { act = cam->adt->action; @@ -1209,7 +1209,7 @@ void AnimationImporter::translate_Animations( Material *ma = BKE_object_material_get(ob, 1); if (!ma->adt || !ma->adt->action) { - act = verify_adt_action(bmain, (ID *)&ma->id, 1); + act = ED_id_action_ensure(bmain, (ID *)&ma->id); } else { act = ma->adt->action; @@ -1390,7 +1390,7 @@ void AnimationImporter::add_bone_animation_sampled(Object *ob, } } Main *bmain = CTX_data_main(mContext); - verify_adt_action(bmain, (ID *)&ob->id, 1); + ED_id_action_ensure(bmain, (ID *)&ob->id); /* add curves */ for (int i = 0; i < totcu; i++) { @@ -1823,7 +1823,7 @@ Object *AnimationImporter::translate_animation_OLD( #endif } Main *bmain = CTX_data_main(mContext); - verify_adt_action(bmain, (ID *)&ob->id, 1); + ED_id_action_ensure(bmain, (ID *)&ob->id); ListBase *curves = &ob->adt->action->curves; @@ -2129,7 +2129,7 @@ Object *AnimationImporter::get_joint_object(COLLADAFW::Node *root, mul_v3_fl(job->scale, 0.5f); DEG_id_tag_update(&job->id, ID_RECALC_TRANSFORM); - verify_adt_action((ID *)&job->id, 1); + ED_id_action_ensure((ID *)&job->id); job->rotmode = ROT_MODE_QUAT; -- cgit v1.2.3