Alembic import: added unit test for mesh deformation.
This commit is contained in:
@@ -85,7 +85,7 @@ class SimpleImportTest(unittest.TestCase):
|
|||||||
for ob in bpy.data.objects:
|
for ob in bpy.data.objects:
|
||||||
self.assertEqual('Cube' in ob.name, ob.select)
|
self.assertEqual('Cube' in ob.name, ob.select)
|
||||||
|
|
||||||
def test_change_path(self):
|
def test_change_path_constraint(self):
|
||||||
import math
|
import math
|
||||||
|
|
||||||
fname = 'cube-rotating1.abc'
|
fname = 'cube-rotating1.abc'
|
||||||
@@ -122,6 +122,32 @@ class SimpleImportTest(unittest.TestCase):
|
|||||||
self.assertAlmostEqual(y, 0)
|
self.assertAlmostEqual(y, 0)
|
||||||
self.assertAlmostEqual(z, 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):
|
def test_import_long_names(self):
|
||||||
# This file contains very long names. The longest name is 4047 chars.
|
# This file contains very long names. The longest name is 4047 chars.
|
||||||
bpy.ops.wm.alembic_import(
|
bpy.ops.wm.alembic_import(
|
||||||
|
Reference in New Issue
Block a user