== 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:
@@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user