Add-on: Add checkbox to submit jobs in paused
status
#104323
@ -156,6 +156,12 @@ def register() -> None:
|
|||||||
max=100,
|
max=100,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
bpy.types.Scene.flamenco_job_submit_as_paused = bpy.props.BoolProperty(
|
||||||
David-Zhang-10 marked this conversation as resolved
Outdated
|
|||||||
|
name="Flamenco Job Submit as Paused",
|
||||||
|
description="Whether the job is paused initially; Checked sets the job to `paused`, and Unchecked sets the job to `queued`",
|
||||||
David-Zhang-10 marked this conversation as resolved
Outdated
Sybren A. Stüvel
commented
This description is for users of Blender, not for developers. Replace the Python terminology ( 👍 for describing both 'checked' & 'unchecked' cases, often enough people only describe one and leave you to guess what the other meant. My favourite example here is good old DOOM: it had a checkbox "8-bit textures" -- no idea whether un-checking meant 4-bit or 16-bit textures. This description is for users of Blender, not for developers. Replace the Python terminology (`True` and `False`) with what they can see: checked & unchecked.
👍 for describing both 'checked' & 'unchecked' cases, often enough people only describe one and leave you to guess what the other meant. My favourite example here is good old DOOM: it had a checkbox "8-bit textures" -- no idea whether un-checking meant 4-bit or 16-bit textures.
|
|||||||
|
default=False,
|
||||||
|
)
|
||||||
|
|
||||||
preferences.register()
|
preferences.register()
|
||||||
worker_tags.register()
|
worker_tags.register()
|
||||||
operators.register()
|
operators.register()
|
||||||
|
@ -42,6 +42,7 @@ class FLAMENCO_PT_job_submission(bpy.types.Panel):
|
|||||||
col = layout.column(align=True)
|
col = layout.column(align=True)
|
||||||
col.prop(context.scene, "flamenco_job_name", text="Job Name")
|
col.prop(context.scene, "flamenco_job_name", text="Job Name")
|
||||||
col.prop(context.scene, "flamenco_job_priority", text="Priority")
|
col.prop(context.scene, "flamenco_job_priority", text="Priority")
|
||||||
|
col.prop(context.scene, "flamenco_job_submit_as_paused", text="Submit as Paused")
|
||||||
David-Zhang-10 marked this conversation as resolved
Outdated
Sybren A. Stüvel
commented
Make sure you test before committing & pushing ;-) (and yes, I've been here myself as well) Make sure you test before committing & pushing ;-) (and yes, I've been here myself as well)
|
|||||||
|
|
||||||
# Refreshables:
|
# Refreshables:
|
||||||
col = layout.column(align=True)
|
col = layout.column(align=True)
|
||||||
|
@ -33,6 +33,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
def job_for_scene(scene: bpy.types.Scene) -> Optional[_SubmittedJob]:
|
def job_for_scene(scene: bpy.types.Scene) -> Optional[_SubmittedJob]:
|
||||||
from flamenco.manager.models import SubmittedJob, JobMetadata
|
from flamenco.manager.models import SubmittedJob, JobMetadata
|
||||||
|
from flamenco.manager.model.job_status import JobStatus
|
||||||
|
|
||||||
propgroup = getattr(scene, "flamenco_job_settings", None)
|
propgroup = getattr(scene, "flamenco_job_settings", None)
|
||||||
assert isinstance(propgroup, JobTypePropertyGroup), "did not expect %s" % (
|
assert isinstance(propgroup, JobTypePropertyGroup), "did not expect %s" % (
|
||||||
@ -44,6 +45,12 @@ def job_for_scene(scene: bpy.types.Scene) -> Optional[_SubmittedJob]:
|
|||||||
|
|
||||||
priority = getattr(scene, "flamenco_job_priority", 50)
|
priority = getattr(scene, "flamenco_job_priority", 50)
|
||||||
|
|
||||||
|
submit_as_paused = getattr(scene, "flamenco_job_submit_as_paused", False)
|
||||||
|
if submit_as_paused:
|
||||||
|
initial_status = JobStatus("paused")
|
||||||
|
else:
|
||||||
|
initial_status = JobStatus("queued")
|
||||||
|
|
||||||
job: SubmittedJob = SubmittedJob(
|
job: SubmittedJob = SubmittedJob(
|
||||||
name=scene.flamenco_job_name,
|
name=scene.flamenco_job_name,
|
||||||
type=propgroup.job_type.name,
|
type=propgroup.job_type.name,
|
||||||
@ -52,6 +59,7 @@ def job_for_scene(scene: bpy.types.Scene) -> Optional[_SubmittedJob]:
|
|||||||
metadata=metadata,
|
metadata=metadata,
|
||||||
submitter_platform=platform.system().lower(),
|
submitter_platform=platform.system().lower(),
|
||||||
type_etag=propgroup.job_type.etag,
|
type_etag=propgroup.job_type.etag,
|
||||||
|
initial_status=initial_status,
|
||||||
)
|
)
|
||||||
|
|
||||||
worker_tag: str = getattr(scene, "flamenco_worker_tag", "")
|
worker_tag: str = getattr(scene, "flamenco_worker_tag", "")
|
||||||
|
Loading…
Reference in New Issue
Block a user
There's a discrepancy here between the property name (says this should be a status) and its definition (says it's whether the job should be paused or not). Choose one, and use it consistently.
Since this property is used for the GUI as well, and we discussed offering a checkbox 'submit paused', using a
BoolProperty
is the right choice, and the name should change.