From 2dac8b3ee043d9d50e334c7430dc3aee49a3315e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 19 Apr 2017 14:40:57 +0200 Subject: Alembic import/export: added as_background_job option The ABC_export and ABC_import functions both take a as_background_job parameter, and return a boolean. When as_background_job=true, returns false immediately after scheduling a background job. This was the old behaviour of this function, which makes it very hard for scripts to do something with the data after the import or export completes. When as_background_job=false, performs the export synchronously, and returns true when the export was ok, and false if there were any errors. This allows further processing. The Scene.alembic_export() function is deprecated, and will be removed from Blender 2.8 in favour of calling the bpy.ops.wm.alembic_export() operator. As such, it has been hard-coded to the old background job behaviour. --- tests/python/alembic_tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/python') diff --git a/tests/python/alembic_tests.py b/tests/python/alembic_tests.py index 4af69dd23fb..1cdfd75426a 100755 --- a/tests/python/alembic_tests.py +++ b/tests/python/alembic_tests.py @@ -317,7 +317,8 @@ class HairParticlesExportTest(AbstractAlembicTest): abc = tempdir / 'hair-particles.abc' script = "import bpy; bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1, " \ "renderable_only=True, visible_layers_only=True, flatten=False, " \ - "export_hair=%r, export_particles=%r)" % (abc, export_hair, export_particles) + "export_hair=%r, export_particles=%r, as_background_job=False)" \ + % (abc, export_hair, export_particles) self.run_blender('hair-particles.blend', script) return abc -- cgit v1.2.3