diff options
Diffstat (limited to 'tests/python/bl_constraints.py')
-rw-r--r-- | tests/python/bl_constraints.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/python/bl_constraints.py b/tests/python/bl_constraints.py index 2a48ffe35ea..21e3fad3be8 100644 --- a/tests/python/bl_constraints.py +++ b/tests/python/bl_constraints.py @@ -31,9 +31,19 @@ from mathutils import Matrix class AbstractConstraintTests(unittest.TestCase): """Useful functionality for constraint tests.""" + layer_collection = '' # When set, this layer collection will be enabled. + def setUp(self): bpy.ops.wm.open_mainfile(filepath=str(args.testdir / "constraints.blend")) + # This allows developers to disable layer collections and declutter the + # 3D Viewport while working in constraints.blend, without influencing + # the actual unit tests themselves. + if self.layer_collection: + top_collection = bpy.context.view_layer.layer_collection + collection = top_collection.children[self.layer_collection] + collection.exclude = False + def assert_matrix(self, actual_matrix, expect_matrix, object_name: str, places=6, delta=None): """Asserts that the matrices almost equal.""" self.assertEqual(len(actual_matrix), 4, 'Expected a 4x4 matrix') @@ -76,6 +86,8 @@ class AbstractConstraintTests(unittest.TestCase): class ChildOfTest(AbstractConstraintTests): + layer_collection = 'Child Of' + def test_object_simple_parent(self): """Child Of: simple evaluation of object parent.""" initial_matrix = Matrix(( |