diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-06-24 17:45:35 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-06-24 17:45:35 +0400 |
commit | 1a55b53375cf45481e3916d9d3a96c7ce4204e73 (patch) | |
tree | e087353ec83945db6a9ee807745b4390a0b0d8ca /source/blender/editors | |
parent | c42c9cb234524fcde6248df686d359c2fa827fcd (diff) |
lattice: use functions rather then defines, also added a function to get uvw from an index.
- BKE_lattice_index_from_uvw()
- BKE_lattice_index_to_uvw()
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/object/object_shapekey.c | 7 | ||||
-rw-r--r-- | source/blender/editors/object/object_vgroup.c | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c index f9704343fdd..8fead6024fb 100644 --- a/source/blender/editors/object/object_shapekey.c +++ b/source/blender/editors/object/object_shapekey.c @@ -57,6 +57,7 @@ #include "BKE_library.h" #include "BKE_main.h" #include "BKE_object.h" +#include "BKE_lattice.h" #include "BKE_curve.h" #include "BLI_sys_types.h" // for intptr_t support @@ -244,14 +245,14 @@ static bool object_shape_key_mirror(bContext *C, Object *ob, int u_inv = (lt->pntsu - 1) - u; float tvec[3]; if (u == u_inv) { - i1 = LT_INDEX(lt, u, v, w); + i1 = BKE_lattice_index_from_uvw(lt, u, v, w); fp1 = ((float *)kb->data) + i1 * 3; fp1[0] = -fp1[0]; totmirr++; } else { - i1 = LT_INDEX(lt, u, v, w); - i2 = LT_INDEX(lt, u_inv, v, w); + i1 = BKE_lattice_index_from_uvw(lt, u, v, w); + i2 = BKE_lattice_index_from_uvw(lt, u_inv, v, w); fp1 = ((float *)kb->data) + i1 * 3; fp2 = ((float *)kb->data) + i2 * 3; diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 2f163a358bc..c5efa91d105 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -2477,8 +2477,8 @@ void ED_vgroup_mirror(Object *ob, if (u != u_inv) { BPoint *bp, *bp_mirr; - i1 = LT_INDEX(lt, u, v, w); - i2 = LT_INDEX(lt, u_inv, v, w); + i1 = BKE_lattice_index_from_uvw(lt, u, v, w); + i2 = BKE_lattice_index_from_uvw(lt, u_inv, v, w); bp = <->def[i1]; bp_mirr = <->def[i2]; |