Send taxing Blender operations to the background with subprocess
Run blender processes in the background with separate instances of Blender.
Demo of the Background Processor on YouTube
use_blend_file
to False in JobManager.add_job
API call for efficiency)update_job_progress
functionupdate_job_progress
takes one float argument from 0.0 to 1.0update_job_progress
calls judiciously, as the function has a file write costuse_blend_file
to True
in JobManager.add_job
API call (may prove costly for large blend files)passed_data_blocks
parameter of the JobManager.add_job
API callpassed_data_blocks
variablepython_data
variablepython_data
variable should be set to dictionary containing any necessary data to retrieveJobManager.get_retrieved_python_data
API call upon job completion.data_blocks
variabledata_blocks
variable should be set to list of Blend data blocksJobManager.get_retrieved_data_blocks
API call upon job completion.JobManager.get_retrieved_data_blocks(job).objects
dir(JobManager.get_retrieved_data_blocks(job)) = [
'actions',
'armatures',
'brushes',
'cache_files',
'cameras',
'curves',
'fonts',
'grease_pencil',
'groups',
'images',
'ipos',
'lamps',
'lattices',
'linestyles',
'masks',
'materials',
'meshes',
'metaballs',
'movieclips',
'node_groups',
'objects',
'paint_curves',
'palettes',
'particles',
'scenes',
'sounds',
'speakers',
'texts',
'textures',
'worlds',
]
from .job_manager import * # relative JobManager import path (current path assumes script is in same root folder as 'JobManager.py')
job = "/tmp/test_script.py" # REPLACE with path to your background processing script
job_manager = JobManager.get_instance()
job_manager.add_job(job)
classes/job_manager.py
)classes/add_job.py
for an example use of the JobManager class API in a custom operator