[Bf-blender-cvs] [2c00ecc] master: Code cleanup: use macro to find vertex in face

Campbell Barton noreply at git.blender.org
Tue Apr 1 01:09:19 CEST 2014


Commit: 2c00ecc738c04dc5dc22d4a6b81a1e937526ba6d
Author: Campbell Barton
Date:   Tue Apr 1 10:08:54 2014 +1100
https://developer.blender.org/rB2c00ecc738c04dc5dc22d4a6b81a1e937526ba6d

Code cleanup: use macro to find vertex in face

===================================================================

M	source/blender/editors/sculpt_paint/paint_image_proj.c

===================================================================

diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index bbe99b9..488e00e 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -68,6 +68,7 @@
 #include "BKE_library.h"
 #include "BKE_main.h"
 #include "BKE_mesh.h"
+#include "BKE_mesh_mapping.h"
 #include "BKE_node.h"
 #include "BKE_object.h"
 #include "BKE_paint.h"
@@ -897,21 +898,16 @@ static bool check_seam(const ProjPaintState *ps,
 
 			/* We need to know the order of the verts in the adjacent face
 			 * set the i1_fidx and i2_fidx to (0,1,2,3) */
-			if      (mf->v1 == i1) i1_fidx = 0;
-			else if (mf->v2 == i1) i1_fidx = 1;
-			else if (mf->v3 == i1) i1_fidx = 2;
-			else if (mf->v4 && mf->v4 == i1) i1_fidx = 3;
-
-			if      (mf->v1 == i2) i2_fidx = 0;
-			else if (mf->v2 == i2) i2_fidx = 1;
-			else if (mf->v3 == i2) i2_fidx = 2;
-			else if (mf->v4 && mf->v4 == i2) i2_fidx = 3;
+			i1_fidx = BKE_MESH_TESSFACE_VINDEX_ORDER(mf, i1);
+			i2_fidx = BKE_MESH_TESSFACE_VINDEX_ORDER(mf, i2);
 
 			/* Only need to check if 'i2_fidx' is valid because we know i1_fidx is the same vert on both faces */
 			if (i2_fidx != -1) {
 				Image *tpage = project_paint_face_image(ps, ps->dm_mtface, face_index);
 				Image *orig_tpage = project_paint_face_image(ps, ps->dm_mtface, orig_face);
 
+				BLI_assert(i1_fidx != -1);
+
 				/* This IS an adjacent face!, now lets check if the UVs are ok */
 				tf = ps->dm_mtface + face_index;




More information about the Bf-blender-cvs mailing list