[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57589] trunk/blender/source/blender/ editors: add axis option to EDBM_verts_mirror_cache_begin

Campbell Barton ideasman42 at gmail.com
Wed Jun 19 23:23:01 CEST 2013


Revision: 57589
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57589
Author:   campbellbarton
Date:     2013-06-19 21:23:00 +0000 (Wed, 19 Jun 2013)
Log Message:
-----------
add axis option to EDBM_verts_mirror_cache_begin

Modified Paths:
--------------
    trunk/blender/source/blender/editors/include/ED_mesh.h
    trunk/blender/source/blender/editors/mesh/editmesh_select.c
    trunk/blender/source/blender/editors/mesh/editmesh_tools.c
    trunk/blender/source/blender/editors/mesh/editmesh_utils.c
    trunk/blender/source/blender/editors/object/object_vgroup.c
    trunk/blender/source/blender/editors/transform/transform_conversions.c

Modified: trunk/blender/source/blender/editors/include/ED_mesh.h
===================================================================
--- trunk/blender/source/blender/editors/include/ED_mesh.h	2013-06-19 20:43:38 UTC (rev 57588)
+++ trunk/blender/source/blender/editors/include/ED_mesh.h	2013-06-19 21:23:00 UTC (rev 57589)
@@ -76,9 +76,11 @@
 
 
 /* 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);

Modified: trunk/blender/source/blender/editors/mesh/editmesh_select.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_select.c	2013-06-19 20:43:38 UTC (rev 57588)
+++ trunk/blender/source/blender/editors/mesh/editmesh_select.c	2013-06-19 21:23:00 UTC (rev 57589)
@@ -92,7 +92,7 @@
 		}
 	}
 
-	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);

Modified: trunk/blender/source/blender/editors/mesh/editmesh_tools.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_tools.c	2013-06-19 20:43:38 UTC (rev 57588)
+++ trunk/blender/source/blender/editors/mesh/editmesh_tools.c	2013-06-19 21:23:00 UTC (rev 57589)
@@ -1121,7 +1121,7 @@
 
 	/* 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 @@
 
 	/* 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");

Modified: trunk/blender/source/blender/editors/mesh/editmesh_utils.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_utils.c	2013-06-19 20:43:38 UTC (rev 57588)
+++ trunk/blender/source/blender/editors/mesh/editmesh_utils.c	2013-06-19 21:23:00 UTC (rev 57589)
@@ -1155,7 +1155,7 @@
  * \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 @@
 				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(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);
 }

Modified: trunk/blender/source/blender/editors/object/object_vgroup.c
===================================================================
--- trunk/blender/source/blender/editors/object/object_vgroup.c	2013-06-19 20:43:38 UTC (rev 57588)
+++ trunk/blender/source/blender/editors/object/object_vgroup.c	2013-06-19 21:23:00 UTC (rev 57589)
@@ -2170,7 +2170,7 @@
 				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) {

Modified: trunk/blender/source/blender/editors/transform/transform_conversions.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform_conversions.c	2013-06-19 20:43:38 UTC (rev 57588)
+++ trunk/blender/source/blender/editors/transform/transform_conversions.c	2013-06-19 21:23:00 UTC (rev 57589)
@@ -2020,7 +2020,7 @@
 	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;
 	}
 




More information about the Bf-blender-cvs mailing list