diff options
author | Alexander Ewering <blender@instinctive.de> | 2004-07-15 17:31:18 +0400 |
---|---|---|
committer | Alexander Ewering <blender@instinctive.de> | 2004-07-15 17:31:18 +0400 |
commit | f25b0df75136aff38b7d4f46b1e8230b8d50c5f3 (patch) | |
tree | 7ab26a56c3a7dab5fc9a8d281cea1efba3cbe376 /source/blender/src/toets.c | |
parent | 3dbd149de21b2416b60e3ced129885a940aba3bd (diff) |
Commit for the 4 aforementioned "features":
- "Global Pivot": Maintains a global Pivot and Align mode setting for
all 3d views when enabled, instead of seperate settings per 3d view
- "Auto Perspective": Switch to ortho mode automatically on 1/3/7, and
to Perspective when the view is rotated with the mouse
- "Align mode": As suggested on the list, when enabled, transformations
on several objects only transform their locations, not their sizes or
rotations.
- Grid dotted when not 1:1
***ATTENTION***! The User Interface parts of these features have not been
committed, as I work on my own modified UI here. The three features need
toggle buttons to turn them on and off.
I used the following 3 buttons (first two features are in userprefs,
third as a 3d view setting):
uiDefButBitS(block, TOG, USER_AUTOPERSP, B_DRAWINFO, "Auto Persp",
(xpos+edgespace+(3*medprefbut)+(3*midspace)+smallprefbut+2),y3+10,smallprefbut,buth,
&(U.uiflag), 0, 0, 0, 0,
"Automatically switch between orthographic and perspective");
uiDefButBitS(block, TOG, USER_LOCKAROUND, B_DRAWINFO, "Global Pivot",
(xpos+edgespace+(4*midspace)+(4*medprefbut)),y3+10,smallprefbut,buth,
&(U.uiflag), 0, 0, 0, 0,
"Use global pivot setting for all 3d views");
uiDefIconButS(block, TOG|BIT|10, B_AROUND, ICON_ALIGN,
xco+=XIC,0,XIC,YIC,
&G.vd->flag, 0, 0, 0, 0, "Translate only (align)");
Someone needs to add these to the interface in an appropriate manner!
Thanks.
Diffstat (limited to 'source/blender/src/toets.c')
-rw-r--r-- | source/blender/src/toets.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/source/blender/src/toets.c b/source/blender/src/toets.c index 1e41d6b0024..75b4b70adcc 100644 --- a/source/blender/src/toets.c +++ b/source/blender/src/toets.c @@ -59,6 +59,7 @@ #include "DNA_screen_types.h" #include "DNA_space_types.h" #include "DNA_view3d_types.h" +#include "DNA_userdef_types.h" #include "BKE_utildefines.h" #include "BKE_global.h" @@ -273,7 +274,8 @@ void persptoetsen(unsigned short event) G.vd->viewquat[2]= 0.0; G.vd->viewquat[3]= 0.0; G.vd->view= 7; - if(G.vd->persp>=2) G.vd->persp= perspo; + if (U.uiflag & USER_AUTOPERSP) G.vd->persp= 0; + else if(G.vd->persp>=2) G.vd->persp= perspo; } else if(event==PAD1) { G.vd->viewquat[0]= 0.0; @@ -281,7 +283,8 @@ void persptoetsen(unsigned short event) G.vd->viewquat[2]= (float)-cos(M_PI/4.0); G.vd->viewquat[3]= (float)-cos(M_PI/4.0); G.vd->view=1; - if(G.vd->persp>=2) G.vd->persp= perspo; + if (U.uiflag & USER_AUTOPERSP) G.vd->persp= 0; + else if(G.vd->persp>=2) G.vd->persp= perspo; } else if(event==PAD3) { G.vd->viewquat[0]= 0.5; @@ -289,7 +292,8 @@ void persptoetsen(unsigned short event) G.vd->viewquat[2]= 0.5; G.vd->viewquat[3]= 0.5; G.vd->view=3; - if(G.vd->persp>=2) G.vd->persp= perspo; + if (U.uiflag & USER_AUTOPERSP) G.vd->persp= 0; + else if(G.vd->persp>=2) G.vd->persp= perspo; } else if(event==PADMINUS) { /* this min and max is also in viewmove() */ @@ -327,7 +331,8 @@ void persptoetsen(unsigned short event) G.vd->viewquat[2]= 0.0; G.vd->viewquat[3]= 0.0; G.vd->view=7; - if(G.vd->persp>=2) G.vd->persp= perspo; + if (U.uiflag & USER_AUTOPERSP) G.vd->persp= 0; + else if(G.vd->persp>=2) G.vd->persp= perspo; } else if(event==PAD1) { G.vd->viewquat[0]= (float)cos(M_PI/4.0); @@ -335,7 +340,8 @@ void persptoetsen(unsigned short event) G.vd->viewquat[2]= 0.0; G.vd->viewquat[3]= 0.0; G.vd->view=1; - if(G.vd->persp>=2) G.vd->persp= perspo; + if (U.uiflag & USER_AUTOPERSP) G.vd->persp= 0; + else if(G.vd->persp>=2) G.vd->persp= perspo; } else if(event==PAD3) { G.vd->viewquat[0]= 0.5; @@ -343,7 +349,8 @@ void persptoetsen(unsigned short event) G.vd->viewquat[2]= -0.5; G.vd->viewquat[3]= -0.5; G.vd->view=3; - if(G.vd->persp>=2) G.vd->persp= perspo; + if (U.uiflag & USER_AUTOPERSP) G.vd->persp= 0; + else if(G.vd->persp>=2) G.vd->persp= perspo; } else if(event==PADMINUS) { /* this min and max is also in viewmove() */ |