diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-06-20 01:23:00 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-06-20 01:23:00 +0400 |
commit | 1ed8343d6da17076e43c06cce272c4b1d93f89a8 (patch) | |
tree | 0aa3de0428daac4d5b57241541a75f8c1a8e455f /source | |
parent | c33093ac085c117a0c3004c42def280c8c977ce3 (diff) |
add axis option to EDBM_verts_mirror_cache_begin
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/include/ED_mesh.h | 6 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_select.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 4 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_utils.c | 12 | ||||
-rw-r--r-- | source/blender/editors/object/object_vgroup.c | 2 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 2 |
6 files changed, 17 insertions, 11 deletions
diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index f35edb70251..0b25c494ba9 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -76,9 +76,11 @@ struct MeshStatVis; /* editmesh_utils.c */ -void EDBM_verts_mirror_cache_begin_ex(struct BMEditMesh *em, const bool use_self, const bool use_select, +void EDBM_verts_mirror_cache_begin_ex(struct BMEditMesh *em, const int axis, + const bool use_self, const bool use_select, const bool is_topo, float maxdist, int *r_index); -void EDBM_verts_mirror_cache_begin(struct BMEditMesh *em, const bool use_self, const bool use_select); +void EDBM_verts_mirror_cache_begin(struct BMEditMesh *em, const int axis, + const bool use_self, const bool use_select); void EDBM_verts_mirror_apply(struct BMEditMesh *em, const int sel_from, const int sel_to); struct BMVert *EDBM_verts_mirror_get(struct BMEditMesh *em, struct BMVert *v); void EDBM_verts_mirror_cache_clear(struct BMEditMesh *em, struct BMVert *v); diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index e14dd484ad3..77b91365535 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -92,7 +92,7 @@ void EDBM_select_mirrored(BMEditMesh *em, bool extend, } } - EDBM_verts_mirror_cache_begin(em, true, true); + EDBM_verts_mirror_cache_begin(em, 0, true, true); if (!extend) EDBM_flag_disable_all(em, BM_ELEM_SELECT); diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 3581902e29e..56f70b73a16 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -1121,7 +1121,7 @@ static int edbm_do_smooth_vertex_exec(bContext *C, wmOperator *op) /* mirror before smooth */ if (((Mesh *)obedit->data)->editflag & ME_EDIT_MIRROR_X) { - EDBM_verts_mirror_cache_begin(em, false, true); + EDBM_verts_mirror_cache_begin(em, 0, false, true); } /* if there is a mirror modifier with clipping, flag the verts that @@ -1212,7 +1212,7 @@ static int edbm_do_smooth_laplacian_vertex_exec(bContext *C, wmOperator *op) /* mirror before smooth */ if (((Mesh *)obedit->data)->editflag & ME_EDIT_MIRROR_X) { - EDBM_verts_mirror_cache_begin(em, false, true); + EDBM_verts_mirror_cache_begin(em, 0, false, true); } repeat = RNA_int_get(op->ptr, "repeat"); diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index 963b9cf134b..f3540fe62b7 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -1155,7 +1155,7 @@ static BMVert *cache_mirr_intptr_as_bmvert(intptr_t *index_lookup, int index) * \param maxdist Distance for close point test. * \param r_index Optional array to write into, as an alternative to a customdata layer (length of total verts). */ -void EDBM_verts_mirror_cache_begin_ex(BMEditMesh *em, const bool use_self, const bool use_select, +void EDBM_verts_mirror_cache_begin_ex(BMEditMesh *em, const int axis, const bool use_self, const bool use_select, /* extra args */ const bool is_topo, float maxdist, int *r_index) { @@ -1212,7 +1212,9 @@ void EDBM_verts_mirror_cache_begin_ex(BMEditMesh *em, const bool use_self, const v_mirr = cache_mirr_intptr_as_bmvert(mesh_topo_store.index_lookup, i); } else { - float co[3] = {-v->co[0], v->co[1], v->co[2]}; + float co[3]; + copy_v3_v3(co, v->co); + co[axis] *= -1.0f; v_mirr = BKE_bmbvh_find_vert_closest(tree, co, maxdist); } @@ -1239,14 +1241,16 @@ void EDBM_verts_mirror_cache_begin_ex(BMEditMesh *em, const bool use_self, const } } -void EDBM_verts_mirror_cache_begin(BMEditMesh *em, const bool use_self, const bool use_select) +void EDBM_verts_mirror_cache_begin(BMEditMesh *em, const int axis, + const bool use_self, const bool use_select) { Mesh *me = (Mesh *)em->ob->data; bool is_topo; is_topo = (me && (me->editflag & ME_EDIT_MIRROR_TOPO)); - EDBM_verts_mirror_cache_begin_ex(em, use_self, use_select, + EDBM_verts_mirror_cache_begin_ex(em, axis, + use_self, use_select, /* extra args */ is_topo, BM_SEARCH_MAXDIST_MIRR, NULL); } diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 8da953c4f84..d38f4048572 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -2170,7 +2170,7 @@ void ED_vgroup_mirror(Object *ob, goto cleanup; } - EDBM_verts_mirror_cache_begin(em, true, false); + EDBM_verts_mirror_cache_begin(em, 0, true, false); /* Go through the list of editverts and assign them */ BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) { diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index ac5727a116c..d1b57e2e402 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -2020,7 +2020,7 @@ static void createTransEditVerts(TransInfo *t) int cd_vert_bweight_offset = -1; if (t->flag & T_MIRROR) { - EDBM_verts_mirror_cache_begin(em, false, true); + EDBM_verts_mirror_cache_begin(em, 0, false, true); mirror = 1; } |