diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-02-25 17:44:21 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-02-25 19:22:23 +0300 |
commit | 4f4817943704e8bfddf366d01cf958dc0cce0ac6 (patch) | |
tree | 080965a72d942479f304e9b1b506f52a67b93f6f /tests/python/bl_constraints.py | |
parent | 65aa55babc57232c83cf14b7e74ecefa2c4ac3ba (diff) |
Constraints: fixed Object Solver 'Clear Inverse' operator
The 'Clear Inverse' operator didn't properly update the constraint, so
it didn't do anything until the entire depsgraph was updated. It's now
properly tagged for update.
Diffstat (limited to 'tests/python/bl_constraints.py')
-rw-r--r-- | tests/python/bl_constraints.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/python/bl_constraints.py b/tests/python/bl_constraints.py index 21e3fad3be8..42f81bddce6 100644 --- a/tests/python/bl_constraints.py +++ b/tests/python/bl_constraints.py @@ -188,6 +188,33 @@ class ChildOfTest(AbstractConstraintTests): bpy.ops.constraint.childof_clear_inverse(context, constraint='Child Of') self.matrix_test('Child Of.armature.owner', initial_matrix) + +class ObjectSolverTest(AbstractConstraintTests): + layer_collection = 'Object Solver' + + def test_simple_parent(self): + """Object Solver: simple evaluation of parent.""" + initial_matrix = Matrix(( + (-0.970368504524231, 0.03756079450249672, -0.23869234323501587, -0.681557297706604), + (-0.24130365252494812, -0.2019258439540863, 0.9492092132568359, 6.148940086364746), + (-0.012545102275907993, 0.9786801934242249, 0.20500603318214417, 2.2278831005096436), + (0.0, 0.0, 0.0, 1.0), + )) + self.matrix_test('Object Solver.owner', initial_matrix) + + context = self.constraint_context('Object Solver') + bpy.ops.constraint.objectsolver_set_inverse(context, constraint='Object Solver') + self.matrix_test('Object Solver.owner', Matrix(( + (0.9992386102676392, 0.019843988120555878, -0.03359176218509674, 0.10000000149011612), + (-0.017441775649785995, 0.997369647026062, 0.0703534483909607, 0.20000000298023224), + (0.03489949554204941, -0.06971397995948792, 0.9969563484191895, 0.30000001192092896), + (0.0, 0.0, 0.0, 1.0), + ))) + + bpy.ops.constraint.objectsolver_clear_inverse(context, constraint='Object Solver') + self.matrix_test('Object Solver.owner', initial_matrix) + + def main(): global args import argparse |