Add-on: allow setting job priority when submitting

The job priority was always intended to be settable when submitting, and
editable afterwards. This commit implements the former.
This commit is contained in:
Sybren A. Stüvel 2022-08-30 14:51:33 +02:00
parent 87684a0d92
commit db9aca4a37
4 changed files with 13 additions and 1 deletions

View File

@ -14,6 +14,7 @@ bugs in actually-released versions.
embedded `flamenco-3.x.y-xxxx/` directory with all the files (instead of
putting all the files in the root of the tarball).
- Two-way variable replacement now also changes the path separators to the target platform.
- Allow setting priority when submitting a job.
## 3.0-beta1 - released 2022-08-03

View File

@ -129,6 +129,14 @@ def register() -> None:
description="Name of the Flamenco job; an empty name will use the blend file name as job name",
)
bpy.types.Scene.flamenco_job_priority = bpy.props.IntProperty(
name="Flamenco Job Priority",
description="Priority of the render jobs; higher numbers will get higher priority",
default=50,
min=0,
max=100,
)
preferences.register()
operators.register()
gui.register()

View File

@ -41,6 +41,7 @@ class FLAMENCO_PT_job_submission(bpy.types.Panel):
col = layout.column(align=True)
col.prop(context.scene, "flamenco_job_name", text="Job Name")
col.prop(context.scene, "flamenco_job_priority", text="Priority")
layout.separator()

View File

@ -41,10 +41,12 @@ def job_for_scene(scene: bpy.types.Scene) -> Optional[_SubmittedJob]:
settings = propgroup.as_jobsettings()
metadata = JobMetadata()
priority = getattr(scene, "flamenco_job_priority", 50)
job: SubmittedJob = SubmittedJob(
name=scene.flamenco_job_name,
type=propgroup.job_type.name,
priority=50,
priority=priority,
settings=settings,
metadata=metadata,
submitter_platform=platform.system().lower(),