diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2017-04-26 17:50:29 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2017-04-26 17:50:29 +0300 |
commit | dc27d31a2100c3272d0dbf293b24131eacaab962 (patch) | |
tree | 1b5349dbad4e520e0c6b874795ed63211f5f95ed /tests/python/bl_alembic_import_test.py | |
parent | 7517cf6bbb989286f9a65b70ceae2e277e111e58 (diff) | |
parent | 6ed15c5a41130b55cb57a43a8a9470a91d38c3d5 (diff) |
Merge commit 'master@6ed15c5a41130b55cb57a43a8a9470a91d38c3d5' into blender2.8
# Conflicts:
# source/blender/alembic/intern/abc_exporter.cc
Diffstat (limited to 'tests/python/bl_alembic_import_test.py')
-rw-r--r-- | tests/python/bl_alembic_import_test.py | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/tests/python/bl_alembic_import_test.py b/tests/python/bl_alembic_import_test.py index e83d38aec63..854a5846361 100644 --- a/tests/python/bl_alembic_import_test.py +++ b/tests/python/bl_alembic_import_test.py @@ -85,7 +85,7 @@ class SimpleImportTest(unittest.TestCase): for ob in bpy.data.objects: self.assertEqual('Cube' in ob.name, ob.select_get()) - def test_change_path(self): + def test_change_path_constraint(self): import math fname = 'cube-rotating1.abc' @@ -122,6 +122,32 @@ class SimpleImportTest(unittest.TestCase): self.assertAlmostEqual(y, 0) self.assertAlmostEqual(z, 0) + def test_change_path_modifier(self): + import math + + fname = 'animated-mesh.abc' + abc = self.testdir / fname + relpath = bpy.path.relpath(str(abc)) + + res = bpy.ops.wm.alembic_import(filepath=str(abc), as_background_job=False) + self.assertEqual({'FINISHED'}, res) + cube = bpy.context.active_object + + # Check that the file loaded ok. + bpy.context.scene.frame_set(6) + self.assertAlmostEqual(-1, cube.data.vertices[0].co.x) + self.assertAlmostEqual(-1, cube.data.vertices[0].co.y) + self.assertAlmostEqual(0.5905638933181763, cube.data.vertices[0].co.z) + + # Change path from absolute to relative. This should not break the animation. + bpy.context.scene.frame_set(1) + bpy.data.cache_files[fname].filepath = relpath + bpy.context.scene.frame_set(6) + + self.assertAlmostEqual(1, cube.data.vertices[3].co.x) + self.assertAlmostEqual(1, cube.data.vertices[3].co.y) + self.assertAlmostEqual(0.5905638933181763, cube.data.vertices[3].co.z) + def test_import_long_names(self): # This file contains very long names. The longest name is 4047 chars. bpy.ops.wm.alembic_import( |