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:
Diffstat (limited to 'tests/python/bl_constraints.py')
-rw-r--r--tests/python/bl_constraints.py64
1 files changed, 64 insertions, 0 deletions
diff --git a/tests/python/bl_constraints.py b/tests/python/bl_constraints.py
index 279c896c6af..a2690fa4e11 100644
--- a/tests/python/bl_constraints.py
+++ b/tests/python/bl_constraints.py
@@ -375,6 +375,70 @@ class CustomSpaceTest(AbstractConstraintTests):
)))
+class CopyTransformsTest(AbstractConstraintTests):
+ layer_collection = 'Copy Transforms'
+
+ def test_mix_mode_object(self):
+ """Copy Transforms: all mix modes for objects"""
+ constraint = bpy.data.objects["Copy Transforms.object.owner"].constraints["Copy Transforms"]
+
+ constraint.mix_mode = 'REPLACE'
+ self.matrix_test('Copy Transforms.object.owner', Matrix((
+ (-0.7818737626075745, 0.14389121532440186, 0.4845699667930603, -0.017531070858240128),
+ (-0.2741589844226837, -0.591389000415802, -1.2397242784500122, -0.08039521425962448),
+ (0.04909384995698929, -1.0109175443649292, 0.7942137122154236, 0.1584688276052475),
+ (0.0, 0.0, 0.0, 1.0)
+ )))
+
+ constraint.mix_mode = 'BEFORE_FULL'
+ self.matrix_test('Copy Transforms.object.owner', Matrix((
+ (-1.0791258811950684, -0.021011866629123688, 0.3120136260986328, 0.9082338809967041),
+ (0.2128538191318512, -0.3411901891231537, -1.7376484870910645, -0.39762523770332336),
+ (-0.03584420680999756, -1.0162957906723022, 0.8004404306411743, -0.9015425443649292),
+ (0.0, 0.0, 0.0, 1.0)
+ )))
+
+ constraint.mix_mode = 'BEFORE'
+ self.matrix_test('Copy Transforms.object.owner', Matrix((
+ (-0.9952367544174194, -0.03077685832977295, 0.05301344022154808, 0.9082338809967041),
+ (-0.013416174799203873, -0.39984768629074097, -1.8665285110473633, -0.39762523770332336),
+ (0.03660336509346962, -0.9833710193634033, 0.75728839635849, -0.9015425443649292),
+ (0.0, 0.0, 0.0, 1.0)
+ )))
+
+ constraint.mix_mode = 'BEFORE_SPLIT'
+ self.matrix_test('Copy Transforms.object.owner', Matrix((
+ (-0.9952367544174194, -0.03077685832977295, 0.05301344022154808, -1.0175310373306274),
+ (-0.013416174799203873, -0.39984768629074097, -1.8665285110473633, 0.9196047782897949),
+ (0.03660336509346962, -0.9833710193634033, 0.75728839635849, 0.1584688276052475),
+ (0.0, 0.0, 0.0, 1.0)
+ )))
+
+ constraint.mix_mode = 'AFTER_FULL'
+ self.matrix_test('Copy Transforms.object.owner', Matrix((
+ (-0.8939255475997925, -0.2866469621658325, 0.7563635110855103, -0.964445173740387),
+ (-0.09460853785276413, -0.73727947473526, -1.0267245769500732, 0.9622588753700256),
+ (0.37042146921157837, -1.1893107891082764, 1.0113294124603271, 0.21314144134521484),
+ (0.0, 0.0, 0.0, 1.0)
+ )))
+
+ constraint.mix_mode = 'AFTER'
+ self.matrix_test('Copy Transforms.object.owner', Matrix((
+ (-0.9033845067024231, -0.2048732340335846, 0.7542480826377869, -0.964445173740387),
+ (-0.1757974475622177, -0.6721230745315552, -1.5190268754959106, 0.9622588753700256),
+ (0.38079890608787537, -0.7963172793388367, 1.0880682468414307, 0.21314144134521484),
+ (0.0, 0.0, 0.0, 1.0)
+ )))
+
+ constraint.mix_mode = 'AFTER_SPLIT'
+ self.matrix_test('Copy Transforms.object.owner', Matrix((
+ (-0.9033845067024231, -0.2048732340335846, 0.7542480826377869, -1.0175310373306274),
+ (-0.1757974475622177, -0.6721230745315552, -1.5190268754959106, 0.9196047782897949),
+ (0.38079890608787537, -0.7963172793388367, 1.0880682468414307, 0.1584688276052475),
+ (0.0, 0.0, 0.0, 1.0)
+ )))
+
+
def main():
global args
import argparse