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

Antony Riakiotakis kalast at gmail.com
Thu Jul 21 19:32:50 CEST 2011


Revision: 38575
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38575
Author:   psy-fi
Date:     2011-07-21 17:32:50 +0000 (Thu, 21 Jul 2011)
Log Message:
-----------
smart stitch
============================
-Island snapping for final calculation calculation fixed and works like a charm. N'joy :)

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

Modified: branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_ops.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_ops.c	2011-07-21 17:21:20 UTC (rev 38574)
+++ branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_ops.c	2011-07-21 17:32:50 UTC (rev 38575)
@@ -1886,6 +1886,15 @@
 
 	if(final)
 	{
+		/* First we need to calculate island rotation because in final calculation we tweak UV's directly, thus altering the results. */
+		if(state->snapIslands){
+			for(element = vmap->buf, i = 0; i < state->vmap->numOfUVs; element++, i++){
+				if(element->flag & STITCH_EDGE_STITCHABLE){
+					stitch_island_calculate_rotation(element, i, state, uv_average, island_stitch_data);
+				}
+			}
+		}
+
 		for(element = vmap->buf, i = 0; i < state->vmap->numOfUVs; element++, i++){
 			if(element->flag & STITCH_STITCHABLE){
 				float uv[2];
@@ -1900,10 +1909,6 @@
 					island_stitch_data[element->island].translation[0] += uv[0] - mt->uv[element->tfindex][0];
 					island_stitch_data[element->island].translation[1] += uv[1] - mt->uv[element->tfindex][1];
 					island_stitch_data[element->island].numOfElements++;
-
-					if(element->flag & STITCH_EDGE_STITCHABLE){
-						stitch_island_calculate_rotation(element, i, state, uv_average, island_stitch_data);
-					}
 				}
 
 				mt->uv[element->tfindex][0] = uv[0];




More information about the Bf-blender-cvs mailing list