[Bf-blender-cvs] [65aa55babc5] master: Tests: Constraints, enable layer collections before testing
Sybren A. Stüvel
noreply at git.blender.org
Tue Feb 25 17:23:33 CET 2020
Commit: 65aa55babc57232c83cf14b7e74ecefa2c4ac3ba
Author: Sybren A. Stüvel
Date: Tue Feb 25 16:46:37 2020 +0100
Branches: master
https://developer.blender.org/rB65aa55babc57232c83cf14b7e74ecefa2c4ac3ba
Tests: Constraints, enable layer collections before testing
In the collections unit test file developers can now disable layer
collections and declutter the 3D Viewport while working in
`constraints.blend`, without influencing the actual unit tests themselves.
===================================================================
M tests/python/bl_constraints.py
===================================================================
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((
More information about the Bf-blender-cvs
mailing list