diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-09-17 22:22:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-09-17 22:22:06 +0400 |
commit | 0c7c57685ec20717f4d5860bc774b52913742e8d (patch) | |
tree | b3f351da8aecc111d019137605d7aee972f46b15 /source/blender/src/header_image.c | |
parent | d1e5c86b76501cef3ad5d5ae70825fc6398d642f (diff) |
New feature for UV/Editmode - 'Sync Mesh Selection' a button in the UV header this mode is disabled by default.
This is implimented by defining macro's that take the mode into account when get/set/checking the selection and that a face can be drawn.
When this is enabled, things work a bit differently
* all faces are drawn in the UV view (except hidden faces).
* selecting faces/verts in the UV window selects them on the mesh also and vice vercer.
* when EditMode (Face only) is enabled, selecting faces in the UV view is not sticky.
* hiding/(de)select all and invert selection simle call the editmesh functions.
* there is no way to select 1 uv corner of 1 face (because a mesh cannot have this as a valid selection) either all UV's that use a vert (sticky), or the whole face.
Diffstat (limited to 'source/blender/src/header_image.c')
-rw-r--r-- | source/blender/src/header_image.c | 48 |
1 files changed, 29 insertions, 19 deletions
diff --git a/source/blender/src/header_image.c b/source/blender/src/header_image.c index 9b20e77dd1a..2b2f194b556 100644 --- a/source/blender/src/header_image.c +++ b/source/blender/src/header_image.c @@ -576,20 +576,25 @@ static uiBlock *image_selectmenu(void *arg_unused) block= uiNewBlock(&curarea->uiblocks, "image_selectmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); uiBlockSetButmFunc(block, do_image_selectmenu, NULL); - - if(G.sima->flag & SI_SELACTFACE) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Active Face Select|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Active Face Select|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(G.sima->flag & SI_LOCALSTICKY) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Stick Local UVs to Mesh Vertex|Shift C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Stick Local UVs to Mesh Vertex|Shift C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - - if(G.sima->flag & SI_STICKYUVS) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Stick UVs to Mesh Vertex|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Stick UVs to Mesh Vertex|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - + + + if ((G.sima->flag & SI_SYNC_UVSEL)==0 || (G.sima->flag & SI_SYNC_UVSEL && (G.scene->selectmode != SCE_SELECT_FACE))) { + if(G.sima->flag & SI_SELACTFACE) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Active Face Select|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Active Face Select|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + } + + if ((G.sima->flag & SI_SYNC_UVSEL)==0) { + if(G.sima->flag & SI_LOCALSTICKY) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Stick Local UVs to Mesh Vertex|Shift C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Stick Local UVs to Mesh Vertex|Shift C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); + + if(G.sima->flag & SI_STICKYUVS) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Stick UVs to Mesh Vertex|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); + else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Stick UVs to Mesh Vertex|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); + + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + } + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select Pinned|Shift B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); @@ -1175,11 +1180,16 @@ void image_buttons(void) xco= std_libbuttons(block, xco, 0, 0, NULL, B_SIMABROWSE, ID_IM, 0, (ID *)ima, 0, &(G.sima->imanr), 0, 0, B_IMAGEDELETE, 0, 0); - /* UV EditMode buttons */ - if (EM_texFaceCheck() && (G.sima->flag & SI_DRAWTOOL)==0) { + /* UV EditMode buttons, not painting or rencering or compositing */ + if ( EM_texFaceCheck() && + (G.sima->flag & SI_DRAWTOOL)==0 && + ((G.sima->image==NULL) || ((G.sima->image->type != IMA_TYPE_R_RESULT) && (G.sima->image->type != IMA_TYPE_COMPOSITE))) + ) { xco+=10; uiDefIconTextButS(block, ICONTEXTROW,B_AROUND, ICON_ROTATE, around_pup(), xco,0,XIC+10,YIC, &(G.v2d->around), 0, 3.0, 0, 0, "Rotation/Scaling Pivot (Hotkeys: Comma, Shift Comma, Period) "); - xco+= XIC+15; + xco+= XIC + 12; + uiDefIconButBitI(block, TOG, SI_SYNC_UVSEL, B_REDR, ICON_MESH_HLT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Sync from mesh selection"); + xco+= XIC+16; } if (ima) { @@ -1207,6 +1217,7 @@ void image_buttons(void) } uiDefIconButBitI(block, TOG, SI_DRAWTOOL, B_SIMAGEPAINTTOOL, ICON_TPAINT_HLT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Enables painting textures on the image with left mouse button"); + xco+= XIC+8; uiBlockBeginAlign(block); @@ -1221,7 +1232,6 @@ void image_buttons(void) uiDefIconButBitI(block, TOG, SI_SHOW_ZBUF, B_SIMA_SHOW_ZBUF, ICON_SOLID, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Draws zbuffer values"); xco+= XIC; } - else G.sima->flag &= ~SI_SHOW_ZBUF; /* no confusing display for non-zbuf images */ } xco+= 8; @@ -1240,7 +1250,7 @@ void image_buttons(void) /* draw LOCK */ uiDefIconButS(block, ICONTOG, 0, ICON_UNLOCKED, xco,0,XIC,YIC, &(G.sima->lock), 0, 0, 0, 0, "Updates other affected window spaces automatically to reflect changes in real time"); - + /* Always do this last */ curarea->headbutlen= xco+2*XIC; |