Changeset View
Changeset View
Standalone View
Standalone View
tests/python/bl_alembic_import_test.py
| Show First 20 Lines • Show All 188 Lines • ▼ Show 20 Lines | def test_change_path_modifier(self): | ||||
| # Check that the file loaded ok. | # Check that the file loaded ok. | ||||
| bpy.context.scene.frame_set(6) | bpy.context.scene.frame_set(6) | ||||
| scene = bpy.context.scene | scene = bpy.context.scene | ||||
| plane_eval = plane.evaluated_get(depsgraph) | plane_eval = plane.evaluated_get(depsgraph) | ||||
| mesh = plane_eval.to_mesh() | mesh = plane_eval.to_mesh() | ||||
| self.assertAlmostEqual(-1, mesh.vertices[0].co.x) | self.assertAlmostEqual(-1, mesh.vertices[0].co.x) | ||||
| self.assertAlmostEqual(-1, mesh.vertices[0].co.y) | self.assertAlmostEqual(-1, mesh.vertices[0].co.y) | ||||
| self.assertAlmostEqual(0.5905638933181763, mesh.vertices[0].co.z) | self.assertAlmostEqual(0.5905638933181763, mesh.vertices[0].co.z) | ||||
| plane_eval.to_mesh_clear() | |||||
| # Change path from absolute to relative. This should not break the animation. | # Change path from absolute to relative. This should not break the animation. | ||||
| scene.frame_set(1) | scene.frame_set(1) | ||||
| bpy.data.cache_files[fname].filepath = relpath | bpy.data.cache_files[fname].filepath = relpath | ||||
| scene.frame_set(6) | scene.frame_set(6) | ||||
| plane_eval = plane.evaluated_get(depsgraph) | plane_eval = plane.evaluated_get(depsgraph) | ||||
| mesh = plane_eval.to_mesh() | mesh = plane_eval.to_mesh() | ||||
| self.assertAlmostEqual(1, mesh.vertices[3].co.x) | self.assertAlmostEqual(1, mesh.vertices[3].co.x) | ||||
| self.assertAlmostEqual(1, mesh.vertices[3].co.y) | self.assertAlmostEqual(1, mesh.vertices[3].co.y) | ||||
| self.assertAlmostEqual(0.5905638933181763, mesh.vertices[3].co.z) | self.assertAlmostEqual(0.5905638933181763, mesh.vertices[3].co.z) | ||||
| plane_eval.to_mesh_clear() | |||||
| 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( | ||||
| filepath=str(self.testdir / "long-names.abc"), | filepath=str(self.testdir / "long-names.abc"), | ||||
| as_background_job=False) | as_background_job=False) | ||||
| self.assertIn('Cube', bpy.data.objects) | self.assertIn('Cube', bpy.data.objects) | ||||
| ▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines | |||||