mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
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.
This commit is contained in:
parent
b148ac5cf7
commit
2dac8b3ee0
5 changed files with 94 additions and 36 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue