diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-09-17 11:03:13 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-09-17 11:03:13 +0400 |
commit | 0b22cfb1d14f49393042160e4beadf351f171ddc (patch) | |
tree | 16bad1ddd6be12fdd9f4b82de7990760fbbb0c5b /source/blender/editors/mesh | |
parent | 0002d3d85f4c4e6d3084e468fa844e717719ab4d (diff) |
fix [#36246] Weight tools do not mirror properly in vertex selection mask mode.
Weight mirror is now supported by invert/clean/levels/blend.
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r-- | source/blender/editors/mesh/meshtools.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index ce1cacdfb3a..efa619bd10c 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -1011,6 +1011,31 @@ BMVert *editbmesh_get_x_mirror_vert(Object *ob, struct BMEditMesh *em, BMVert *e } } +/** + * Wrapper for objectmode/editmode. + * + * call #EDBM_index_arrays_ensure first for editmesh. + */ +int ED_mesh_mirror_get_vert(Object *ob, int index) +{ + Mesh *me = ob->data; + BMEditMesh *em = me->edit_btmesh; + bool use_topology = (me->editflag & ME_EDIT_MIRROR_TOPO) != 0; + int index_mirr; + + if (em) { + BMVert *eve, *eve_mirr; + eve = EDBM_vert_at_index(em, index); + eve_mirr = editbmesh_get_x_mirror_vert(ob, em, eve, eve->co, index, use_topology); + index_mirr = eve_mirr ? BM_elem_index_get(eve_mirr) : -1; + } + else { + index_mirr = mesh_get_x_mirror_vert(ob, index, use_topology); + } + + return index_mirr; +} + #if 0 static float *editmesh_get_mirror_uv(BMEditMesh *em, int axis, float *uv, float *mirrCent, float *face_cent) |