Skip to content

Core - Fix node script and pin bugs found by the tests - #911

Merged
RobertBeekman merged 3 commits into
masterfrom
fix/node-scripts
Oct 24, 2026
Merged

RobertBeekman merged 3 commits into
masterfrom
fix/node-scripts

Conversation

@RobertBeekman

@RobertBeekman RobertBeekman commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Fixes the node script and pin bugs found by the test suite (#907). Each fix flips the test that pinned the old behaviour.

Fixed

  • Nodes from a missing or disabled plugin are kept when a script is saved. Before, saving a profile while a plugin was disabled permanently deleted that plugin's nodes and connections. This includes importing a profile whose activation condition uses nodes from a plugin that isn't installed. The nodes now come back once the plugin is available, like missing brushes and effects already do.
  • Disabling a node provider only removes the nodes it created. It used to also remove nodes of the same type created by another provider that was still enabled.
  • An input connected to two outputs keeps the connection it reads from after saving and loading. It used to keep the last connection, while the input reads from the first one.
  • A node that fails to evaluate sets its outputs to their default values. It used to keep outputting its last good value, so the script carried on with old data. It was also evaluated again for every input reading from it.
  • Numeric conversions are consistent. Converting to long rounds like converting to int does, and ToSByte clamps to -128..127 instead of 0..255.
  • RemoveNode only raises NodeRemoved for nodes that were in the script.
  • Connecting two pins that are already connected no longer adds a second connection.
  • The forgivingEnumMatching option of IsTypeCompatible now decides whether a specific enum matches a pin of any enum.
  • Untyped pins turn null into the default value for value types, like their code comment says.
  • A new InputPin<T> reads its connection right away instead of after its first reset.

Known limitation, left as is

Convert.ToInt32(numeric) and similar calls pick the byte overload, because Numeric converts implicitly to byte. Fixing that means removing implicit conversions, which would break plugins. The test stays and is marked as a known limitation.

Testing

  • Artemis.Core.Tests: 1385 passed
  • Artemis.UI.Shared.Tests: 176 passed

…s from in node scripts

- Saving a script keeps nodes whose plugin is missing, and their connections, so they come back once the plugin is available again
- Loading keeps the first connection of an input, the one it reads from
- Disabling a node provider only removes the nodes it created, not those of another provider registering the same type
- RemoveNode only raises NodeRemoved for nodes that were in the script
- Connecting pins that are already connected no longer adds a second connection
- Untyped pins turn null into the default value for value types, as intended
- A new InputPin<T> reads its connection right away instead of after its first reset
- Matching a specific enum to a pin of any enum now depends on forgivingEnumMatching
- A node that fails to evaluate sets its outputs to their default values, so it is evaluated once per run and old values don't flow on
@RobertBeekman
RobertBeekman marked this pull request as ready for review October 24, 2026 14:19
@RobertBeekman
RobertBeekman merged commit 5ddd50b into master Oct 24, 2026
2 checks passed
@RobertBeekman
RobertBeekman deleted the fix/node-scripts branch October 24, 2026 14:22
RobertBeekman added a commit that referenced this pull request Oct 27, 2026
)

A node that failed to evaluate reset its outputs to their default values, so a node breaking for a few frames made
everything after it jump to defaults. It now keeps the outputs of its last successful run, like before #911, and still
marks them as evaluated so it isn't evaluated again for every pin reading from it.
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.

1 participant