[Bf-blender-cvs] [d920b8e] master: Fix T44530 UV islands fail on subsurf after mirror modifier.

Antony Riakiotakis noreply at git.blender.org
Tue Apr 28 11:18:19 CEST 2015


Commit: d920b8e075ed949bd21297bb3baa4a8cb22428c9
Author: Antony Riakiotakis
Date:   Tue Apr 28 11:12:47 2015 +0200
Branches: master
https://developer.blender.org/rBd920b8e075ed949bd21297bb3baa4a8cb22428c9

Fix T44530 UV islands fail on subsurf after mirror modifier.

Caused by own commit that changed island detection code. In the case of
modifiers we don't want to take winding information into account, but
left the code since there are use cases (like painting) which could use
this.

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

M	source/blender/blenkernel/BKE_mesh_mapping.h
M	source/blender/blenkernel/intern/mesh_mapping.c
M	source/blender/blenkernel/intern/subsurf_ccg.c

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

diff --git a/source/blender/blenkernel/BKE_mesh_mapping.h b/source/blender/blenkernel/BKE_mesh_mapping.h
index da44c98..dcf5d2e 100644
--- a/source/blender/blenkernel/BKE_mesh_mapping.h
+++ b/source/blender/blenkernel/BKE_mesh_mapping.h
@@ -102,7 +102,7 @@ typedef struct MeshElemMap {
 /* mapping */
 UvVertMap *BKE_mesh_uv_vert_map_create(
         struct MPoly *mpoly, struct MLoop *mloop, struct MLoopUV *mloopuv,
-        unsigned int totpoly, unsigned int totvert, int selected, float *limit);
+        unsigned int totpoly, unsigned int totvert, int selected, float *limit, bool use_winding);
 UvMapVert *BKE_mesh_uv_vert_map_get_vert(UvVertMap *vmap, unsigned int v);
 void       BKE_mesh_uv_vert_map_free(UvVertMap *vmap);
 
diff --git a/source/blender/blenkernel/intern/mesh_mapping.c b/source/blender/blenkernel/intern/mesh_mapping.c
index ebdbd3a..cc5006e 100644
--- a/source/blender/blenkernel/intern/mesh_mapping.c
+++ b/source/blender/blenkernel/intern/mesh_mapping.c
@@ -55,7 +55,7 @@
  * but for now this replaces it because its unused. */
 
 UvVertMap *BKE_mesh_uv_vert_map_create(struct MPoly *mpoly, struct MLoop *mloop, struct MLoopUV *mloopuv,
-                                       unsigned int totpoly, unsigned int totvert, int selected, float *limit)
+                                       unsigned int totpoly, unsigned int totvert, int selected, float *limit, bool use_winding)
 {
 	UvVertMap *vmap;
 	UvMapVert *buf;
@@ -109,7 +109,10 @@ UvVertMap *BKE_mesh_uv_vert_map_create(struct MPoly *mpoly, struct MLoop *mloop,
 				buf++;
 			}
 
-			winding[a] = cross_poly_v2((const float (*)[2])tf_uv, (unsigned int)nverts) > 0;
+			if (use_winding)
+				winding[a] = cross_poly_v2((const float (*)[2])tf_uv, (unsigned int)nverts) > 0;
+			else
+				winding[a] = 0;
 		}
 	}
 
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index a4e0eaa..f81d582 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -300,7 +300,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
 	float uv[3] = {0.0f, 0.0f, 0.0f}; /* only first 2 values are written into */
 
 	limit[0] = limit[1] = STD_UV_CONNECT_LIMIT;
-	vmap = BKE_mesh_uv_vert_map_create(mpoly, mloop, mloopuv, totface, totvert, 0, limit);
+	vmap = BKE_mesh_uv_vert_map_create(mpoly, mloop, mloopuv, totface, totvert, 0, limit, false);
 	if (!vmap)
 		return 0;




More information about the Bf-blender-cvs mailing list