From ea81cc57690f08db13d2fd43deca14652b38e66c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 13 Feb 2019 15:17:50 +0100 Subject: [PATCH] Flamenco: Name render jobs just 'thefile' instead of 'Render thefile.flamenco.blend' This makes the job list on Flamenco Server cleaner. --- CHANGELOG.md | 2 ++ blender_cloud/flamenco/__init__.py | 14 +++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67ccaba..aead804 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ preferences and and then be available on the Flamenco Render panel. Pressing the button will silently close Blender after the job has been submitted to Flamenco (for example to click, walk away, and free up memory for when the same machine is part of the render farm). +- Flamenco: Name render jobs just 'thefile' instead of 'Render thefile.flamenco.blend'. + This makes the job overview on Flamenco Server cleaner. ## Version 1.11.1 (2019-01-04) diff --git a/blender_cloud/flamenco/__init__.py b/blender_cloud/flamenco/__init__.py index 8e42868..3fbd3fd 100644 --- a/blender_cloud/flamenco/__init__.py +++ b/blender_cloud/flamenco/__init__.py @@ -333,13 +333,14 @@ class FLAMENCO_OT_render(async_loop.AsyncModalOperatorMixin, context.window_manager.flamenco_status = 'COMMUNICATING' project_id = prefs.project.project + job_name = self._make_job_name(filepath) try: job_info = await create_job(self.user_id, project_id, manager_id, scene.flamenco_render_job_type, settings, - 'Render %s' % filepath.name, + job_name, priority=scene.flamenco_render_job_priority, start_paused=scene.flamenco_start_paused) except Exception as ex: @@ -415,6 +416,17 @@ class FLAMENCO_OT_render(async_loop.AsyncModalOperatorMixin, self.quit() + def _make_job_name(self, filepath: Path) -> str: + """Turn a file to render into the render job name.""" + + job_name = filepath.name + if job_name.endswith('.blend'): + job_name = job_name[:-6] + if job_name.endswith('.flamenco'): + job_name = job_name[:-9] + + return job_name + def validate_job_settings(self, context, settings: dict) -> bool: """Perform settings validations for the selected job type.