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

Antony Riakiotakis kalast at gmail.com
Thu Jan 5 18:39:42 CET 2012


Revision: 43176
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43176
Author:   psy-fi
Date:     2012-01-05 17:39:30 +0000 (Thu, 05 Jan 2012)
Log Message:
-----------
smart stitch
==============
-fix bug where uvs can erroneously be tagged as unstitchable.

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

Modified: branches/soc-2011-onion-uv-tools/source/blender/editors/uvedit/uvedit_smart_stitch.c
===================================================================
--- branches/soc-2011-onion-uv-tools/source/blender/editors/uvedit/uvedit_smart_stitch.c	2012-01-05 17:02:20 UTC (rev 43175)
+++ branches/soc-2011-onion-uv-tools/source/blender/editors/uvedit/uvedit_smart_stitch.c	2012-01-05 17:39:30 UTC (rev 43176)
@@ -481,40 +481,39 @@
 
 /* registers uvs so that they can be shown in preview */
 static void stitch_setup_preview_for_stitchable_uv(UvElement *element, StitchState *state, IslandStitchData *island_stitch_data){
-	StitchPreviewer *preview = uv_get_stitch_previewer();
+	UvElement *element_iter;
+	StitchPreviewer *preview;
 
-	UvElement *element_iter = state->element_map->vert[(*(&element->face->v1 + element->tfindex))->tmp.l];
+	if(element->flag & STITCH_STITCHABLE){
+		return;
+	}
+
+	preview = uv_get_stitch_previewer();
+	element_iter = state->element_map->vert[(*(&element->face->v1 + element->tfindex))->tmp.l];
+
 	for(; element_iter; element_iter = element_iter->next){
 		if(element_iter->separate){
+			if(element_iter == element)
+				continue;
 			if(state->use_limit){
 				MTFace *mtface_orig = CustomData_em_get(&state->em->fdata, element->face->data, CD_MTFACE);
 				MTFace *mtface_iter = CustomData_em_get(&state->em->fdata, element_iter->face->data, CD_MTFACE);
 
 				if(fabs(mtface_orig->uv[element->tfindex][0] - mtface_iter->uv[element_iter->tfindex][0]) < state->limit_dist
 						&& fabs(mtface_orig->uv[element->tfindex][1] - mtface_iter->uv[element_iter->tfindex][1]) < state->limit_dist){
-					if(((element_iter->island == state->static_island) || (element->island == state->static_island))
-							&& !(element_iter->flag & STITCH_STITCHABLE)){
-						element_iter->flag |= STITCH_STITCHABLE;
+					if((element_iter->island == state->static_island) || (element->island == state->static_island)){
+						element->flag |= STITCH_STITCHABLE;
 						preview->num_stitchable++;
-						stitch_setup_face_preview_for_uv_group(element_iter, state, island_stitch_data);
-						if(!(element->flag & STITCH_STITCHABLE)){
-							element->flag |= STITCH_STITCHABLE;
-							preview->num_stitchable++;
-							stitch_setup_face_preview_for_uv_group(element, state, island_stitch_data);
-						}
+						stitch_setup_face_preview_for_uv_group(element, state, island_stitch_data);
+						return;
 					}
 				}
 			}else{
-				if(((element_iter->island == state->static_island) || (element->island == state->static_island))
-						&& !(element_iter->flag & STITCH_STITCHABLE)){
-					element_iter->flag |= STITCH_STITCHABLE;
+				if((element_iter->island == state->static_island) || (element->island == state->static_island)){
+					element->flag |= STITCH_STITCHABLE;
 					preview->num_stitchable++;
-					stitch_setup_face_preview_for_uv_group(element_iter, state, island_stitch_data);
-					if(!(element->flag & STITCH_STITCHABLE)){
-						element->flag |= STITCH_STITCHABLE;
-						preview->num_stitchable++;
-						stitch_setup_face_preview_for_uv_group(element, state, island_stitch_data);
-					}
+					stitch_setup_face_preview_for_uv_group(element, state, island_stitch_data);
+					return;
 				}
 			}
 		}



More information about the Bf-blender-cvs mailing list