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:
authorMatt Ebb <matt@mke3.net>2007-10-09 02:17:51 +0400
committerMatt Ebb <matt@mke3.net>2007-10-09 02:17:51 +0400
commit74f744010b1adbc08a5f548f26066c82189f2655 (patch)
tree5087c9ed206683895f6fe7891618e2d8a4fe554b /source/blender/src/space.c
parentca1ea2ce65d463a417695472ac514c8cb49425b7 (diff)
* Patch #6877: Zoom to Mouse Position
by Fahrezal Effendi (exavolt) This adds an additional preference to the view and controls section, which uses the mouse's position as the centre of the zoom when zooming in the 3D View with Ctrl-MMB or the mouse wheel. It's very nice for big scenes, thanks Fahrezal! A nice todo would be to add this for 2D views as well.
Diffstat (limited to 'source/blender/src/space.c')
-rw-r--r--source/blender/src/space.c69
1 files changed, 37 insertions, 32 deletions
diff --git a/source/blender/src/space.c b/source/blender/src/space.c
index 923a2ae010e..bb50674a6f9 100644
--- a/source/blender/src/space.c
+++ b/source/blender/src/space.c
@@ -3390,56 +3390,35 @@ void drawinfospace(ScrArea *sa, void *spacedata)
uiBlockSetCol(block, TH_AUTO); /* end color */
uiBlockEndAlign(block);
+ uiDefButBitI(block, TOG, USER_ZOOM_TO_MOUSEPOS, B_DRAWINFO, "Zoom to Mouse Position",
+ (xpos+edgsp+mpref+(2*spref)+(3*midsp)),y4,mpref,buth,
+ &(U.uiflag), 0, 0, 0, 0,
+ "Zoom in towards the mouse pointer's position in the 3D view, rather than the 2D window center");
+
uiDefBut(block, LABEL,0,"View rotation:",
- (xpos+(2*edgsp)+mpref+(2*spref)+(2*midsp)),y4label,mpref,buth,
+ (xpos+(2*edgsp)+mpref+(2*spref)+(2*midsp)),y3label,mpref,buth,
0, 0, 0, 0, 0, "");
uiBlockBeginAlign(block);
uiBlockSetCol(block, TH_BUT_SETTING1); /* mutually exclusive toggles, start color */
uiDefButBitI(block, TOG, USER_TRACKBALL, B_DRAWINFO, "Trackball",
- (xpos+edgsp+mpref+(2*spref)+(3*midsp)),y3,(mpref/2),buth,
+ (xpos+edgsp+mpref+(2*spref)+(3*midsp)),y2,(mpref/2),buth,
&(U.flag), 0, 0, 0, 0,
"Allow the view to tumble freely when orbiting with the Middle Mouse Button");
uiDefButBitI(block, TOGN, USER_TRACKBALL, B_DRAWINFO, "Turntable",
- (xpos+edgsp+mpref+(2*spref)+(3*midsp)+(mpref/2)),y3,(mpref/2),buth,
+ (xpos+edgsp+mpref+(2*spref)+(3*midsp)+(mpref/2)),y2,(mpref/2),buth,
&(U.flag), 0, 0, 0, 0,
"Use fixed up axis for orbiting with Middle Mouse Button");
uiBlockSetCol(block, TH_AUTO); /* end color */
uiDefButBitI(block, TOG, USER_AUTOPERSP, B_DRAWINFO, "Auto Perspective",
- (xpos+edgsp+mpref+(2*spref)+(3*midsp)),y2,(mpref/2),buth,
+ (xpos+edgsp+mpref+(2*spref)+(3*midsp)),y1,(mpref/2),buth,
&(U.uiflag), 0, 0, 0, 0,
"Automatically switch between orthographic and perspective when changing from top/front/side views");
uiDefButBitI(block, TOG, USER_ORBIT_SELECTION, B_DRAWINFO, "Around Selection",
- (xpos+edgsp+mpref+(2*spref)+(3*midsp)+(mpref/2)),y2,(mpref/2),buth,
+ (xpos+edgsp+mpref+(2*spref)+(3*midsp)+(mpref/2)),y1,(mpref/2),buth,
&(U.uiflag), 0, 0, 0, 0,
"Use selection as the orbiting center");
uiBlockEndAlign(block);
-
- uiBlockBeginAlign(block);
- uiDefButBitI(block, TOG, USER_SHOW_ROTVIEWICON, B_DRAWINFO, "Mini Axis",
- (xpos+edgsp+(2*mpref)+(2*midsp)),y1,(mpref/3),buth,
- &(U.uiflag), 0, 0, 0, 0,
- "Show a small rotating 3D axis in the bottom left corner of the 3D View");
- uiDefButS(block, NUM, B_DRAWINFO, "Size:",
- (xpos+edgsp+(2*mpref)+(2*midsp)+(mpref/3)),y1,(mpref/3),buth,
- &U.rvisize, 10, 64, 0, 0,
- "The axis icon's size");
- uiDefButS(block, NUM, B_DRAWINFO, "Bright:",
- (xpos+edgsp+(2*mpref)+(2*midsp)+2*(mpref/3)),y1,(mpref/3),buth,
- &U.rvibright, 0, 10, 0, 0,
- "The brightness of the icon");
- uiBlockEndAlign(block);
-
- uiDefButS(block, NUM, B_DRAWINFO, "Rotation Angle:",
- (xpos+edgsp+(3*mpref)+(4*midsp)),y1,(mpref),buth,
- &U.pad_rot_angle, 0, 90, 0, 0,
- "The rotation step for numerical pad keys (2 4 6 8)");
-
- uiDefButS(block, NUM, B_DRAWINFO, "Smooth View:",
- (xpos+edgsp+(4*mpref)+(5*midsp)),y1,(mpref),buth,
- &U.smooth_viewtx, 0, 1000, 0, 0,
- "The time to animate the view in miliseconds, zero to disable");
-
uiDefBut(block, LABEL,0,"Select with:",
(xpos+(2*edgsp)+(3*mpref)+(3*midsp)),y6label,mpref,buth,
0, 0, 0, 0, 0, "");
@@ -3474,7 +3453,21 @@ void drawinfospace(ScrArea *sa, void *spacedata)
&(U.flag), 0, 0, 0, 0,
"Emulates Middle Mouse with Alt+LeftMouse (doesnt work with Left Mouse Select option)");
-
+ uiBlockBeginAlign(block);
+ uiDefButBitI(block, TOG, USER_SHOW_ROTVIEWICON, B_DRAWINFO, "Mini Axis",
+ (xpos+edgsp+(3*mpref)+(4*midsp)),y1,(mpref/3),buth,
+ &(U.uiflag), 0, 0, 0, 0,
+ "Show a small rotating 3D axis in the bottom left corner of the 3D View");
+ uiDefButS(block, NUM, B_DRAWINFO, "Size:",
+ (xpos+edgsp+(3*mpref)+(4*midsp)+(mpref/3)),y1,(mpref/3),buth,
+ &U.rvisize, 10, 64, 0, 0,
+ "The axis icon's size");
+ uiDefButS(block, NUM, B_DRAWINFO, "Bright:",
+ (xpos+edgsp+(3*mpref)+(4*midsp)+2*(mpref/3)),y1,(mpref/3),buth,
+ &U.rvibright, 0, 10, 0, 0,
+ "The brightness of the icon");
+ uiBlockEndAlign(block);
+
uiDefBut(block, LABEL,0,"Middle Mouse Button:",
(xpos+(2*edgsp)+(4*mpref)+(4*midsp)),y6label,mpref,buth,
0, 0, 0, 0, 0, "");
@@ -3488,6 +3481,7 @@ void drawinfospace(ScrArea *sa, void *spacedata)
&(U.flag), 0, 0, 0, 0, "Default action for the Middle Mouse Button");
uiBlockSetCol(block, TH_AUTO); /* end color */
uiBlockEndAlign(block);
+
uiDefBut(block, LABEL,0,"Mouse Wheel:",
(xpos+(2*edgsp)+(4*mpref)+(4*midsp)),y4label,mpref,buth,
@@ -3502,6 +3496,17 @@ void drawinfospace(ScrArea *sa, void *spacedata)
&U.wheellinescroll, 0.0, 32.0, 0, 0,
"The number of lines scrolled at a time with the mouse wheel");
uiBlockEndAlign(block);
+
+ uiBlockBeginAlign(block);
+ uiDefButS(block, NUM, B_DRAWINFO, "Smooth View:",
+ (xpos+edgsp+(4*mpref)+(5*midsp)),y2,(mpref),buth,
+ &U.smooth_viewtx, 0, 1000, 0, 0,
+ "The time to animate the view in miliseconds, zero to disable");
+ uiDefButS(block, NUM, B_DRAWINFO, "Rotation Angle:",
+ (xpos+edgsp+(4*mpref)+(5*midsp)),y1,(mpref),buth,
+ &U.pad_rot_angle, 0, 90, 0, 0,
+ "The rotation step for numerical pad keys (2 4 6 8)");
+ uiBlockEndAlign(block);
uiDefBut(block, LABEL,0,"3D Transform Widget:",