Skip to content

Load Backdrop: Avoid scene connections breaking to selected nodes when loading backdrop#251

Open
BigRoy wants to merge 3 commits into
developfrom
bugfix/load_backdrop_do_not_connect_to_selection
Open

Load Backdrop: Avoid scene connections breaking to selected nodes when loading backdrop#251
BigRoy wants to merge 3 commits into
developfrom
bugfix/load_backdrop_do_not_connect_to_selection

Conversation

@BigRoy
Copy link
Copy Markdown
Member

@BigRoy BigRoy commented May 1, 2026

Changelog Description

Fixes issue where the scene may be losing existing connections if loading backdrop. The easiest way to reproduce is to select all nodes in the graph, load the placeholder. Previously it'd essentially break your scene.

Additional review information

Reset selection before creating the NoOp to avoid the selection getting automatically connected to the input of the NoOp (default nuke behavior) + move the logic inside the maintained selection contextlib so that we do actually maintain the users selection as intended. Also, remove some redundant reset_selection calls before explicitly deleting a node (selection should not affect it.)

Testing notes:

  1. Load Placeholder should work.

…ng automatically connected to the input of the NoOp (default nuke behavior) + move the logic inside the maintained selection contextlib so that we do actually maintain the users selection as intended. Also, remove some redundant `reset_selection` calls before explicitly deleting a node (selection should not affect it.)
@BigRoy BigRoy self-assigned this May 1, 2026
@BigRoy BigRoy added type: bug Something isn't working sponsored This is directly sponsored by a client or community member labels May 1, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes Nuke node graph connection breakage when loading a backdrop/placeholder while nodes are selected, by ensuring selection is properly preserved and cleared at the right moments to prevent Nuke’s auto-connect behavior.

Changes:

  • Wrap mouse-position probing (temporary NoOp creation) inside maintained_selection() so the user’s selection is actually restored afterward.
  • Clear selection before creating the temporary NoOp to avoid unintended automatic connections to selected nodes.
  • Remove redundant reset_selection() calls before explicit nuke.delete(node) operations.

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

Copy link
Copy Markdown
Member

@moonyuet moonyuet left a comment

Choose a reason for hiding this comment

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

Works with testing with import backdrop and load placeholder in Nuke 16.0

Comment thread client/ayon_nuke/plugins/workfile_build/load_placeholder.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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


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

Comment thread client/ayon_nuke/plugins/workfile_build/load_placeholder.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sponsored This is directly sponsored by a client or community member type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants