Blender Git Loki

Git Commits -> Revision 10162d6

Revision 10162d6 by Sybren A. Stüvel (master)
February 27, 2020, 09:37 (GMT)
Constraints: replace 'Set Inverse' operator with an eval-time update

This fixes {T70269}.

Before this commit there was complicated code to try and compute the
correct parent inverse matrix for the 'Child Of' and 'Object Solver'
constraints outside the constraint evaluation. This was done mostly
correctly, but did have some issues. The Set Inverse operator now defers
this computation to be performed during constraint evaluation by just
setting a flag. If the constraint is disabled, and thus tagging it for
update in the depsgraph is not enough to trigger immediate evaluation,
evaluation is forced by temporarily enabling it.

This fix changes the way how the inverse matrix works when some of the
channels of the constraint are disabled. Before this commit, the channel
flags were used to filter both the parent and the inverse matrix. This
meant that it was impossible to make an inverse matrix that would
actually fully neutralize the effect of the constraint. Now only the
parent matrix is filtered, while inverse is applied fully. As a result,
pressing the 'Set Inverse' matrix produces the same transformation as
disabling the constraint. This is also reflected in the changed values
in the 'Child Of' unit test.

This change is not backward compatible, but it should be OK because the
old way was effectively unusable, so it is unlikely anybody relied on
it.

The change in matrix for the Object Solver constraint is due to a
different method of computing it, which caused a slightly different
floating point error that was slightly bigger than allowed by the test,
so I updated the matrix values there as well.

This patch was original written by @angavrilov and subsequently updated
by me.

Differential Revision: https://developer.blender.org/D6091

Commit Details:

Full Hash: 10162d68e38514aa8741cf9efd9e0f5deac32085
Parent Commit: 4952fb1
Lines Changed: +135, -181

5 Modified Paths:

/source/blender/blenkernel/intern/constraint.c (+67, -61) (Diff)
/source/blender/editors/object/object_constraint.c (+22, -114) (Diff)
/source/blender/makesdna/DNA_constraint_types.h (+4, -0) (Diff)
/source/blender/makesrna/intern/rna_constraint.c (+13, -0) (Diff)
/tests/python/bl_constraints.py (+29, -6) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021