diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-11-16 21:15:23 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-11-17 13:19:54 +0300 |
commit | d526ef607d0a8741799ede335c2c64dc87e4f094 (patch) | |
tree | f08fce82d64dfcbf44fb477d730881924699e5f9 /source/blender/blenkernel | |
parent | a52fbfa828966d19e8db5995d2332c90aa6515f4 (diff) |
Cleanup: rename `BKE_key_convert/update` to `BKE_keyblock_convert/update`.
We are handling a keyblock here, not a whole key(set). Names are alreay a bit confusing,
let's be consistent at least.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_key.h | 27 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/key.c | 36 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/paint.c | 6 |
5 files changed, 38 insertions, 39 deletions
diff --git a/source/blender/blenkernel/BKE_key.h b/source/blender/blenkernel/BKE_key.h index c96293f61a1..fe083ebe847 100644 --- a/source/blender/blenkernel/BKE_key.h +++ b/source/blender/blenkernel/BKE_key.h @@ -88,28 +88,27 @@ void BKE_key_evaluate_relative(const int start, int end, const int tot, char *ba /* conversion functions */ /* Note: 'update_from' versions do not (re)allocate mem in kb, while 'convert_from' do. */ -void BKE_key_update_from_lattice(struct Lattice *lt, struct KeyBlock *kb); -void BKE_key_convert_from_lattice(struct Lattice *lt, struct KeyBlock *kb); -void BKE_key_convert_to_lattice(struct KeyBlock *kb, struct Lattice *lt); +void BKE_keyblock_update_from_lattice(struct Lattice *lt, struct KeyBlock *kb); +void BKE_keyblock_convert_from_lattice(struct Lattice *lt, struct KeyBlock *kb); +void BKE_keyblock_convert_to_lattice(struct KeyBlock *kb, struct Lattice *lt); -void BKE_key_update_from_curve(struct Curve *cu, struct KeyBlock *kb, struct ListBase *nurb); -void BKE_key_convert_from_curve(struct Curve *cu, struct KeyBlock *kb, struct ListBase *nurb); -void BKE_key_convert_to_curve(struct KeyBlock *kb, struct Curve *cu, struct ListBase *nurb); +void BKE_keyblock_update_from_curve(struct Curve *cu, struct KeyBlock *kb, struct ListBase *nurb); +void BKE_keyblock_convert_from_curve(struct Curve *cu, struct KeyBlock *kb, struct ListBase *nurb); +void BKE_keyblock_convert_to_curve(struct KeyBlock *kb, struct Curve *cu, struct ListBase *nurb); -void BKE_key_update_from_mesh(struct Mesh *me, struct KeyBlock *kb); -void BKE_key_convert_from_mesh(struct Mesh *me, struct KeyBlock *kb); -void BKE_key_convert_to_mesh(struct KeyBlock *kb, struct Mesh *me); +void BKE_keyblock_update_from_mesh(struct Mesh *me, struct KeyBlock *kb); +void BKE_keyblock_convert_from_mesh(struct Mesh *me, struct KeyBlock *kb); +void BKE_keyblock_convert_to_mesh(struct KeyBlock *kb, struct Mesh *me); -void BKE_key_update_from_vertcos(struct Object *ob, struct KeyBlock *kb, float (*vertCos)[3]); -void BKE_key_convert_from_vertcos(struct Object *ob, struct KeyBlock *kb, float (*vertCos)[3]); -float (*BKE_key_convert_to_vertcos(struct Object *ob, struct KeyBlock *kb))[3]; +void BKE_keyblock_update_from_vertcos(struct Object *ob, struct KeyBlock *kb, float (*vertCos)[3]); +void BKE_keyblock_convert_from_vertcos(struct Object *ob, struct KeyBlock *kb, float (*vertCos)[3]); +float (*BKE_keyblock_convert_to_vertcos(struct Object *ob, struct KeyBlock *kb))[3]; -void BKE_key_update_from_offset(struct Object *ob, struct KeyBlock *kb, float (*ofs)[3]); +void BKE_keyblock_update_from_offset(struct Object *ob, struct KeyBlock *kb, float (*ofs)[3]); /* other management */ bool BKE_keyblock_move(struct Object *ob, int org_index, int new_index); - /* key.c */ extern int slurph_opt; diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index affb8550570..0d029b161ff 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -914,7 +914,7 @@ DerivedMesh *mesh_create_derived_for_modifier(Scene *scene, Object *ob, if (mti->isDisabled && mti->isDisabled(md, 0)) return NULL; if (build_shapekey_layers && me->key && (kb = BLI_findlink(&me->key->block, ob->shapenr - 1))) { - BKE_key_convert_to_mesh(kb, me); + BKE_keyblock_convert_to_mesh(kb, me); } if (mti->type == eModifierTypeType_OnlyDeform) { diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c index f42ed5d1c30..d4266022d2f 100644 --- a/source/blender/blenkernel/intern/key.c +++ b/source/blender/blenkernel/intern/key.c @@ -1669,7 +1669,7 @@ char *BKE_keyblock_curval_rnapath_get(Key *key, KeyBlock *kb) /* conversion functions */ /************************* Lattice ************************/ -void BKE_key_update_from_lattice(Lattice *lt, KeyBlock *kb) +void BKE_keyblock_update_from_lattice(Lattice *lt, KeyBlock *kb) { BPoint *bp; float *fp; @@ -1687,7 +1687,7 @@ void BKE_key_update_from_lattice(Lattice *lt, KeyBlock *kb) } } -void BKE_key_convert_from_lattice(Lattice *lt, KeyBlock *kb) +void BKE_keyblock_convert_from_lattice(Lattice *lt, KeyBlock *kb) { int tot; @@ -1699,10 +1699,10 @@ void BKE_key_convert_from_lattice(Lattice *lt, KeyBlock *kb) kb->data = MEM_mallocN(lt->key->elemsize * tot, __func__); kb->totelem = tot; - BKE_key_update_from_lattice(lt, kb); + BKE_keyblock_update_from_lattice(lt, kb); } -void BKE_key_convert_to_lattice(KeyBlock *kb, Lattice *lt) +void BKE_keyblock_convert_to_lattice(KeyBlock *kb, Lattice *lt) { BPoint *bp; const float *fp; @@ -1720,7 +1720,7 @@ void BKE_key_convert_to_lattice(KeyBlock *kb, Lattice *lt) } /************************* Curve ************************/ -void BKE_key_update_from_curve(Curve *UNUSED(cu), KeyBlock *kb, ListBase *nurb) +void BKE_keyblock_update_from_curve(Curve *UNUSED(cu), KeyBlock *kb, ListBase *nurb) { Nurb *nu; BezTriple *bezt; @@ -1767,7 +1767,7 @@ void BKE_key_update_from_curve(Curve *UNUSED(cu), KeyBlock *kb, ListBase *nurb) } } -void BKE_key_convert_from_curve(Curve *cu, KeyBlock *kb, ListBase *nurb) +void BKE_keyblock_convert_from_curve(Curve *cu, KeyBlock *kb, ListBase *nurb) { int tot; @@ -1780,10 +1780,10 @@ void BKE_key_convert_from_curve(Curve *cu, KeyBlock *kb, ListBase *nurb) kb->data = MEM_mallocN(cu->key->elemsize * tot, __func__); kb->totelem = tot; - BKE_key_update_from_curve(cu, kb, nurb); + BKE_keyblock_update_from_curve(cu, kb, nurb); } -void BKE_key_convert_to_curve(KeyBlock *kb, Curve *UNUSED(cu), ListBase *nurb) +void BKE_keyblock_convert_to_curve(KeyBlock *kb, Curve *UNUSED(cu), ListBase *nurb) { Nurb *nu; BezTriple *bezt; @@ -1834,7 +1834,7 @@ void BKE_key_convert_to_curve(KeyBlock *kb, Curve *UNUSED(cu), ListBase *nurb) } /************************* Mesh ************************/ -void BKE_key_update_from_mesh(Mesh *me, KeyBlock *kb) +void BKE_keyblock_update_from_mesh(Mesh *me, KeyBlock *kb) { MVert *mvert; float *fp; @@ -1853,7 +1853,7 @@ void BKE_key_update_from_mesh(Mesh *me, KeyBlock *kb) } } -void BKE_key_convert_from_mesh(Mesh *me, KeyBlock *kb) +void BKE_keyblock_convert_from_mesh(Mesh *me, KeyBlock *kb) { int tot = me->totvert; @@ -1864,10 +1864,10 @@ void BKE_key_convert_from_mesh(Mesh *me, KeyBlock *kb) kb->data = MEM_mallocN(me->key->elemsize * tot, __func__); kb->totelem = tot; - BKE_key_update_from_mesh(me, kb); + BKE_keyblock_update_from_mesh(me, kb); } -void BKE_key_convert_to_mesh(KeyBlock *kb, Mesh *me) +void BKE_keyblock_convert_to_mesh(KeyBlock *kb, Mesh *me) { MVert *mvert; const float *fp; @@ -1884,7 +1884,7 @@ void BKE_key_convert_to_mesh(KeyBlock *kb, Mesh *me) } /************************* raw coords ************************/ -void BKE_key_update_from_vertcos(Object *ob, KeyBlock *kb, float (*vertCos)[3]) +void BKE_keyblock_update_from_vertcos(Object *ob, KeyBlock *kb, float (*vertCos)[3]) { float *co = (float *)vertCos; float *fp = kb->data; @@ -1945,7 +1945,7 @@ void BKE_key_update_from_vertcos(Object *ob, KeyBlock *kb, float (*vertCos)[3]) } } -void BKE_key_convert_from_vertcos(Object *ob, KeyBlock *kb, float (*vertCos)[3]) +void BKE_keyblock_convert_from_vertcos(Object *ob, KeyBlock *kb, float (*vertCos)[3]) { int tot = 0, elemsize; @@ -1973,10 +1973,10 @@ void BKE_key_convert_from_vertcos(Object *ob, KeyBlock *kb, float (*vertCos)[3]) kb->data = MEM_mallocN(tot * elemsize, __func__); /* Copy coords to keyblock */ - BKE_key_update_from_vertcos(ob, kb, vertCos); + BKE_keyblock_update_from_vertcos(ob, kb, vertCos); } -float (*BKE_key_convert_to_vertcos(Object *ob, KeyBlock *kb))[3] +float (*BKE_keyblock_convert_to_vertcos(Object *ob, KeyBlock *kb))[3] { float (*vertCos)[3], *co; const float *fp = kb->data; @@ -1998,7 +1998,7 @@ float (*BKE_key_convert_to_vertcos(Object *ob, KeyBlock *kb))[3] if (tot == 0) return NULL; - vertCos = MEM_mallocN(tot * sizeof(*vertCos), "BKE_key_convert_to_vertcos vertCos"); + vertCos = MEM_mallocN(tot * sizeof(*vertCos), __func__); /* Copy coords to array */ co = (float *)vertCos; @@ -2053,7 +2053,7 @@ float (*BKE_key_convert_to_vertcos(Object *ob, KeyBlock *kb))[3] } /************************* raw coord offsets ************************/ -void BKE_key_update_from_offset(Object *ob, KeyBlock *kb, float (*ofs)[3]) +void BKE_keyblock_update_from_offset(Object *ob, KeyBlock *kb, float (*ofs)[3]) { int a; float *co = (float *)ofs, *fp = kb->data; diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 725ed8d2a3e..d9e597feefd 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -3360,7 +3360,7 @@ static KeyBlock *insert_meshkey(Scene *scene, Object *ob, const char *name, cons if (newkey || from_mix == false) { /* create from mesh */ kb = BKE_keyblock_add_ctime(key, name, false); - BKE_key_convert_from_mesh(me, kb); + BKE_keyblock_convert_from_mesh(me, kb); } else { /* copy from current values */ @@ -3397,7 +3397,7 @@ static KeyBlock *insert_lattkey(Scene *scene, Object *ob, const char *name, cons kb->totelem = basekb->totelem; } else { - BKE_key_convert_from_lattice(lt, kb); + BKE_keyblock_convert_from_lattice(lt, kb); } } else { @@ -3437,7 +3437,7 @@ static KeyBlock *insert_curvekey(Scene *scene, Object *ob, const char *name, con kb->totelem = basekb->totelem; } else { - BKE_key_convert_from_curve(cu, kb, lb); + BKE_keyblock_convert_from_curve(cu, kb, lb); } } else { diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 312dcd32301..ea81d1609d9 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -740,7 +740,7 @@ void BKE_sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob, BKE_free_sculptsession_deformMats(ss); - ss->orig_cos = (ss->kb) ? BKE_key_convert_to_vertcos(ob, ss->kb) : BKE_mesh_vertexCos_get(me, NULL); + ss->orig_cos = (ss->kb) ? BKE_keyblock_convert_to_vertcos(ob, ss->kb) : BKE_mesh_vertexCos_get(me, NULL); BKE_crazyspace_build_sculpt(scene, ob, &ss->deform_imats, &ss->deform_cos); BKE_pbvh_apply_vertCos(ss->pbvh, ss->deform_cos); @@ -755,14 +755,14 @@ void BKE_sculpt_update_mesh_elements(Scene *scene, Sculpt *sd, Object *ob, } if (ss->kb != NULL && ss->deform_cos == NULL) { - ss->deform_cos = BKE_key_convert_to_vertcos(ob, ss->kb); + ss->deform_cos = BKE_keyblock_convert_to_vertcos(ob, ss->kb); } /* if pbvh is deformed, key block is already applied to it */ if (ss->kb) { bool pbvh_deformd = BKE_pbvh_isDeformed(ss->pbvh); if (!pbvh_deformd || ss->deform_cos == NULL) { - float (*vertCos)[3] = BKE_key_convert_to_vertcos(ob, ss->kb); + float (*vertCos)[3] = BKE_keyblock_convert_to_vertcos(ob, ss->kb); if (vertCos) { if (!pbvh_deformd) { |