Skip to content

fix: reject incompatible default_value types for numeric/bool gizmo knobs#82

Merged
feltech merged 1 commit into
mainfrom
fix/issue-77-incompatible-default-values
Jun 17, 2026
Merged

fix: reject incompatible default_value types for numeric/bool gizmo knobs#82
feltech merged 1 commit into
mainfrom
fix/issue-77-incompatible-default-values

Conversation

@feltech

@feltech feltech commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Closes #77.

Dynamically added parameters on Nuke Start/End Flow nodes have default_value="" which is invalid for int/float/bool knobs. Passing this to add_int_knob etc. wrote an empty default line that broke Nuke's TCL parser.

Guard each knob branch with isinstance so only correctly-typed defaults are emitted. Mismatched types (including empty strings) are silently dropped.

@feltech feltech self-assigned this Jun 17, 2026
@feltech feltech requested a review from Copilot June 17, 2026 13:56
@feltech feltech force-pushed the fix/issue-77-incompatible-default-values branch from ec0e27a to 6f9dde5 Compare June 17, 2026 13:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses Nuke .gizmo generation failures caused by emitting invalid default-value lines for numeric/bool knobs (notably when workflow params have default_value=""), by filtering defaults based on type and adding regression tests around the behavior.

Changes:

  • Add type-guards in NukeGizmoBuilder._write_input_knob so only correctly-typed defaults are written for bool/float/int knobs.
  • Add unit tests covering empty-string defaults, None defaults, valid defaults, and mismatched default types for numeric/bool knobs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
publish_gizmo/nuke_gizmo_builder.py Adds type checks before emitting defaults for bool/float/int knobs to prevent malformed gizmo output.
tests/unit/test_nuke_gizmo_builder.py Introduces regression tests to ensure invalid defaults don’t emit value lines and valid defaults remain preserved.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread publish_gizmo/nuke_gizmo_builder.py Outdated
Comment thread tests/unit/test_nuke_gizmo_builder.py
Closes #77.

Dynamically added parameters on Nuke Start/End Flow nodes have
default_value="" which is invalid for int/float/bool knobs. Passing
this to add_int_knob etc. wrote an empty default line that broke
Nuke's TCL parser.

Guard each knob branch with isinstance so only correctly-typed
defaults are emitted. Mismatched types (including empty strings)
are silently dropped.
@feltech feltech force-pushed the fix/issue-77-incompatible-default-values branch from 6f9dde5 to e32b381 Compare June 17, 2026 14:15
@feltech feltech merged commit 9e4072a into main Jun 17, 2026
3 checks passed
@feltech feltech deleted the fix/issue-77-incompatible-default-values branch June 17, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Numeric knobs with an empty default render as a broken expression (e.g. Guidance Scale evaluates to 0)

3 participants