Add Blender plugin (#134)

* Unbind hostname to allow localhost submissions

* Fix issue where multiple cameras were outputting to the same directory

* Add Blender plugin
This commit is contained in:
2026-06-06 14:32:48 -05:00
committed by GitHub
parent f0be78adcc
commit b8b71d1e16
8 changed files with 856 additions and 5 deletions
+62
View File
@@ -56,8 +56,70 @@ class TestCreateRenderJob:
assert result == worker
assert worker.status == RenderStatus.NOT_STARTED
assert mock_create_worker.call_args.kwargs['output_path'] == project_path.parent.parent / 'output' / 'test_project'
mock_add.assert_called_once_with(worker, force_start=False)
@patch('src.distributed_job_manager.os.makedirs')
@patch('src.distributed_job_manager.EngineManager.create_worker')
def test_uses_requested_output_path(
self, mock_create_worker, mock_makedirs, distributed_job_manager_instance,
config_instance, tmp_path,
):
worker = MagicMock()
worker.total_frames = 10
worker.parent = None
mock_create_worker.return_value = worker
project_path = tmp_path / 'test_project.blend'
project_path.write_text('fake')
attrs = {
'engine_name': 'blender',
'args': {},
'name': 'Camera Job',
'output_path': 'test_project_Camera-001',
'enable_split_jobs': False,
}
with patch('src.distributed_job_manager.RenderQueue.add_to_render_queue'):
with patch('src.distributed_job_manager.PreviewManager.update_previews_for_job'):
DistributedJobManager.create_render_job(attrs, project_path)
assert mock_create_worker.call_args.kwargs['output_path'] == (
project_path.parent.parent / 'output' / 'test_project_Camera-001'
)
@patch('src.distributed_job_manager.os.makedirs')
@patch('src.distributed_job_manager.EngineManager.create_worker')
def test_uses_output_subdir_when_requested(
self, mock_create_worker, mock_makedirs, distributed_job_manager_instance,
config_instance, tmp_path,
):
worker = MagicMock()
worker.total_frames = 10
worker.parent = None
mock_create_worker.return_value = worker
project_path = tmp_path / 'test_project.blend'
project_path.write_text('fake')
attrs = {
'engine_name': 'blender',
'args': {},
'name': 'Camera Job',
'output_path': 'test_project_Camera-001',
'__use_output_subdir': True,
'enable_split_jobs': False,
}
with patch('src.distributed_job_manager.RenderQueue.add_to_render_queue'):
with patch('src.distributed_job_manager.PreviewManager.update_previews_for_job'):
DistributedJobManager.create_render_job(attrs, project_path)
expected_output_dir = project_path.parent.parent / 'output' / 'test_project_Camera-001'
assert mock_create_worker.call_args.kwargs['output_path'] == expected_output_dir / 'test_project_Camera-001'
mock_makedirs.assert_called_with(expected_output_dir, exist_ok=True)
@patch('src.distributed_job_manager.os.makedirs')
@patch('src.distributed_job_manager.EngineManager.create_worker')
def test_split_jobs_enabled_calls_split_async(