Revision: 40270
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40270
Author:   psy-fi
Date:     2011-09-16 17:28:36 +0000 (Fri, 16 Sep 2011)
Log Message:
-----------
It's again possible to deselect a stitchable vertex even if deselecting its 
stitchable counterpart. Some comment corrections.

Modified Paths:
--------------
    
branches/soc-2011-onion-uv-tools/source/blender/editors/uvedit/uvedit_intern.h
    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_intern.h
===================================================================
--- 
branches/soc-2011-onion-uv-tools/source/blender/editors/uvedit/uvedit_intern.h  
    2011-09-16 17:18:12 UTC (rev 40269)
+++ 
branches/soc-2011-onion-uv-tools/source/blender/editors/uvedit/uvedit_intern.h  
    2011-09-16 17:28:36 UTC (rev 40270)
@@ -55,7 +55,7 @@
        float *previewQuads;
        /* ...and here we'll store the triangles*/
        float *previewTris;
-       /* Preview data.These will be either the previewed vertices or edges 
depending on tool settings */
+       /* Preview data. These will be either the previewed vertices or edges 
depending on stitch mode settings */
        float *previewStitchable;
        float *previewUnstitchable;
        /* here we'll store the number of triangles and quads to be drawn */

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-09-16 17:18:12 UTC (rev 40269)
+++ branches/soc-2011-onion-uv-tools/source/blender/editors/uvedit/uvedit_ops.c 
2011-09-16 17:28:36 UTC (rev 40270)
@@ -2632,29 +2632,32 @@
                                                #ifdef STITCHNEW
                                                int uniqueIndex;
                                                /* This works due to setting of 
tmp in find nearest uv vert */
-                                               UvElement *unique_element, 
*element = get_uv_element(stitch_state->elementMap, hit.efa, hit.uv);
+                                               UvElement *element_iter, 
*unique_element, *element = get_uv_element(stitch_state->elementMap, hit.efa, 
hit.uv);
                                                uniqueIndex = 
stitch_state->map[element - stitch_state->elementMap->buf];
                                                unique_element = 
stitch_state->uvs[uniqueIndex];
-                                               if(event->ctrl){
-                                                       /* remove element from 
selection stack */
-                                                       if(unique_element->flag 
& STITCH_SELECTED){
-                                                               int i;
-                                                               
unique_element->flag &= ~STITCH_SELECTED;
-                                                               for(i = 0; i < 
stitch_state->selection_size; i++){
-                                                                       
if(((UvElement *)stitch_state->selection_stack[i]) == unique_element){
-                                                                               
--stitch_state->selection_size;
-                                                                               
stitch_state->selection_stack[i] = 
stitch_state->selection_stack[stitch_state->selection_size];
-                                                                               
break;
+                                               element_iter = 
stitch_state->elementMap->vert[(*(&hit.efa->v1 + hit.uv))->tmp.l];
+                                               /* first deselect all common 
uvs */
+                                               for(; element_iter; 
element_iter = element_iter->next){
+                                                       
if(element_iter->separate){
+                                                               /* only 
separators go to selection */
+                                                               
if(element_iter->flag & STITCH_SELECTED){
+                                                                       int i;
+                                                                       
element_iter->flag &= ~STITCH_SELECTED;
+                                                                       for(i = 
0; i < stitch_state->selection_size; i++){
+                                                                               
if(((UvElement *)stitch_state->selection_stack[i]) == element_iter){
+                                                                               
        --stitch_state->selection_size;
+                                                                               
        stitch_state->selection_stack[i] = 
stitch_state->selection_stack[stitch_state->selection_size];
+                                                                               
        break;
+                                                                               
}
                                                                        }
                                                                }
                                                        }
-                                               }else{
-                                                       
if(!(unique_element->flag & STITCH_SELECTED)){
-                                                               
unique_element->flag |= STITCH_SELECTED;
-                                                               
stitch_state->selection_stack[stitch_state->selection_size++] = unique_element;
-                                                       }
                                                }
-
+                                               /* Then, if user wants to 
select, simply add the uvelement under mouse */
+                                               if(!event->ctrl && 
!(unique_element->flag & STITCH_SELECTED)){
+                                                       unique_element->flag |= 
STITCH_SELECTED;
+                                                       
stitch_state->selection_stack[stitch_state->selection_size++] = unique_element;
+                                               }
                                                #else
                                                UvElement *element = 
stitch_state->elementMap->vert[(*(&hit.efa->v1 + hit.uv))->tmp.l];
                                                UvElement *firstCoincident;

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

Reply via email to