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-07-27 09:03:57 +0400
committerJoshua Leung <aligorith@gmail.com>2007-07-27 09:03:57 +0400
commitc540888f727f4a7ae703c1e07da85c620a2b656c (patch)
treee47086df49588fe108b16f436d2fd12611efd462 /source
parent670cf8c5a9ae7f17478e63185fc105e19fb9e4b2 (diff)
Object Transform:
If object has a parent, and constraints should not be inversed for transform, then constraints are now disabled like tracking is.
Diffstat (limited to 'source')
-rwxr-xr-xsource/blender/src/transform_conversions.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c
index d15f9d7494f..0db4eaaf94f 100755
--- a/source/blender/src/transform_conversions.c
+++ b/source/blender/src/transform_conversions.c
@@ -2093,21 +2093,37 @@ static short constraints_list_needinv(ListBase *list)
static void ObjectToTransData(TransData *td, Object *ob)
{
Object *track;
+ ListBase fakecons = {NULL, NULL};
float obmtx[3][3];
+ short constinv;
/* axismtx has the real orientation */
Mat3CpyMat4(td->axismtx, ob->obmat);
Mat3Ortho(td->axismtx);
- /* hack: tempolarily disable tracking when getting object matrix,
- * to stop it from screwing up space conversion matrix later
+ /* hack: tempolarily disable tracking and/or constraints when getting
+ * object matrix, if tracking is on, or if constraints don't need
+ * inverse correction to stop it from screwing up space conversion
+ * matrix later
*/
- if (ob->track) {
+ constinv= constraints_list_needinv(&ob->constraints);
+ if (ob->track || constinv==0) {
track= ob->track;
ob->track= NULL;
+ if (constinv == 0) {
+ fakecons.first = ob->constraints.first;
+ fakecons.last = ob->constraints.last;
+ ob->constraints.first = ob->constraints.last = NULL;
+ }
+
where_is_object(ob);
+ if (constinv == 0) {
+ ob->constraints.first = fakecons.first;
+ ob->constraints.last = fakecons.last;
+ }
+
ob->track= track;
}
else
@@ -2129,7 +2145,7 @@ static void ObjectToTransData(TransData *td, Object *ob)
VECCOPY(td->center, ob->obmat[3]);
/* is there a need to set the global<->data space conversion matrices? */
- if (ob->parent || constraints_list_needinv(&ob->constraints)) {
+ if (ob->parent || constinv) {
float totmat[3][3], obinv[3][3];
/* Get the effect of parenting, and/or certain constraints.