[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41107] branches/soc-2011-onion-uv-tools/ source/blender/editors/uvedit/uvedit_ops.c: correct fix for previous fix

Antony Riakiotakis kalast at gmail.com
Tue Oct 18 21:49:56 CEST 2011


Revision: 41107
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41107
Author:   psy-fi
Date:     2011-10-18 19:49:55 +0000 (Tue, 18 Oct 2011)
Log Message:
-----------
correct fix for previous fix

Modified Paths:
--------------
    branches/soc-2011-onion-uv-tools/source/blender/editors/uvedit/uvedit_ops.c

Modified: branches/soc-2011-onion-uv-tools/source/blender/editors/uvedit/uvedit_ops.c
===================================================================
--- branches/soc-2011-onion-uv-tools/source/blender/editors/uvedit/uvedit_ops.c	2011-10-18 19:13:36 UTC (rev 41106)
+++ branches/soc-2011-onion-uv-tools/source/blender/editors/uvedit/uvedit_ops.c	2011-10-18 19:49:55 UTC (rev 41107)
@@ -2703,43 +2703,43 @@
 
 	/* Now, on to generate our uv connectivity data */
 	for(efa = stitch_state->em->faces.first, counter = 0; efa; efa = efa->next){
-		int nverts;
+		if((ts->uv_flag & UV_SYNC_SELECTION) || (!efa->h && efa->f & SELECT)){
+			int nverts = efa->v4 ? 4 : 3;
 
-		if(!(ts->uv_flag & UV_SYNC_SELECTION) || (!efa->h && efa->f & SELECT))
-			continue;
-		nverts = efa->v4 ? 4 : 3;
-		for(i = 0; i < nverts; i++){
-			int offset1, itmp1 = get_uv_element(stitch_state->elementMap, efa, i) - stitch_state->elementMap->buf;
-			int offset2, itmp2 = get_uv_element(stitch_state->elementMap, efa, (i+1)%nverts) - stitch_state->elementMap->buf;
+			for(i = 0; i < nverts; i++){
+				int offset1, itmp1 = get_uv_element(stitch_state->elementMap, efa, i) - stitch_state->elementMap->buf;
+				int offset2, itmp2 = get_uv_element(stitch_state->elementMap, efa, (i+1)%nverts) - stitch_state->elementMap->buf;
 
-			offset1 = stitch_state->map[itmp1];
-			offset2 = stitch_state->map[itmp2];
+				offset1 = stitch_state->map[itmp1];
+				offset2 = stitch_state->map[itmp2];
 
-			edges[counter].flag = 0;
-			/* using an order policy, sort uvs according to address space. This avoids
-			 * Having two different UvEdges with the same uvs on different positions  */
-			if(offset1 < offset2){
-				edges[counter].uv1 = offset1;
-				edges[counter].uv2 = offset2;
+				edges[counter].flag = 0;
+				/* using an order policy, sort uvs according to address space. This avoids
+				 * Having two different UvEdges with the same uvs on different positions  */
+				if(offset1 < offset2){
+					edges[counter].uv1 = offset1;
+					edges[counter].uv2 = offset2;
+				}
+				else{
+					edges[counter].uv1 = offset2;
+					edges[counter].uv2 = offset1;
+				}
+				/* Hack! Set the value of the key to its flag. Now we can set the flag when an edge exists twice :) */
+				if(BLI_ghash_haskey(stitch_state->edgeHash, &edges[counter])){
+					char *flag = BLI_ghash_lookup(stitch_state->edgeHash, &edges[counter]);
+					*flag = 0;
+				}
+				else{
+					/* Hack mentioned */
+					BLI_ghash_insert(stitch_state->edgeHash, &edges[counter], &(edges[counter].flag));
+					edges[counter].flag = STITCH_BOUNDARY;
+				}
+				counter++;
 			}
-			else{
-				edges[counter].uv1 = offset2;
-				edges[counter].uv2 = offset1;
-			}
-			/* Hack! Set the value of the key to its flag. Now we can set the flag when an edge exists twice :) */
-			if(BLI_ghash_haskey(stitch_state->edgeHash, &edges[counter])){
-				char *flag = BLI_ghash_lookup(stitch_state->edgeHash, &edges[counter]);
-				*flag = 0;
-			}
-			else{
-				/* Hack mentioned */
-				BLI_ghash_insert(stitch_state->edgeHash, &edges[counter], &(edges[counter].flag));
-				edges[counter].flag = STITCH_BOUNDARY;
-			}
-			counter++;
 		}
 	}
 
+
 	ghi = BLI_ghashIterator_new(stitch_state->edgeHash);
 	stitch_state->edges = MEM_mallocN(sizeof(*stitch_state->edges)*BLI_ghash_size(stitch_state->edgeHash), "stitch_edges");
 	if(!ghi || !stitch_state->edges){




More information about the Bf-blender-cvs mailing list