Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2007-10-31 13:04:57 +0300
committerJoshua Leung <aligorith@gmail.com>2007-10-31 13:04:57 +0300
commit2ae5da3fc287874746967ecf988f744dc56ebfbc (patch)
treed11a08ad8dc821e2ff36c09a93ebf83d5c9b0960 /source
parent0fb83a87b9e42c5216d5507a9ce19f53e2ae8095 (diff)
== 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.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/constraint.c30
-rw-r--r--source/blender/src/buttons_object.c5
2 files changed, 28 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 1e6f7e4d9e3..f50cb2c6be0 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -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]);
+ }
}
}
diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c
index 52163fa150b..98c2914cee4 100644
--- a/source/blender/src/buttons_object.c
+++ b/source/blender/src/buttons_object.c
@@ -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));
}