[Bf-blender-cvs] [6380451] soc-2016-uv_tools: Bugfix for No Fit Polygon placement

Phil Gosch noreply at git.blender.org
Sat Jul 9 11:12:35 CEST 2016


Commit: 6380451f4b8f55f582a2f25903b2179f8bf006be
Author: Phil Gosch
Date:   Sat Jul 9 11:12:06 2016 +0200
Branches: soc-2016-uv_tools
https://developer.blender.org/rB6380451f4b8f55f582a2f25903b2179f8bf006be

Bugfix for No Fit Polygon placement

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

M	source/blender/editors/uvedit/uvedit_parametrizer.c

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

diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c
index 93fc4e9..bc9f520 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.c
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.c
@@ -5048,9 +5048,9 @@ PNoFitPolygon *p_no_fit_polygon_create(PConvexHull *item, PConvexHull *fixed)
 	/* Minkowski sum computation */
 	printf("PPointUV creation started!\n");
 	PPointUV *p = (PPointUV *)MEM_callocN(sizeof(*p), "PPointUV");
-	p->x = points[0]->uv[0];
-	p->y = points[0]->uv[1];
-	//printf("PPointUV created and assigned!\n");
+	p->x = fixed->h_verts[fixed->ref_vert_index]->uv[0];
+	p->y = fixed->h_verts[fixed->ref_vert_index]->uv[1];
+
 	nfp->final_pos[0] = p;
 	for (j = 1; j < nfp->nverts; j++) {
 		PPointUV *p1 = (PPointUV *)MEM_callocN(sizeof(*p1), "PPointUV1");
@@ -5132,7 +5132,7 @@ bool p_chart_pack_individual(PHandle *phandle,  PChart *item)
 		/*Since placed=false it won't happen, but may be better to make sure? */
 		if (fixed->u.ipack.convex_hull->placed) {
 			PConvexHull *ch_fixed = fixed->u.ipack.convex_hull;
-			PNoFitPolygon *nfp = p_no_fit_polygon_create(ch_item, ch_fixed);
+			PNoFitPolygon *nfp = p_no_fit_polygon_create(item_inv, ch_fixed);
 			nfps[i] = nfp;
 			init = false;
 		}
@@ -5167,8 +5167,8 @@ bool p_chart_pack_individual(PHandle *phandle,  PChart *item)
 
 			if (nfps[rand1]) {
 				if (nfps[rand1]->final_pos[rand2]) {
-					end_pos[0] = nfps[rand1]->final_pos[rand1]->x;
-					end_pos[1] = nfps[rand1]->final_pos[rand1]->y;
+					end_pos[0] = nfps[rand1]->final_pos[rand2]->x;
+					end_pos[1] = nfps[rand1]->final_pos[rand2]->y;
 					found = true;
 				}
 			}




More information about the Bf-blender-cvs mailing list