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:
@@ -170,13 +170,13 @@ typedef struct UserDef {
|
||||
int textimeout, texcollectrate;
|
||||
int memcachelimit;
|
||||
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 rvisize; /* rotating view icon size */
|
||||
short rvibright; /* rotating view icon brightness */
|
||||
char versemaster[160];
|
||||
char verseuser[160];
|
||||
short pad1;
|
||||
short pad;
|
||||
} UserDef;
|
||||
|
||||
extern UserDef U; /* from usiblender.c !!!! */
|
||||
|
||||
@@ -2841,6 +2841,10 @@ void drawinfospace(ScrArea *sa, void *spacedata)
|
||||
"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)");
|
||||
|
||||
uiDefBut(block, LABEL,0,"Select with:",
|
||||
(xpos+(2*edgsp)+(3*mpref)+(3*midsp)),y6label,mpref,buth,
|
||||
|
||||
@@ -307,7 +307,7 @@ void persptoetsen(unsigned short event)
|
||||
else if(G.vd->persp<2) {
|
||||
if(event==PAD4 || event==PAD6) {
|
||||
/* z-axis */
|
||||
phi= (float)(M_PI/24.0);
|
||||
phi= (float)(M_PI/360.0)*U.pad_rot_angle;
|
||||
if(event==PAD6) phi= -phi;
|
||||
si= (float)sin(phi);
|
||||
q1[0]= (float)cos(phi);
|
||||
@@ -322,7 +322,7 @@ void persptoetsen(unsigned short event)
|
||||
VECCOPY(q1+1, G.vd->viewinv[0]);
|
||||
|
||||
Normalise(q1+1);
|
||||
phi= (float)(M_PI/24.0);
|
||||
phi= (float)(M_PI/360.0)*U.pad_rot_angle;
|
||||
if(event==PAD2) phi= -phi;
|
||||
si= (float)sin(phi);
|
||||
q1[0]= (float)cos(phi);
|
||||
|
||||
@@ -186,6 +186,8 @@ static void init_userdef_file(void)
|
||||
U.tw_size= 20; // percentage of window size
|
||||
U.tw_handlesize= 16; // percentage of widget radius
|
||||
}
|
||||
if(U.pad_rot_angle==0)
|
||||
U.pad_rot_angle= 15;
|
||||
|
||||
if (G.main->versionfile <= 191) {
|
||||
strcpy(U.plugtexdir, U.textudir);
|
||||
|
||||
Reference in New Issue
Block a user