Let a duplicated node's pins reset to the original's default [patch] - #518
Merged
Merged
Conversation
…opies DuplicateNodes wrote each copy's value but never seeded its default, so ResetPinValue returned false on every pin of a duplicated node. Copy the original's seeded default across first, and keep a null value the original holds rather than letting the seed stand in for it. Fixes #476 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018AK9FUHZoZnfAL1aQuEtAR
|
This was referenced Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #476
What was wrong
NodeEditorEngine.DuplicateNodesgave each copied pin a new id and wrote the original's current value to it, but never seeded a default for it inPinValueStore.PinValueStore.Resetonly works on a pin that has a seeded default, soResetPinValuereturnedfalseand did nothing on every pin of a duplicated node. Copies of factory-bound nodes had the same problem, and undo/redo kept it becauseCaptureNoderecordedHasDefault = false.Change
pinValues.TryGetDefault) is seeded onto the copy.nullover a non-null default, the copy's value is put back tonullso the seed doesn't replace it.DuplicateNodesremarks now say that a copied pin resets to the original's default.Tests
DuplicateNode_CopiedPinResetsToTheOriginalsDefaultis the issue's repro on a spec-created node. The copy arrives with 42, the reset returns true and gives 5, and the original is unchanged.DuplicateNode_CarriesANullValueOverANonNullDefault: anullon the original is stillnullon the copy, and a reset gives the default back.ResetPinValue_OnACopyOfABoundNode_PutsTheOriginalsDefaultBackcovers a factory-boundTunableNode: the copy resets to 128 and the original's instance keeps 200.With the
NodeEditorEngine.cschange reverted, all three new tests fail on theResetPinValueassertion. With the change in place, all 269 tests inImGui.NodeEditor.Testspass on net10.0.🤖 Generated with Claude Code
https://claude.ai/code/session_018AK9FUHZoZnfAL1aQuEtAR
Generated by Claude Code