Flamenco: Name render jobs just 'thefile' instead of 'Render thefile.flamenco.blend'

This makes the job list on Flamenco Server cleaner.
This commit is contained in:
Sybren A. Stüvel 2019-02-13 15:17:50 +01:00
parent 25b6053836
commit ea81cc5769
2 changed files with 15 additions and 1 deletions

View File

@ -12,6 +12,8 @@
preferences and and then be available on the Flamenco Render panel. Pressing the button will 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, 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). 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) ## Version 1.11.1 (2019-01-04)

View File

@ -333,13 +333,14 @@ class FLAMENCO_OT_render(async_loop.AsyncModalOperatorMixin,
context.window_manager.flamenco_status = 'COMMUNICATING' context.window_manager.flamenco_status = 'COMMUNICATING'
project_id = prefs.project.project project_id = prefs.project.project
job_name = self._make_job_name(filepath)
try: try:
job_info = await create_job(self.user_id, job_info = await create_job(self.user_id,
project_id, project_id,
manager_id, manager_id,
scene.flamenco_render_job_type, scene.flamenco_render_job_type,
settings, settings,
'Render %s' % filepath.name, job_name,
priority=scene.flamenco_render_job_priority, priority=scene.flamenco_render_job_priority,
start_paused=scene.flamenco_start_paused) start_paused=scene.flamenco_start_paused)
except Exception as ex: except Exception as ex:
@ -415,6 +416,17 @@ class FLAMENCO_OT_render(async_loop.AsyncModalOperatorMixin,
self.quit() 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: def validate_job_settings(self, context, settings: dict) -> bool:
"""Perform settings validations for the selected job type. """Perform settings validations for the selected job type.