Several Minor Fixes:

* Grouped Up/Down buttons in constraint panel headers, and fixed their tooltips
* Removed unused variable from action editor code
* Minor formatting in constraint.c
This commit is contained in:
Joshua Leung 2007-08-23 09:42:21 +00:00
parent 866218eb15
commit 6ab498defc
3 changed files with 13 additions and 13 deletions

@ -2126,7 +2126,7 @@ static void evaluate_constraint (bConstraint *constraint, float ownermat[][4], f
VecSubf(totmat[0], vec, vec2); VecSubf(totmat[0], vec, vec2);
Normalize(totmat[0]); Normalize(totmat[0]);
VecMulf(totmat[0],-1); VecMulf(totmat[0],-1);
/* the y axis is fixed */ /* the y axis is fixed */
totmat[1][0] = ownermat[1][0]; totmat[1][0] = ownermat[1][0];
totmat[1][1] = ownermat[1][1]; totmat[1][1] = ownermat[1][1];
@ -2144,7 +2144,7 @@ static void evaluate_constraint (bConstraint *constraint, float ownermat[][4], f
VecSubf(totmat[2], vec, vec2); VecSubf(totmat[2], vec, vec2);
Normalize(totmat[2]); Normalize(totmat[2]);
VecMulf(totmat[2],-1); VecMulf(totmat[2],-1);
/* the y axis is fixed */ /* the y axis is fixed */
totmat[1][0] = ownermat[1][0]; totmat[1][0] = ownermat[1][0];
totmat[1][1] = ownermat[1][1]; totmat[1][1] = ownermat[1][1];
@ -2268,19 +2268,18 @@ static void evaluate_constraint (bConstraint *constraint, float ownermat[][4], f
totmat[0][0] = tmpmat[0][0];totmat[0][1] = tmpmat[0][1];totmat[0][2] = tmpmat[0][2]; totmat[0][0] = tmpmat[0][0];totmat[0][1] = tmpmat[0][1];totmat[0][2] = tmpmat[0][2];
totmat[1][0] = tmpmat[1][0];totmat[1][1] = tmpmat[1][1];totmat[1][2] = tmpmat[1][2]; totmat[1][0] = tmpmat[1][0];totmat[1][1] = tmpmat[1][1];totmat[1][2] = tmpmat[1][2];
totmat[2][0] = tmpmat[2][0];totmat[2][1] = tmpmat[2][1];totmat[2][2] = tmpmat[2][2]; totmat[2][0] = tmpmat[2][0];totmat[2][1] = tmpmat[2][1];totmat[2][2] = tmpmat[2][2];
Mat4CpyMat4(tmat, ownermat); Mat4CpyMat4(tmat, ownermat);
mdet = Det3x3( totmat[0][0],totmat[0][1],totmat[0][2], mdet = Det3x3( totmat[0][0],totmat[0][1],totmat[0][2],
totmat[1][0],totmat[1][1],totmat[1][2], totmat[1][0],totmat[1][1],totmat[1][2],
totmat[2][0],totmat[2][1],totmat[2][2]); totmat[2][0],totmat[2][1],totmat[2][2]);
if (mdet==0) if (mdet==0) {
{
totmat[0][0] = 1;totmat[0][1] = 0;totmat[0][2] = 0; totmat[0][0] = 1;totmat[0][1] = 0;totmat[0][2] = 0;
totmat[1][0] = 0;totmat[1][1] = 1;totmat[1][2] = 0; totmat[1][0] = 0;totmat[1][1] = 1;totmat[1][2] = 0;
totmat[2][0] = 0;totmat[2][1] = 0;totmat[2][2] = 1; totmat[2][0] = 0;totmat[2][1] = 0;totmat[2][2] = 1;
} }
/* apply out transformaton to the object */ /* apply out transformaton to the object */
Mat4MulMat34(ownermat, totmat, tmat); Mat4MulMat34(ownermat, totmat, tmat);
} }
@ -2349,7 +2348,7 @@ static void evaluate_constraint (bConstraint *constraint, float ownermat[][4], f
//dist = VecLenf( ob->obmat[3], targetmat[3]); //dist = VecLenf( ob->obmat[3], targetmat[3]);
if (data->orglength == 0) data->orglength = dist; if (data->orglength == 0) data->orglength = dist;
if (data->bulge ==0) data->bulge = 1.0; if (data->bulge == 0) data->bulge = 1.0;
scale[1] = dist/data->orglength; scale[1] = dist/data->orglength;
switch (data->volmode) { switch (data->volmode) {

@ -564,13 +564,15 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
/* open/close */ /* open/close */
uiDefIconButBitS(block, ICONTOG, CONSTRAINT_EXPAND, B_CONSTRAINT_TEST, ICON_DISCLOSURE_TRI_RIGHT, *xco-10, *yco, 20, 20, &con->flag, 0.0, 0.0, 0.0, 0.0, "Collapse/Expand Constraint"); uiDefIconButBitS(block, ICONTOG, CONSTRAINT_EXPAND, B_CONSTRAINT_TEST, ICON_DISCLOSURE_TRI_RIGHT, *xco-10, *yco, 20, 20, &con->flag, 0.0, 0.0, 0.0, 0.0, "Collapse/Expand Constraint");
/* up down */ /* up/down */
uiBlockBeginAlign(block);
uiBlockSetEmboss(block, UI_EMBOSS); uiBlockSetEmboss(block, UI_EMBOSS);
but = uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, VICON_MOVE_UP, *xco+width-50, *yco, 16, 18, NULL, 0.0, 0.0, 0.0, 0.0, "Move modifier up in stack"); but = uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, VICON_MOVE_UP, *xco+width-50, *yco, 16, 18, NULL, 0.0, 0.0, 0.0, 0.0, "Move constraint up in constraint stack");
uiButSetFunc(but, constraint_moveUp, ob, con); uiButSetFunc(but, constraint_moveUp, ob, con);
but = uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, VICON_MOVE_DOWN, *xco+width-50+20, *yco, 16, 18, NULL, 0.0, 0.0, 0.0, 0.0, "Move modifier down in stack"); but = uiDefIconBut(block, BUT, B_CONSTRAINT_TEST, VICON_MOVE_DOWN, *xco+width-50+18, *yco, 16, 18, NULL, 0.0, 0.0, 0.0, 0.0, "Move constraint down in constraint stack");
uiButSetFunc(but, constraint_moveDown, ob, con); uiButSetFunc(but, constraint_moveDown, ob, con);
uiBlockEndAlign(block);
if (con->flag & CONSTRAINT_EXPAND) { if (con->flag & CONSTRAINT_EXPAND) {
if (con->flag & CONSTRAINT_DISABLE) if (con->flag & CONSTRAINT_DISABLE)

@ -1643,7 +1643,7 @@ void sethandles_action_keys (int code)
static void clever_keyblock_names (Key *key, short *mval) static void clever_keyblock_names (Key *key, short *mval)
{ {
KeyBlock *kb; KeyBlock *kb;
int but=0, i, keynum; int but=0, keynum;
char str[64]; char str[64];
float x; float x;
@ -1661,7 +1661,6 @@ static void clever_keyblock_names (Key *key, short *mval)
if (kb == NULL) if (kb == NULL)
return; return;
if (kb->name[0] == '\0') if (kb->name[0] == '\0')
sprintf(str, "Key %d", keynum); sprintf(str, "Key %d", keynum);
else else