== Copy Scale Constraint - Offset ==

Now the Copy Scale Constraint also has the Offset functionality that Copy Loc/Rot have. 


== Copy Rotation Constraint == 

Also, fixed the tooltip for the CopyRot Offset button.

Note: when working with pose-bones, and using offset, setting both owner+target spaces to pose-space should cancel any unwanted rotations visible.
This commit is contained in:
Joshua Leung
2007-10-31 10:04:57 +00:00
parent 0fb83a87b9
commit 2ae5da3fc2
2 changed files with 28 additions and 7 deletions

View File

@@ -1787,12 +1787,30 @@ static void sizelike_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *t
Mat4ToSize(ct->matrix, size);
Mat4ToSize(cob->matrix, obsize);
if ((data->flag & SIZELIKE_X) && obsize[0] != 0)
VecMulf(cob->matrix[0], size[0] / obsize[0]);
if ((data->flag & SIZELIKE_Y) && obsize[1] != 0)
VecMulf(cob->matrix[1], size[1] / obsize[1]);
if ((data->flag & SIZELIKE_Z) && obsize[2] != 0)
VecMulf(cob->matrix[2], size[2] / obsize[2]);
if ((data->flag & SIZELIKE_X) && (obsize[0] != 0)) {
if (data->flag & SIZELIKE_OFFSET) {
size[0] += (obsize[0] - 1.0f);
VecMulf(cob->matrix[0], size[0] / obsize[0]);
}
else
VecMulf(cob->matrix[0], size[0] / obsize[0]);
}
if ((data->flag & SIZELIKE_Y) && (obsize[1] != 0)) {
if (data->flag & SIZELIKE_OFFSET) {
size[1] += (obsize[1] - 1.0f);
VecMulf(cob->matrix[1], size[1] / obsize[1]);
}
else
VecMulf(cob->matrix[1], size[1] / obsize[1]);
}
if ((data->flag & SIZELIKE_Z) && (obsize[2] != 0)) {
if (data->flag & SIZELIKE_OFFSET) {
size[2] += (obsize[2] - 1.0f);
VecMulf(cob->matrix[2], size[2] / obsize[2]);
}
else
VecMulf(cob->matrix[2], size[2] / obsize[2]);
}
}
}

View File

@@ -851,7 +851,7 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
uiBlockEndAlign(block);
/* draw offset toggle */
uiDefButBitI(block, TOG, ROTLIKE_OFFSET, B_CONSTRAINT_TEST, "Offset", *xco, *yco-64, 80, 18, &data->flag, 0, 24, 0, 0, "Copy X component");
uiDefButBitI(block, TOG, ROTLIKE_OFFSET, B_CONSTRAINT_TEST, "Offset", *xco, *yco-64, 80, 18, &data->flag, 0, 24, 0, 0, "Add original rotation onto copied rotation");
/* constraint space settings */
draw_constraint_spaceselect(block, con, *xco, *yco-94, is_armature_owner(ob), is_armature_target(data->tar));
@@ -891,6 +891,9 @@ static void draw_constraint (uiBlock *block, ListBase *list, bConstraint *con, s
uiDefButBitI(block, TOG, SIZELIKE_Z, B_CONSTRAINT_TEST, "Z", *xco+((width/2)+16), *yco-64, 32, 18, &data->flag, 0, 24, 0, 0, "Copy Z component");
uiBlockEndAlign(block);
/* draw offset toggle */
uiDefButBitI(block, TOG, SIZELIKE_OFFSET, B_CONSTRAINT_TEST, "Offset", *xco, *yco-64, 80, 18, &data->flag, 0, 24, 0, 0, "Add original scaling onto copied scaling");
/* constraint space settings */
draw_constraint_spaceselect(block, con, *xco, *yco-94, is_armature_owner(ob), is_armature_target(data->tar));
}