forked from bartvdbraak/blender
Fix T51331: fixes for Alembic unit tests on Windows
This commit is contained in:
parent
f383c926b4
commit
1e8d7f3b25
@ -462,7 +462,7 @@ if(WITH_ALEMBIC)
|
|||||||
COMMAND
|
COMMAND
|
||||||
"$<TARGET_FILE_DIR:blender>/${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}/python/bin/python$<$<CONFIG:Debug>:_d>"
|
"$<TARGET_FILE_DIR:blender>/${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}/python/bin/python$<$<CONFIG:Debug>:_d>"
|
||||||
${CMAKE_CURRENT_LIST_DIR}/alembic_tests.py
|
${CMAKE_CURRENT_LIST_DIR}/alembic_tests.py
|
||||||
--blender "${TEST_BLENDER_EXE_BARE}"
|
--blender "$<TARGET_FILE:blender>"
|
||||||
--testdir "${TEST_SRC_DIR}/alembic"
|
--testdir "${TEST_SRC_DIR}/alembic"
|
||||||
--alembic-root "${ALEMBIC_ROOT_DIR}"
|
--alembic-root "${ALEMBIC_ROOT_DIR}"
|
||||||
)
|
)
|
||||||
|
@ -124,6 +124,11 @@ class AbstractAlembicTest(unittest.TestCase):
|
|||||||
coloured_output = proc.stdout
|
coloured_output = proc.stdout
|
||||||
output = self.ansi_remove_re.sub(b'', coloured_output).decode('utf8')
|
output = self.ansi_remove_re.sub(b'', coloured_output).decode('utf8')
|
||||||
|
|
||||||
|
# Because of the ANSI colour codes, we need to remove those first before
|
||||||
|
# decoding to text. This means that we cannot use the universal_newlines
|
||||||
|
# parameter to subprocess.run(), and have to do the conversion ourselves
|
||||||
|
output = output.replace('\r\n', '\n').replace('\r', '\n')
|
||||||
|
|
||||||
if proc.returncode:
|
if proc.returncode:
|
||||||
raise AbcPropError('Error %d running abcls:\n%s' % (proc.returncode, output))
|
raise AbcPropError('Error %d running abcls:\n%s' % (proc.returncode, output))
|
||||||
|
|
||||||
@ -217,7 +222,7 @@ class HierarchicalAndFlatExportTest(AbstractAlembicTest):
|
|||||||
def test_hierarchical_export(self, tempdir: pathlib.Path):
|
def test_hierarchical_export(self, tempdir: pathlib.Path):
|
||||||
abc = tempdir / 'cubes_hierarchical.abc'
|
abc = tempdir / 'cubes_hierarchical.abc'
|
||||||
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
|
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
|
||||||
"renderable_only=True, visible_layers_only=True, flatten=False)" % abc
|
"renderable_only=True, visible_layers_only=True, flatten=False)" % abc.as_posix()
|
||||||
self.run_blender('cubes-hierarchy.blend', script)
|
self.run_blender('cubes-hierarchy.blend', script)
|
||||||
|
|
||||||
# Now check the resulting Alembic file.
|
# Now check the resulting Alembic file.
|
||||||
@ -235,7 +240,7 @@ class HierarchicalAndFlatExportTest(AbstractAlembicTest):
|
|||||||
def test_flat_export(self, tempdir: pathlib.Path):
|
def test_flat_export(self, tempdir: pathlib.Path):
|
||||||
abc = tempdir / 'cubes_flat.abc'
|
abc = tempdir / 'cubes_flat.abc'
|
||||||
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
|
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
|
||||||
"renderable_only=True, visible_layers_only=True, flatten=True)" % abc
|
"renderable_only=True, visible_layers_only=True, flatten=True)" % abc.as_posix()
|
||||||
self.run_blender('cubes-hierarchy.blend', script)
|
self.run_blender('cubes-hierarchy.blend', script)
|
||||||
|
|
||||||
# Now check the resulting Alembic file.
|
# Now check the resulting Alembic file.
|
||||||
@ -256,7 +261,7 @@ class DupliGroupExportTest(AbstractAlembicTest):
|
|||||||
def test_hierarchical_export(self, tempdir: pathlib.Path):
|
def test_hierarchical_export(self, tempdir: pathlib.Path):
|
||||||
abc = tempdir / 'dupligroup_hierarchical.abc'
|
abc = tempdir / 'dupligroup_hierarchical.abc'
|
||||||
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
|
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
|
||||||
"renderable_only=True, visible_layers_only=True, flatten=False)" % abc
|
"renderable_only=True, visible_layers_only=True, flatten=False)" % abc.as_posix()
|
||||||
self.run_blender('dupligroup-scene.blend', script)
|
self.run_blender('dupligroup-scene.blend', script)
|
||||||
|
|
||||||
# Now check the resulting Alembic file.
|
# Now check the resulting Alembic file.
|
||||||
@ -274,7 +279,7 @@ class DupliGroupExportTest(AbstractAlembicTest):
|
|||||||
def test_flat_export(self, tempdir: pathlib.Path):
|
def test_flat_export(self, tempdir: pathlib.Path):
|
||||||
abc = tempdir / 'dupligroup_hierarchical.abc'
|
abc = tempdir / 'dupligroup_hierarchical.abc'
|
||||||
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
|
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
|
||||||
"renderable_only=True, visible_layers_only=True, flatten=True)" % abc
|
"renderable_only=True, visible_layers_only=True, flatten=True)" % abc.as_posix()
|
||||||
self.run_blender('dupligroup-scene.blend', script)
|
self.run_blender('dupligroup-scene.blend', script)
|
||||||
|
|
||||||
# Now check the resulting Alembic file.
|
# Now check the resulting Alembic file.
|
||||||
@ -295,7 +300,7 @@ class CurveExportTest(AbstractAlembicTest):
|
|||||||
def test_export_single_curve(self, tempdir: pathlib.Path):
|
def test_export_single_curve(self, tempdir: pathlib.Path):
|
||||||
abc = tempdir / 'single-curve.abc'
|
abc = tempdir / 'single-curve.abc'
|
||||||
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
|
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
|
||||||
"renderable_only=True, visible_layers_only=True, flatten=False)" % abc
|
"renderable_only=True, visible_layers_only=True, flatten=False)" % abc.as_posix()
|
||||||
self.run_blender('single-curve.blend', script)
|
self.run_blender('single-curve.blend', script)
|
||||||
|
|
||||||
# Now check the resulting Alembic file.
|
# Now check the resulting Alembic file.
|
||||||
@ -318,7 +323,7 @@ class HairParticlesExportTest(AbstractAlembicTest):
|
|||||||
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
|
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
|
||||||
"renderable_only=True, visible_layers_only=True, flatten=False, " \
|
"renderable_only=True, visible_layers_only=True, flatten=False, " \
|
||||||
"export_hair=%r, export_particles=%r, as_background_job=False)" \
|
"export_hair=%r, export_particles=%r, as_background_job=False)" \
|
||||||
% (abc, export_hair, export_particles)
|
% (abc.as_posix(), export_hair, export_particles)
|
||||||
self.run_blender('hair-particles.blend', script)
|
self.run_blender('hair-particles.blend', script)
|
||||||
return abc
|
return abc
|
||||||
|
|
||||||
@ -377,7 +382,7 @@ class LongNamesExportTest(AbstractAlembicTest):
|
|||||||
def test_export_long_names(self, tempdir: pathlib.Path):
|
def test_export_long_names(self, tempdir: pathlib.Path):
|
||||||
abc = tempdir / 'long-names.abc'
|
abc = tempdir / 'long-names.abc'
|
||||||
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
|
script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \
|
||||||
"renderable_only=False, visible_layers_only=False, flatten=False)" % abc
|
"renderable_only=False, visible_layers_only=False, flatten=False)" % abc.as_posix()
|
||||||
self.run_blender('long-names.blend', script)
|
self.run_blender('long-names.blend', script)
|
||||||
|
|
||||||
name_parts = [
|
name_parts = [
|
||||||
|
Loading…
Reference in New Issue
Block a user