[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40229] branches/soc-2011-onion-uv-tools/ source/blender/editors/uvedit/uvedit_ops.c: Add vertices for processing to stitch without selection flag changes.
Antony Riakiotakis
kalast at gmail.com
Thu Sep 15 15:19:11 CEST 2011
Revision: 40229
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40229
Author: psy-fi
Date: 2011-09-15 13:19:11 +0000 (Thu, 15 Sep 2011)
Log Message:
-----------
Add vertices for processing to stitch without selection flag changes.
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-09-15 13:17:04 UTC (rev 40228)
+++ branches/soc-2011-onion-uv-tools/source/blender/editors/uvedit/uvedit_ops.c 2011-09-15 13:19:11 UTC (rev 40229)
@@ -1317,15 +1317,17 @@
/*
* defines for UvElement flags
*/
+#ifndef STITCHNEW
#define STITCH_PROCESSED 1
#define STITCH_STITCHABLE 2
#define STITCH_EDGE_PREVIEW 4
#define STITCH_EDGE_STITCHABLE 8
#define STITCH_USE_FOR_STITCHING 16
#define STITCH_DO_UPDATE 32
-
+#else
#define STITCH_SELECTED 1
-
+#define STITCH_STITCHABLE 2
+#endif
/* Previewer stuff (see uvedit_intern.h for more info) */
static StitchPreviewer *_stitch_preview;
@@ -2230,7 +2232,7 @@
for(i = 0; i < state->selection_size; i++){
if(determine_uv_stitchability(state->selection_stack[i], state)){
UvElement *element_iter, *element = (UvElement *)state->selection_stack[i];
- element->flag = STITCH_STITCHABLE;
+ element->flag |= STITCH_STITCHABLE;
for(element_iter = element; element_iter; element_iter = element_iter->next){
if(element_iter->separate && element_iter != element)
break;
@@ -2255,7 +2257,7 @@
/* Fill the preview buffers with stitchable only faces */
for(i = 0; i < state->selection_size; i++){
UvElement *element = (UvElement *)state->selection_stack[i];
- if(element->flag == STITCH_STITCHABLE){
+ if(element->flag & STITCH_STITCHABLE){
UvElement *element_iter = element;
for(element_iter = element; element_iter; element_iter = element_iter->next){
if(element_iter->separate && element_iter != element)
@@ -2540,7 +2542,30 @@
* becomes dependent on the order of stitching different uv's corresponding to the same vertex */
if(stitch_state->mode == VERT_STITCH)
{
+ #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);
+ 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;
+ 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;
+ }
+ }
+ }
+ }else{
+ 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;
for(; element; element = element->next)
@@ -2572,7 +2597,7 @@
uvedit_uv_deselect(scene, element->face, tface, element->tfindex);
}
}
-
+ #endif
}
else
{
More information about the Bf-blender-cvs
mailing list