inverted the uv header mesh-sync-selection button, added face/vert selection popdown...
authorCampbell Barton <ideasman42@gmail.com>
Mon, 4 Feb 2008 22:01:23 +0000 (22:01 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 4 Feb 2008 22:01:23 +0000 (22:01 +0000)
source/blender/src/header_image.c
source/blender/src/sequence.c

index 1ec54423ab6d56c482e70cf4513ab2393246d573..7a8f284988191a4377c2d4279c3c0893ab97e7d8 100644 (file)
@@ -83,6 +83,7 @@
 #include "BSE_filesel.h"
 #include "BSE_headerbuttons.h"
 #include "BSE_trans_types.h"
+#include "BSE_edit.h"
 
 #include "BPY_extern.h"
 #include "BPY_menus.h"
@@ -361,6 +362,26 @@ static void do_image_buttons_set_uvlayer_callback(void *act, void *data)
        allqueue(REDRAWIMAGE, 0);
 }
 
+static void do_image_buttons_set_selection_mode_callback(void *mode, void *dummy2)
+{
+       int selectmode = *((int *)mode);
+       if (selectmode==0) {
+               if (G.scene->selectmode == SCE_SELECT_VERTEX) return;
+               G.scene->selectmode = SCE_SELECT_VERTEX;
+       } else {
+               if (G.scene->selectmode == SCE_SELECT_FACE) return;
+               G.scene->selectmode = SCE_SELECT_FACE;
+       }
+       
+       EM_selectmode_set();
+       countall(); 
+       
+       BIF_undo_push("Set Selection Mode");
+       allqueue(REDRAWVIEW3D, 0);
+       allqueue(REDRAWBUTSEDIT, 0);
+       allqueue(REDRAWIMAGE, 0);
+}
+
 static void do_image_view_viewnavmenu(void *arg, int event)
 {
        switch(event) {
@@ -1205,21 +1226,28 @@ void image_buttons(void)
                xco+= XIC + 18;
                
                uiBlockBeginAlign(block);
-               uiDefIconButBitI(block, TOGN, SI_SYNC_UVSEL, B_REDR, ICON_NO_GO_LEFT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Mesh independant selection");
+               uiDefIconButBitI(block, TOG, SI_SYNC_UVSEL, B_REDR, ICON_EDIT, xco,0,XIC,YIC, &G.sima->flag, 0, 0, 0, 0, "Sync UV and Mesh Selection");
                xco+= XIC;
-               if ((G.sima->flag & SI_SYNC_UVSEL)==0) {
+               if (G.sima->flag & SI_SYNC_UVSEL) {
+                       static int selectmode;
+                       /* would use these if const's could go in strings 
+                        * SCE_SELECT_VERTEX, SCE_SELECT_FACE */
+                       ubut = uiDefIconTextButI(block, ICONTEXTROW, B_REDR, ICON_VERTEXSEL,
+                                       "Selection Mode: %t|Vertex%x0|Face%x2",
+                                       xco,0,XIC+10,YIC, &selectmode, 0, 3.0, 0, 0,
+                                       "Change mesh selection mode");
+                       uiButSetFunc(ubut, do_image_buttons_set_selection_mode_callback, &selectmode, NULL);
                        
+               } else {
                        /* would use these if const's could go in strings 
                         * SI_STICKY_LOC SI_STICKY_DISABLE SI_STICKY_VERTEX */
                        ubut = uiDefIconTextButC(block, ICONTEXTROW, B_REDR, ICON_STICKY_UVS_LOC,
                                        "Sticky UV Selection: %t|Disable%x1|Shared Location%x0|Shared Vertex%x2",
                                        xco,0,XIC+10,YIC, &(G.sima->sticky), 0, 3.0, 0, 0,
                                        "Sticky UV Selection (Hotkeys: Shift C, Alt C, Ctrl C)");
-                       xco+= XIC + 16;
                        
-               } else {
-                       xco+= 6;
                }
+               xco+= XIC + 16;
                uiBlockEndAlign(block);
                
                /* Snap copied right out of view3d header */
index 5f78d266c3c6545f2af3c6e74807e704dc4d3f84..9282ab0b086f7275c912359140da4dd16c281957 100644 (file)
@@ -1,4 +1,4 @@
-/**
+       /**
  * $Id$
  *
  * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****