[Bf-blender-cvs] [d526ef6] master: Cleanup: rename `BKE_key_convert/update` to `BKE_keyblock_convert/update`.
Bastien Montagne
noreply at git.blender.org
Mon Nov 17 11:21:20 CET 2014
Commit: d526ef607d0a8741799ede335c2c64dc87e4f094
Author: Bastien Montagne
Date: Sun Nov 16 19:15:23 2014 +0100
Branches: master
https://developer.blender.org/rBd526ef607d0a8741799ede335c2c64dc87e4f094
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.
===================================================================
M source/blender/blenkernel/BKE_key.h
M source/blender/blenkernel/intern/DerivedMesh.c
M source/blender/blenkernel/intern/key.c
M source/blender/blenkernel/intern/object.c
M source/blender/blenkernel/intern/paint.c
M source/blender/collada/ArmatureImporter.cpp
M source/blender/collada/GeometryExporter.cpp
M source/blender/editors/curve/editcurve.c
M source/blender/editors/mesh/meshtools.c
M source/blender/editors/object/object_lattice.c
M source/blender/editors/object/object_modifier.c
M source/blender/editors/object/object_shapekey.c
M source/blender/editors/sculpt_paint/sculpt.c
M source/blender/editors/sculpt_paint/sculpt_undo.c
===================================================================
diff --git a/source/blender/blenkernel/BKE_key.h b/source/blender/blenkernel/BKE_key.h
index c96293f..fe083eb 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 affb855..0d029b1 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 f42ed5d..d426602 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 725ed8d..d9e597f 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 312dcd3..ea81d16 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) ? BK
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list