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:
authorJanne Karhu <jhkarh@gmail.com>2010-09-24 21:47:28 +0400
committerJanne Karhu <jhkarh@gmail.com>2010-09-24 21:47:28 +0400
commit3567eebcc20acbefd393fb8263cd2b750bcf8a93 (patch)
tree8272f35cdbfb6168c8d6d36dbd253ef8f5121112 /source/blender/blenkernel/intern/constraint.c
parentb0f4c3c88329acefab76b248a3c9ef54ca1e6de1 (diff)
Fix for [#23549] Copy rotation don't work if influence is another than 0 or 1
* Replaced constraint result interpolation with much simpler logic, hopefully this doesn't create any unseen complications :)
Diffstat (limited to 'source/blender/blenkernel/intern/constraint.c')
-rw-r--r--source/blender/blenkernel/intern/constraint.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index dd32d22d09f..cec552b8124 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -4409,7 +4409,7 @@ void solve_constraints (ListBase *conlist, bConstraintOb *cob, float ctime)
}
}
- /* Solve the constraint */
+ /* Solve the constraint and put result in cob->matrix */
cti->evaluate_constraint(con, cob, &targets);
/* clear targets after use
@@ -4421,23 +4421,13 @@ void solve_constraints (ListBase *conlist, bConstraintOb *cob, float ctime)
}
/* Interpolate the enforcement, to blend result of constraint into final owner transform */
- /* 1. Remove effects of original matrix from constraint solution ==> delta */
- invert_m4_m4(imat, oldmat);
- copy_m4_m4(solution, cob->matrix);
- mul_m4_m4m4(delta, solution, imat);
-
- /* 2. If constraint influence is not full strength, then interpolate
- * identity_matrix --> delta_matrix to get the effect the constraint actually exerts
- */
+ /* Note: all kind of stuff here before (caused trouble), much easier to just interpolate, or did I miss something? -jahka */
if (enf < 1.0) {
- float identity[4][4];
- unit_m4(identity);
- blend_m4_m4m4(delta, identity, delta, enf);
+ float solution[4][4];
+ copy_m4_m4(solution, cob->matrix);
+ blend_m4_m4m4(cob->matrix, oldmat, solution, enf);
}
- /* 3. Now multiply the delta by the matrix in use before the evaluation */
- mul_m4_m4m4(cob->matrix, delta, oldmat);
-
/* move owner back into worldspace for next constraint/other business */
if ((con->flag & CONSTRAINT_SPACEONCE) == 0)
constraint_mat_convertspace(cob->ob, cob->pchan, cob->matrix, con->ownspace, CONSTRAINT_SPACE_WORLD);