1) Change the way "Align mode" is accessed in the UI: It's now a global
authorAlexander Ewering <blender@instinctive.de>
Sun, 18 Jul 2004 15:57:33 +0000 (15:57 +0000)
committerAlexander Ewering <blender@instinctive.de>
Sun, 18 Jul 2004 15:57:33 +0000 (15:57 +0000)
   toggle for all pivot modes. The 2 new pivot modes have been removed
   from the popup.

   Instead, a new toggle button is added to the 3d view header.

2) Grab cursor mode. Cursor can be grabbed (and constrained to axis, grid,
   etc. while moving) like any other object. If no object is selected,
   GKEY alone grabs the cursor, otherwise pressing CKEY while in GKEY mode
   moves the cursor.

source/blender/include/blendef.h
source/blender/makesdna/DNA_view3d_types.h
source/blender/src/edit.c
source/blender/src/editface.c
source/blender/src/header_view3d.c
source/blender/src/space.c

index cd3218c03ab3c7171b131f49bb2affc9898fa5a0..0528a1914b8b5d78f04308de8c75c043a78633ec 100644 (file)
 #define        B_TEXTUREPAINT          154
 #define B_WPAINT               155
 #define B_MODESELECT           156
+#define B_AROUND               157
 
 /* IPO: 200 */
 #define B_IPOHOME              201
index 1f3cadbb9615adfa8f4feb89626949c4f755bf8d..ef48bc21b17f9da45acb25546e0ab7f3fa1fd3d7 100644 (file)
@@ -125,9 +125,7 @@ typedef struct View3D {
 /* View3D->around */
 #define V3D_CENTRE              0
 #define V3D_CENTROID    3
-#define V3D_CENTROID_LOC 4
 #define V3D_CURSOR              1
-#define V3D_CURSOR_LOC  5
 #define V3D_LOCAL               2
 
 
index e14cbe1147428fc88213be3b0d0273f25e26e2a8..d0dca4a6d37e0f0189e59684968fd858501c15dc 100644 (file)
@@ -899,7 +899,7 @@ void snap_curs_to_sel()
                                DO_MINMAX(vec, min, max);
                        }
 
-                       if(G.vd->around==V3D_CENTROID || G.vd->around==V3D_CENTROID_LOC) {
+                       if(G.vd->around==V3D_CENTROID) {
                                VecMulf(centroid, 1.0/(float)tottrans);
                                VECCOPY(curs, centroid);
                        }
@@ -923,7 +923,7 @@ void snap_curs_to_sel()
                                base= base->next;
                        }
                        if(count) {
-                               if(G.vd->around==V3D_CENTROID || G.vd->around==V3D_CENTROID_LOC) {
+                               if(G.vd->around==V3D_CENTROID) {
                                        VecMulf(centroid, 1.0/(float)count);
                                        VECCOPY(curs, centroid);
                                }
@@ -970,7 +970,7 @@ void snap_curs_to_firstsel()
                                VecAddf(centroid, centroid, vec);
                                DO_MINMAX(vec, min, max);*/
 
-                       if(G.vd->around==V3D_CENTROID || G.vd->around==V3D_CENTROID_LOC) {
+                       if(G.vd->around==V3D_CENTROID) {
                                VecMulf(vec, 1.0/(float)tottrans);
                                VECCOPY(curs, vec);
                        }
@@ -994,7 +994,7 @@ void snap_curs_to_firstsel()
                                base= base->next;
                        }
                        if(count) {
-                               if(G.vd->around==V3D_CENTROID || G.vd->around==V3D_CENTROID_LOC) {
+                               if(G.vd->around==V3D_CENTROID) {
                                        VecMulf(centroid, 1.0/(float)count);
                                        VECCOPY(curs, centroid);
                                }
@@ -1046,7 +1046,7 @@ void snap_to_center()
                                DO_MINMAX(vec, min, max);
                        }
 
-                       if(G.vd->around==V3D_CENTROID || G.vd->around==V3D_CENTROID_LOC) {
+                       if(G.vd->around==V3D_CENTROID) {
                                VecMulf(centroid, 1.0/(float)tottrans);
                                VECCOPY(snaploc, centroid);
                        }
@@ -1072,7 +1072,7 @@ void snap_to_center()
                                base= base->next;
                        }
                        if(count) {
-                               if(G.vd->around==V3D_CENTROID || G.vd->around==V3D_CENTROID_LOC) {
+                               if(G.vd->around==V3D_CENTROID) {
                                        VecMulf(centroid, 1.0/(float)count);
                                        VECCOPY(snaploc, centroid);
                                }
index 56bdf4f6d753ea5b84c771b69b6af8480c1d0e6a..26cd6a09cbe795e20d5a166be324c291d59cbb3c 100644 (file)
@@ -126,7 +126,6 @@ static void uv_calc_center_vector(float *result, Object *ob, Mesh *me)
                }
                VecMidf(result, min, max);
                break;
-       case V3D_CURSOR_LOC:
        case V3D_CURSOR: /*cursor center*/ 
                cursx= give_cursor();
                /* shift to objects world */
@@ -135,7 +134,6 @@ static void uv_calc_center_vector(float *result, Object *ob, Mesh *me)
                result[2]= cursx[2]-ob->obmat[3][2];
                break;
        case V3D_LOCAL: /*object center*/
-       case V3D_CENTROID_LOC:
        case V3D_CENTROID: /* multiple objects centers, only one object here*/
        default:
                result[0]= result[1]= result[2]= 0.0;
index 61abd12a6b77d8a2cd517011e4d268088dcf6074..77be9ec439861514c5c132d85eb85f7871aac146 100644 (file)
@@ -3362,9 +3362,6 @@ static char *around_pup(void)
        strcat(string, "|Median Point %x3");
        strcat(string, "|3D Cursor %x1");
        strcat(string, "|Individual Object Centers %x2");
-       strcat(string, "|%l");
-       strcat(string, "|Median Point (Only Object Centers) %x4");
-       strcat(string, "|3D Cursor (Only Object Centers) %x5");
        return (string);
 }
 
@@ -3649,7 +3646,9 @@ void do_view3d_buttons(short event)
                }
                allqueue(REDRAWVIEW3D, 0);
                break;
-       
+       case B_AROUND:
+               handle_view3d_around();
+               break;          
        default:
 
                if(event>=B_LAY && event<B_LAY+31) {
@@ -3873,7 +3872,7 @@ void view3d_buttons(void)
        
        /* around */
        xco+= XIC+18;
-       uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_ROTATE, around_pup(), xco,0,XIC+10,YIC, &(G.vd->around), 0, 3.0, 0, 0, "Rotation/Scaling Pivot (Hotkeys: Comma, Period) ");
+       uiDefIconTextButS(block, ICONTEXTROW,B_AROUND, ICON_ROTATE, around_pup(), xco,0,XIC+10,YIC, &(G.vd->around), 0, 3.0, 0, 0, "Rotation/Scaling Pivot (Hotkeys: Comma, Period) ");
        /*
        uiDefIconButS(block, ROW, 1, ICON_ROTATE, xco+=XIC,0,XIC,YIC, &G.vd->around, 3.0, 0.0, 0, 0, "Enables Rotation or Scaling around boundbox center (COMMAKEY)");
        uiDefIconButS(block, ROW, 1, ICON_ROTATECENTER, xco+=XIC,0,XIC,YIC, &G.vd->around, 3.0, 3.0, 0, 0, "Enables Rotation or Scaling around median point");
@@ -3881,9 +3880,13 @@ void view3d_buttons(void)
        uiDefIconButS(block, ROW, 1, ICON_ROTATECOLLECTION, xco+=XIC,0,XIC,YIC, &G.vd->around, 3.0, 2.0, 0, 0, "Enables Rotation or Scaling around individual object centers");
        */
        
+       xco+= 18;
        
+       uiDefIconButS(block, TOG|BIT|10, B_AROUND, ICON_ALIGN,
+                               xco+=XIC,0,XIC,YIC,
+                               &G.vd->flag, 0, 0, 0, 0, "Translate only (align)");     
        
-       xco+= XIC+18;
+       xco+= XIC+14;
        /* LAYERS */
        if(G.vd->localview==0) {
                
index d80f892f1febb216e5c163e9bfa48b0c52ddf684..39cfe795426e8bd245ec44983962806db3575c7b 100644 (file)
@@ -1493,8 +1493,6 @@ void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                        case PERIODKEY:
                                if(G.qual==LR_CTRLKEY) {
                                        G.vd->around= V3D_LOCAL;
-                               }       else if(G.qual==LR_SHIFTKEY) {
-                                       G.vd->around= V3D_CURSOR_LOC;
                                }       else if(G.qual==0) {
                                        G.vd->around= V3D_CURSOR;
                                }