diff --git a/addon/flamenco/gui.py b/addon/flamenco/gui.py index abad6c86..b0c2a7ff 100644 --- a/addon/flamenco/gui.py +++ b/addon/flamenco/gui.py @@ -126,6 +126,7 @@ class FLAMENCO_PT_job_submission(bpy.types.Panel): props = layout.operator("flamenco.eval_setting", text="", icon="SCRIPTPLUGINS") props.setting_key = setting.key props.setting_eval = setting_eval + props.eval_description = job_types.eval_description(setting) def draw_setting_readonly( self, diff --git a/addon/flamenco/job_types.py b/addon/flamenco/job_types.py index b693d9ca..8150a953 100644 --- a/addon/flamenco/job_types.py +++ b/addon/flamenco/job_types.py @@ -91,6 +91,17 @@ def show_eval_on_submit_button(setting: _AvailableJobSetting) -> bool: return show_button +def eval_description(setting: _AvailableJobSetting) -> str: + """Return the 'eval description' of this setting, or an empty string if not found.""" + + eval_info = setting.get("eval_info", None) + if not eval_info: + return "" + + description: str = eval_info.get("description", "") + return description + + def setting_autoeval_propname(setting: _AvailableJobSetting) -> str: """Return the property name of the 'auto-eval' state for this setting.""" return f"autoeval_{setting.key}" diff --git a/addon/flamenco/operators.py b/addon/flamenco/operators.py index 0b6c883b..cefc33ed 100644 --- a/addon/flamenco/operators.py +++ b/addon/flamenco/operators.py @@ -143,6 +143,14 @@ class FLAMENCO_OT_eval_setting(FlamencoOpMixin, bpy.types.Operator): setting_key: bpy.props.StringProperty(name="Setting Key") # type: ignore setting_eval: bpy.props.StringProperty(name="Python Expression") # type: ignore + eval_description: bpy.props.StringProperty(name="Description", options={"HIDDEN"}) + + @classmethod + def description(cls, context, properties): + if not properties.eval_description: + return "" # Causes bl_description to be shown. + return f"Set value to: {properties.eval_description}" + def execute(self, context: bpy.types.Context) -> set[str]: job = job_submission.job_for_scene(context.scene) if job is None: