Index: source/blender/include/BDR_editface.h =================================================================== --- source/blender/include/BDR_editface.h (revision 11061) +++ source/blender/include/BDR_editface.h (working copy) @@ -55,6 +55,7 @@ void set_faceselect(void); void set_texturepaint(void); void get_same_uv(void); +void select_from_uv_selection(void); void seam_mark_clear_tface(short mode); #endif /* BDR_EDITFACE_H */ Index: source/blender/src/editface.c =================================================================== --- source/blender/src/editface.c (revision 11061) +++ source/blender/src/editface.c (working copy) @@ -1699,3 +1699,37 @@ object_tface_flags_changed(OBACT, 0); } +void select_from_uv_selection(void) +{ + Mesh *me; + MTFace *tface; + MFace *mface; + int a, desel; + + me= get_mesh(OBACT); + if(me==0 || me->mtface==0) return; + + tface= me->mtface; + mface= me->mface; + + for(a=0; atotface; a++, mface++, tface++) { + if(mface->flag & ME_FACE_SEL) { + desel= 1; + + if((tface->flag & TF_SEL1) && + (tface->flag & TF_SEL2) && + (tface->flag & TF_SEL3)) { + if(mface->v4) { + if(tface->flag & TF_SEL4) desel= 0; + } + else desel= 0; + } + + if(desel) mface->flag &= ~ME_FACE_SEL; + } + } + + BIF_undo_push("Select from UV selection"); + + object_tface_flags_changed(OBACT, 0); +} Index: source/blender/src/header_view3d.c =================================================================== --- source/blender/src/header_view3d.c (revision 11061) +++ source/blender/src/header_view3d.c (working copy) @@ -1380,8 +1380,8 @@ void do_view3d_select_faceselmenu(void *arg, int event) { - /* events >= 6 are registered bpython scripts */ - if (event >= 6) BPY_menu_do_python(PYMENU_FACESELECT, event - 6); + /* events >= 7 are registered bpython scripts */ + if (event >= 7) BPY_menu_do_python(PYMENU_FACESELECT, event - 7); switch(event) { case 0: /* border select */ @@ -1399,6 +1399,9 @@ case 5: /* Select Linked */ select_linked_tfaces(2); break; + case 6: /* From UV Selection */ + select_from_uv_selection(); + break; } allqueue(REDRAWVIEW3D, 0); } @@ -1420,6 +1423,7 @@ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Same UV", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "From UV Selection", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Linked Faces|Ctrl L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); Index: source/blender/src/toolbox.c =================================================================== --- source/blender/src/toolbox.c (revision 11061) +++ source/blender/src/toolbox.c (working copy) @@ -913,6 +913,7 @@ { 0, "Select/Deselect All|A", 2, NULL}, { 0, "Inverse", 3, NULL}, { 0, "Same UV", 4, NULL}, +{ 0, "From UV Selection", 6, NULL}, { 0, "SEPR", 0, NULL}, { 0, "Linked Faces|Ctrl L", 5, NULL}, { -1, "", 0, do_view3d_select_faceselmenu}};