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
diff options
context:
space:
mode:
authorMartin Poirier <theeth@yahoo.com>2004-04-04 21:23:51 +0400
committerMartin Poirier <theeth@yahoo.com>2004-04-04 21:23:51 +0400
commit09b19aead2842b904406c657b5444673c51910ad (patch)
tree0fb235b2ba177902ba9669e98235699aec184f77
parent9bb2ad02ad0c1f15d9326b308bd07ddf701fcfa1 (diff)
Revert the changes I did in solve_constraints.
The real bug is in the matrices blending function which doesn't handle non-uniform scaling correctly. I've minimized the occurence of the bug by calling the blending function only when the influence is smaller than one (woah, optimisation AND bug fix!) This should make the bug disappear approximatly 90% of the time since people don't use influence all that often (also, this only applies to constraint that are alone, not using influence IPOs to switch between two constraints). I'd solve the blending function bug, but I haven't had much time to dig into it really. Incidently, by reverting to the previous code, this solves bug #1069 http://projects.blender.org/tracker/index.php?func=detail&aid=1069&group_id=9&atid=125
-rw-r--r--source/blender/blenkernel/intern/object.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index ffc8dcd4362..55e939e0d6d 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1465,7 +1465,6 @@ void solve_constraints (Object *ob, short obtype, void *obdata, float ctime)
}
/* Check this constraint only if it has some enforcement */
- // if (con->enforce > 0)
if (!(con->flag & CONSTRAINT_DISABLE))
{
if (con->enforce==0)
@@ -1473,7 +1472,6 @@ void solve_constraints (Object *ob, short obtype, void *obdata, float ctime)
enf = con->enforce;
/* Get the targetmat */
- //get_constraint_target(con, obtype, obdata, tmat, size, ctime - ob->sf);
get_constraint_target(con, obtype, obdata, tmat, size, ctime);
Mat4CpyMat4(focusmat, tmat);
@@ -1537,14 +1535,16 @@ void solve_constraints (Object *ob, short obtype, void *obdata, float ctime)
evaluate_constraint(con, ob, obtype, obdata, lastmat);
Mat4CpyMat4 (solution, ob->obmat);
-
+
/* Interpolate the enforcement */
Mat4Invert (imat, oldmat);
- Mat4MulMat4 (delta, imat, solution);
+ Mat4MulMat4 (delta, solution, imat);
- Mat4One(identity);
- Mat4BlendMat4(delta, identity, delta, a);
- Mat4MulMat4 (ob->obmat, oldmat, delta);
+ if (a<1.0) {
+ Mat4One(identity);
+ Mat4BlendMat4(delta, identity, delta, a);
+ }
+ Mat4MulMat4 (ob->obmat, delta, oldmat);
}
else{