Revision: 38627
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38627
Author:   psy-fi
Date:     2011-07-22 22:11:52 +0000 (Fri, 22 Jul 2011)
Log Message:
-----------
smart stitch
============================
- smart stitch: Hoping this is the last bug to squash in stitch operator (yeah, 
right :) ). Edge seaming would fail sometimes if uv was shared by different 
stitchable islands.

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-22 21:57:04 UTC (rev 38626)
+++ branches/soc-2011-onion/source/blender/editors/uvedit/uvedit_ops.c  
2011-07-22 22:11:52 UTC (rev 38627)
@@ -1698,40 +1698,55 @@
                                                }
                                                if(element->flag & 
STITCH_STITCHABLE &&
                                                element2->flag & 
STITCH_STITCHABLE){
+                                                       
uv_average[index1].count += uv_average_tmp[0].count;
+                                                       
uv_average[index1].uv[0] += uv_average_tmp[0].uv[0];
+                                                       
uv_average[index1].uv[1] += uv_average_tmp[0].uv[1];
 
+                                                       
uv_average[index2].count += uv_average_tmp[1].count;
+                                                       
uv_average[index2].uv[0] += uv_average_tmp[1].uv[0];
+                                                       
uv_average[index2].uv[1] += uv_average_tmp[1].uv[1];
+
                                                        /* update uv's on the 
update stack */
                                                        for(stack_iter = 0; 
stack_iter < stackSize1; stack_iter++){
-                                                               index1 = 
commonVertMaps[stack_iter] - vmap->buf,
-                                                               efa = 
commonVertMaps[stack_iter]->face;
-
                                                                
commonVertMaps[stack_iter]->flag |= STITCH_STITCHABLE;
+                                                       }
+                                                       for(stack_iter = 0; 
stack_iter < stackSize2; stack_iter++){
+                                                               
commonVertMaps2[stack_iter]->flag |= STITCH_STITCHABLE;
+                                                       }
 
-                                                               
uv_average[index1].count += uv_average_tmp[0].count;
-                                                               
uv_average[index1].uv[0] += uv_average_tmp[0].uv[0];
-                                                               
uv_average[index1].uv[1] += uv_average_tmp[0].uv[1];
+                                                       for(el_iter = 
vmap->vert[v1->tmp.l]; el_iter; el_iter = el_iter->next){
+                                                               
if(el_iter->flag & STITCH_STITCHABLE){
+                                                                       int 
index = el_iter - vmap->buf;
+                                                                       efa = 
el_iter->face;
 
-                                                               
if(state->snapIslands){
-                                                                       
island_stitch_data[commonVertMaps[stack_iter]->island].addedForPreview = 1;
+                                                                       
uv_average[index].count = uv_average[index1].count;
+                                                                       
uv_average[index].uv[0] = uv_average[index1].uv[0];
+                                                                       
uv_average[index].uv[1] = uv_average[index1].uv[1];
+
+                                                                       
if(state->snapIslands){
+                                                                               
island_stitch_data[el_iter->island].addedForPreview = 1;
+                                                                       }
+                                                                       else {
+                                                                               
stitch_update_face_preview_index(efa, preview);
+                                                                       }
                                                                }
-                                                               else {
-                                                                       
stitch_update_face_preview_index(efa, preview);
-                                                               }
                                                        }
-                                                       for(stack_iter = 0; 
stack_iter < stackSize2; stack_iter++){
-                                                               index2 = 
commonVertMaps2[stack_iter] - vmap->buf;
-                                                               efa = 
commonVertMaps2[stack_iter]->face;
+                                                       for(el_iter = 
vmap->vert[v2->tmp.l]; el_iter; el_iter = el_iter->next){
+                                                               
if(el_iter->flag & STITCH_STITCHABLE){
+                                                                       int 
index = el_iter - vmap->buf;
+                                                                       efa = 
el_iter->face;
 
-                                                               
commonVertMaps2[stack_iter]->flag |= STITCH_STITCHABLE;
+                                                                       
uv_average[index].count = uv_average[index2].count;
+                                                                       
uv_average[index].uv[0] = uv_average[index2].uv[0];
+                                                                       
uv_average[index].uv[1] = uv_average[index2].uv[1];
 
-                                                               
uv_average[index2].count += uv_average_tmp[1].count;
-                                                               
uv_average[index2].uv[0] += uv_average_tmp[1].uv[0];
-                                                               
uv_average[index2].uv[1] += uv_average_tmp[1].uv[1];
-                                                               
if(state->snapIslands){
-                                                                       
island_stitch_data[commonVertMaps2[stack_iter]->island].addedForPreview = 1;
+                                                                       
if(state->snapIslands){
+                                                                               
island_stitch_data[el_iter->island].addedForPreview = 1;
+                                                                       }
+                                                                       else {
+                                                                               
stitch_update_face_preview_index(efa, preview);
+                                                                       }
                                                                }
-                                                               else {
-                                                                       
stitch_update_face_preview_index(efa, preview);
-                                                               }
                                                        }
                                                }
                                                MEM_freeN(commonVertMaps2);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to