[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41348] branches/soc-2011-onion-uv-tools/ source/blender/editors/uvedit/uvedit_ops.c: smart stitching

Antony Riakiotakis kalast at gmail.com
Fri Oct 28 20:59:34 CEST 2011


Revision: 41348
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41348
Author:   psy-fi
Date:     2011-10-28 18:59:33 +0000 (Fri, 28 Oct 2011)
Log Message:
-----------
smart stitching
================
*fix name collision in exit function
*User selection now takes care that only one of uv's common to a vertex is selected, even if user has selected multiple.

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-28 18:46:50 UTC (rev 41347)
+++ branches/soc-2011-onion-uv-tools/source/blender/editors/uvedit/uvedit_ops.c	2011-10-28 18:59:33 UTC (rev 41348)
@@ -3039,11 +3039,7 @@
 					int uniqueIndex;
 					UvElement *element = get_uv_element(stitch_state->elementMap, efa, i);
 					uniqueIndex = stitch_state->map[element - stitch_state->elementMap->buf];
-					/* count a uv only once, or duplicates will happen */
-					if(!(stitch_state->uvs[uniqueIndex]->flag & STITCH_SELECTED)){
-						stitch_state->selection_stack[stitch_state->selection_size++] = stitch_state->uvs[uniqueIndex];
-						stitch_state->uvs[uniqueIndex]->flag |= STITCH_SELECTED;
-					}
+					stitch_select_uv(element, stitch_state, stitch_state->selection_stack, &stitch_state->selection_size, 1);
 				}
 			}
 		}
@@ -3108,7 +3104,7 @@
 				RNA_int_set(&itemptr, "face_index", element->face->tmp.l);
 				RNA_int_set(&itemptr, "element_index", element->tfindex);
 			}else{
-				char finished = 0;
+				char matchfound = 0;
 				UvEdge *edge = (UvEdge *)stitch_state->selection_stack[i];
 				UvElement *element1 = stitch_state->uvs[edge->uv1];
 				UvElement *element2 = stitch_state->uvs[edge->uv2];
@@ -3126,14 +3122,14 @@
 					if(uniqueIndex == edge->uv2){
 						RNA_int_set(&itemptr, "face_index", element_iter->face->tmp.l);
 						RNA_int_set(&itemptr, "element_index", element_iter->tfindex);
-						finished = 1;
+						matchfound = 1;
 						break;
 					}
 
 					element_iter = element_iter->next;
 				}while(element_iter && !element_iter->separate);
 
-				if(finished)
+				if(matchfound)
 					continue;
 
 				element_iter = element2;
@@ -3149,14 +3145,14 @@
 					if(uniqueIndex == edge->uv1){
 						RNA_int_set(&itemptr, "face_index", element_iter->face->tmp.l);
 						RNA_int_set(&itemptr, "element_index", element_iter->tfindex);
-						finished = 1;
+						matchfound = 1;
 						break;
 					}
 
 					element_iter = element_iter->next;
 				}while(element_iter && !element_iter->separate);
 
-				if(!finished)
+				if(!matchfound)
 					printf("stitch error, can't find face that includes selected edge\n");
 			}
 		}




More information about the Bf-blender-cvs mailing list