Use new property names for 'use automatic values' button

Adjustment of the job settings property names, making them more widely
usable than just the 'use automatic values' button (also known as
'eval-on-submit').
This commit is contained in:
Sybren A. Stüvel 2023-07-13 15:02:00 +02:00
parent 4b53c06467
commit 6994413ed6
3 changed files with 9 additions and 8 deletions

View File

@ -152,7 +152,7 @@ class FLAMENCO_PT_job_submission(bpy.types.Panel):
split.label(text=label)
row = split.row(align=True)
row.label(text=setting.eval_on_submit.placeholder)
row.label(text=getattr(setting.eval_info, "description") or "")
row.prop(
propgroup,
job_types.setting_autoeval_propname(setting),

View File

@ -83,11 +83,11 @@ def setting_should_autoeval(
def show_eval_on_submit_button(setting: _AvailableJobSetting) -> bool:
"""Return whether this setting should show the 'eval on submit' toggle button."""
eval_on_submit = setting.get("eval_on_submit", None)
if not eval_on_submit:
eval_info = setting.get("eval_info", None)
if not eval_info:
return False
show_button: bool = eval_on_submit.get("show_button", False)
show_button: bool = eval_info.get("show_link_button", False)
return show_button

View File

@ -4,10 +4,11 @@ const JOB_TYPE = {
label: "Simple Blender Render",
settings: [
// Settings for artists to determine:
{ key: "frames", type: "string", required: true, eval: "f'{C.scene.frame_start}-{C.scene.frame_end}'",
evalOnSubmit: {
showButton: true,
placeholder: "Scene frame range",
{ key: "frames", type: "string", required: true,
eval: "f'{C.scene.frame_start}-{C.scene.frame_end}'",
evalInfo: {
showLinkButton: true,
description: "Scene frame range",
},
description: "Frame range to render. Examples: '47', '1-30', '3, 5-10, 47-327'" },
{ key: "chunk_size", type: "int32", default: 1, description: "Number of frames to render in one Blender render task",