From 0d5d2146ebc026c254fc68e4970a1dfb3a9b5b31 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 19 Sep 2012 10:12:07 +0000 Subject: code cleanup: make shape key api names consistent with our new convention. --- source/blender/editors/object/object_add.c | 2 +- source/blender/editors/object/object_lattice.c | 4 ++-- source/blender/editors/object/object_modifier.c | 8 ++++---- source/blender/editors/object/object_shapekey.c | 22 +++++++++++----------- 4 files changed, 18 insertions(+), 18 deletions(-) (limited to 'source/blender/editors/object') diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index d73bbbabf84..42828b2dcae 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1826,7 +1826,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, Base *base /* check if obdata is copied */ if (didit) { - Key *key = ob_get_key(obn); + Key *key = BKE_key_from_object(obn); if (dupflag & USER_DUP_ACT) { bActuator *act; diff --git a/source/blender/editors/object/object_lattice.c b/source/blender/editors/object/object_lattice.c index 89f9f5de311..1f7be0bf9a6 100644 --- a/source/blender/editors/object/object_lattice.c +++ b/source/blender/editors/object/object_lattice.c @@ -92,9 +92,9 @@ void make_editLatt(Object *obedit) free_editLatt(obedit); - actkey = ob_get_keyblock(obedit); + actkey = BKE_keyblock_from_object(obedit); if (actkey) - key_to_latt(actkey, lt); + BKE_key_convert_to_lattice(actkey, lt); lt->editlatt = MEM_callocN(sizeof(EditLatt), "editlatt"); lt->editlatt->latt = MEM_dupallocN(lt); diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 4858fdf1c35..67c99a12428 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -565,15 +565,15 @@ static int modifier_apply_shape(ReportList *reports, Scene *scene, Object *ob, M } if (key == NULL) { - key = me->key = add_key((ID *)me); + key = me->key = BKE_key_add((ID *)me); key->type = KEY_RELATIVE; /* if that was the first key block added, then it was the basis. * Initialize it with the mesh, and add another for the modifier */ - kb = add_keyblock(key, NULL); - mesh_to_key(me, kb); + kb = BKE_keyblock_add(key, NULL); + BKE_key_convert_from_mesh(me, kb); } - kb = add_keyblock(key, md->name); + kb = BKE_keyblock_add(key, md->name); DM_to_meshkey(dm, me, kb); dm->release(dm); diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c index 40b653a62fd..cfd4945688b 100644 --- a/source/blender/editors/object/object_shapekey.c +++ b/source/blender/editors/object/object_shapekey.c @@ -78,7 +78,7 @@ static void ED_object_shape_key_add(bContext *C, Scene *scene, Object *ob, int f { KeyBlock *kb; if ((kb = BKE_object_insert_shape_key(scene, ob, NULL, from_mix))) { - Key *key = ob_get_key(ob); + Key *key = BKE_key_from_object(ob); /* for absolute shape keys, new keys may not be added last */ ob->shapenr = BLI_findindex(&key->block, kb) + 1; @@ -95,7 +95,7 @@ static int ED_object_shape_key_remove(bContext *C, Object *ob) Key *key; //IpoCurve *icu; - key = ob_get_key(ob); + key = BKE_key_from_object(ob); if (key == NULL) return 0; @@ -115,14 +115,14 @@ static int ED_object_shape_key_remove(bContext *C, Object *ob) /* apply new basis key on original data */ switch (ob->type) { case OB_MESH: - key_to_mesh(key->refkey, ob->data); + BKE_key_convert_to_mesh(key->refkey, ob->data); break; case OB_CURVE: case OB_SURF: - key_to_curve(key->refkey, ob->data, BKE_curve_nurbs_get(ob->data)); + BKE_key_convert_to_curve(key->refkey, ob->data, BKE_curve_nurbs_get(ob->data)); break; case OB_LATTICE: - key_to_latt(key->refkey, ob->data); + BKE_key_convert_to_lattice(key->refkey, ob->data); break; } } @@ -155,7 +155,7 @@ static int object_shape_key_mirror(bContext *C, Object *ob) KeyBlock *kb; Key *key; - key = ob_get_key(ob); + key = BKE_key_from_object(ob); if (key == NULL) return 0; @@ -323,8 +323,8 @@ void OBJECT_OT_shape_key_remove(wmOperatorType *ot) static int shape_key_clear_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob = ED_object_context(C); - Key *key = ob_get_key(ob); - KeyBlock *kb = ob_get_keyblock(ob); + Key *key = BKE_key_from_object(ob); + KeyBlock *kb = BKE_keyblock_from_object(ob); if (!key || !kb) return OPERATOR_CANCELLED; @@ -357,8 +357,8 @@ void OBJECT_OT_shape_key_clear(wmOperatorType *ot) static int shape_key_retime_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob = ED_object_context(C); - Key *key = ob_get_key(ob); - KeyBlock *kb = ob_get_keyblock(ob); + Key *key = BKE_key_from_object(ob); + KeyBlock *kb = BKE_keyblock_from_object(ob); float cfra = 0.0f; if (!key || !kb) @@ -419,7 +419,7 @@ static int shape_key_move_exec(bContext *C, wmOperator *op) Object *ob = ED_object_context(C); int type = RNA_enum_get(op->ptr, "type"); - Key *key = ob_get_key(ob); + Key *key = BKE_key_from_object(ob); if (key) { KeyBlock *kb, *kb_other; -- cgit v1.2.3