Patch #5091, by Ramon Carlos Ruiz

For numerical pad 2-4-6-8, it adds a step value in degrees in the User
Presets. Code had to be rewritten some... :)
This commit is contained in:
2006-11-08 12:46:41 +00:00
parent 6685c0d571
commit a0354619c7
4 changed files with 13 additions and 7 deletions

View File

@@ -170,13 +170,13 @@ typedef struct UserDef {
int textimeout, texcollectrate; int textimeout, texcollectrate;
int memcachelimit; int memcachelimit;
short frameserverport; short frameserverport;
short pad; short pad_rot_angle; /*control the rotation step of the view when PAD2,PAD4,PAD6&PAD8 is use*/
short obcenter_dia; short obcenter_dia;
short rvisize; /* rotating view icon size */ short rvisize; /* rotating view icon size */
short rvibright; /* rotating view icon brightness */ short rvibright; /* rotating view icon brightness */
char versemaster[160]; char versemaster[160];
char verseuser[160]; char verseuser[160];
short pad1; short pad;
} UserDef; } UserDef;
extern UserDef U; /* from usiblender.c !!!! */ extern UserDef U; /* from usiblender.c !!!! */

View File

@@ -2840,7 +2840,11 @@ void drawinfospace(ScrArea *sa, void *spacedata)
&U.rvibright, 0, 10, 0, 0, &U.rvibright, 0, 10, 0, 0,
"The brightness of the icon"); "The brightness of the icon");
uiBlockEndAlign(block); 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)");
uiDefBut(block, LABEL,0,"Select with:", uiDefBut(block, LABEL,0,"Select with:",
(xpos+(2*edgsp)+(3*mpref)+(3*midsp)),y6label,mpref,buth, (xpos+(2*edgsp)+(3*mpref)+(3*midsp)),y6label,mpref,buth,

View File

@@ -307,7 +307,7 @@ void persptoetsen(unsigned short event)
else if(G.vd->persp<2) { else if(G.vd->persp<2) {
if(event==PAD4 || event==PAD6) { if(event==PAD4 || event==PAD6) {
/* z-axis */ /* z-axis */
phi= (float)(M_PI/24.0); phi= (float)(M_PI/360.0)*U.pad_rot_angle;
if(event==PAD6) phi= -phi; if(event==PAD6) phi= -phi;
si= (float)sin(phi); si= (float)sin(phi);
q1[0]= (float)cos(phi); q1[0]= (float)cos(phi);
@@ -322,7 +322,7 @@ void persptoetsen(unsigned short event)
VECCOPY(q1+1, G.vd->viewinv[0]); VECCOPY(q1+1, G.vd->viewinv[0]);
Normalise(q1+1); Normalise(q1+1);
phi= (float)(M_PI/24.0); phi= (float)(M_PI/360.0)*U.pad_rot_angle;
if(event==PAD2) phi= -phi; if(event==PAD2) phi= -phi;
si= (float)sin(phi); si= (float)sin(phi);
q1[0]= (float)cos(phi); q1[0]= (float)cos(phi);

View File

@@ -186,6 +186,8 @@ static void init_userdef_file(void)
U.tw_size= 20; // percentage of window size U.tw_size= 20; // percentage of window size
U.tw_handlesize= 16; // percentage of widget radius U.tw_handlesize= 16; // percentage of widget radius
} }
if(U.pad_rot_angle==0)
U.pad_rot_angle= 15;
if (G.main->versionfile <= 191) { if (G.main->versionfile <= 191) {
strcpy(U.plugtexdir, U.textudir); strcpy(U.plugtexdir, U.textudir);