diff --git a/CHANGELOG.md b/CHANGELOG.md index 50714bcd..9e3a04ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/addon/flamenco/__init__.py b/addon/flamenco/__init__.py index 4baf7ed9..8b7131e6 100644 --- a/addon/flamenco/__init__.py +++ b/addon/flamenco/__init__.py @@ -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() diff --git a/addon/flamenco/gui.py b/addon/flamenco/gui.py index 720f0ec1..b0ccad88 100644 --- a/addon/flamenco/gui.py +++ b/addon/flamenco/gui.py @@ -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() diff --git a/addon/flamenco/job_submission.py b/addon/flamenco/job_submission.py index f201f665..8f66e195 100644 --- a/addon/flamenco/job_submission.py +++ b/addon/flamenco/job_submission.py @@ -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(),