Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2007-06-10 18:06:34 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2007-06-10 18:06:34 +0400
commitd39d2e72797973fe079ab6e8a7810dbcb2c506b8 (patch)
tree93c8aea1171a5707c0868fb9ca90c71a56cc50e4 /source/blender
parent2393896ceedf34cb30767a8f08e8f216826af478 (diff)
Patch #6717:
Select Inverse function in the UV editor, by Juho Vepsalainen.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/include/BIF_editsima.h1
-rw-r--r--source/blender/src/editsima.c35
-rw-r--r--source/blender/src/header_image.c5
3 files changed, 38 insertions, 3 deletions
diff --git a/source/blender/include/BIF_editsima.h b/source/blender/include/BIF_editsima.h
index 6a67ebc7009..ec274290c91 100644
--- a/source/blender/include/BIF_editsima.h
+++ b/source/blender/include/BIF_editsima.h
@@ -52,6 +52,7 @@ void transform_aspect_ratio_tface_uv(float *aspx, float *aspy);
void borderselect_sima(short whichuvs);
void mouseco_to_curtile(void);
void mouse_select_sima(void);
+void select_invert_tface_uv(void);
void select_swap_tface_uv(void);
void mirrormenu_tface_uv(void);
void mirror_tface_uv(char mirroraxis);
diff --git a/source/blender/src/editsima.c b/source/blender/src/editsima.c
index 40cbe36ac8c..3f257bb848f 100644
--- a/source/blender/src/editsima.c
+++ b/source/blender/src/editsima.c
@@ -430,6 +430,31 @@ void weld_align_menu_tface_uv(void)
else if(mode==2 || mode==3) BIF_undo_push("Align UV");
}
+void select_invert_tface_uv(void)
+{
+ Mesh *me;
+ MTFace *tface;
+ MFace *mface;
+ int a;
+
+ if( is_uv_tface_editing_allowed()==0 ) return;
+ me= get_mesh(OBACT);
+ mface= me->mface;
+
+ for(a=me->totface, tface= me->mtface; a>0; a--, tface++, mface++) {
+ if(mface->flag & ME_FACE_SEL) {
+ tface->flag ^= TF_SEL1;
+ tface->flag ^= TF_SEL2;
+ tface->flag ^= TF_SEL3;
+ if(mface->v4) tface->flag ^= TF_SEL4;
+ }
+ }
+
+ BIF_undo_push("Select Inverse UV");
+
+ allqueue(REDRAWIMAGE, 0);
+}
+
void select_swap_tface_uv(void)
{
Mesh *me;
@@ -1033,10 +1058,14 @@ void reveal_tface_uv(void)
me= get_mesh(OBACT);
mface= me->mface;
- for(a=me->totface, tface= me->mtface; a>0; a--, tface++, mface++)
- if(!(mface->flag & ME_HIDE))
- if(!(mface->flag & ME_FACE_SEL))
+ for(a=me->totface, tface= me->mtface; a>0; a--, tface++, mface++) {
+ if(!(mface->flag & ME_HIDE)) {
+ if(!(mface->flag & ME_FACE_SEL)) {
+ mface->flag |= ME_FACE_SEL;
tface->flag |= (TF_SEL1|TF_SEL2|TF_SEL3|TF_SEL4);
+ }
+ }
+ }
BIF_undo_push("Reveal UV");
diff --git a/source/blender/src/header_image.c b/source/blender/src/header_image.c
index ea0850d77d0..d6878d70165 100644
--- a/source/blender/src/header_image.c
+++ b/source/blender/src/header_image.c
@@ -524,6 +524,9 @@ static void do_image_selectmenu(void *arg, int event)
case 1: /* Select/Deselect All */
select_swap_tface_uv();
break;
+ case 9: /* Select Inverse */
+ select_invert_tface_uv();
+ break;
case 2: /* Unlink Selection */
unlink_selection();
break;
@@ -591,6 +594,8 @@ static uiBlock *image_selectmenu(void *arg_unused)
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
+
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Unlink Selection|Alt L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");