1) Change the way "Align mode" is accessed in the UI: It's now a global

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.
This commit is contained in:
Alexander Ewering 2004-07-18 15:57:33 +00:00
parent 6dca057ac5
commit 96e0a103d4
6 changed files with 16 additions and 18 deletions

@ -247,6 +247,7 @@
#define B_TEXTUREPAINT 154
#define B_WPAINT 155
#define B_MODESELECT 156
#define B_AROUND 157
/* IPO: 200 */
#define B_IPOHOME 201

@ -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

@ -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);
}

@ -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;

@ -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) {

@ -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;
}