Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Ewering <blender@instinctive.de>2004-07-18 19:57:33 +0400
committerAlexander Ewering <blender@instinctive.de>2004-07-18 19:57:33 +0400
commit96e0a103d49299649b1391fd66aa08a91b5889e4 (patch)
tree2fb3523fb5aec1a8f738a56b9e69185e0197159b
parent6dca057ac5250bb78b664d2cf9270a409238ecbc (diff)
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.
-rw-r--r--source/blender/include/blendef.h1
-rw-r--r--source/blender/makesdna/DNA_view3d_types.h2
-rw-r--r--source/blender/src/edit.c12
-rw-r--r--source/blender/src/editface.c2
-rw-r--r--source/blender/src/header_view3d.c15
-rw-r--r--source/blender/src/space.c2
6 files changed, 16 insertions, 18 deletions
diff --git a/source/blender/include/blendef.h b/source/blender/include/blendef.h
index cd3218c03ab..0528a1914b8 100644
--- a/source/blender/include/blendef.h
+++ b/source/blender/include/blendef.h
@@ -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
diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h
index 1f3cadbb961..ef48bc21b17 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -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
diff --git a/source/blender/src/edit.c b/source/blender/src/edit.c
index e14cbe11474..d0dca4a6d37 100644
--- a/source/blender/src/edit.c
+++ b/source/blender/src/edit.c
@@ -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);
}
diff --git a/source/blender/src/editface.c b/source/blender/src/editface.c
index 56bdf4f6d75..26cd6a09cbe 100644
--- a/source/blender/src/editface.c
+++ b/source/blender/src/editface.c
@@ -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;
diff --git a/source/blender/src/header_view3d.c b/source/blender/src/header_view3d.c
index 61abd12a6b7..77be9ec4398 100644
--- a/source/blender/src/header_view3d.c
+++ b/source/blender/src/header_view3d.c
@@ -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) {
diff --git a/source/blender/src/space.c b/source/blender/src/space.c
index d80f892f1fe..39cfe795426 100644
--- a/source/blender/src/space.c
+++ b/source/blender/src/space.c
@@ -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;
}