Split a struct output into one pin per field #256

Closed
opened 2026-09-28 11:33:19 +02:00 by meleki · 1 comment
Owner

Reading one field of a struct needs an own Expand node today, even when the graph already knows the struct type (typed lists since #254, typed variables and Pack/Expand since #253).

Goal

Like Unreal's "Split Struct Pin":

  • Right-click on an output pin that can carry a struct: Split into fields when the graph knows the type, Split as … for every other struct asset.
  • The output is replaced by item.Name, item.Amount, … each with the kind of its field.
  • Right-click on a field pin: Recombine.
  • Field pins follow the struct asset like a typed Expand (add, remove, rename, delete asset).
  • Renaming a variable carries the split along.
  • At runtime the node still produces the whole value, a field pin reads its field.

Limits

Outputs only, one level, behavior graphs only.

Reading one field of a struct needs an own `Expand` node today, even when the graph already knows the struct type (typed lists since #254, typed variables and `Pack`/`Expand` since #253). ## Goal Like Unreal's "Split Struct Pin": - Right-click on an output pin that can carry a struct: **Split into <Type> fields** when the graph knows the type, **Split as …** for every other struct asset. - The output is replaced by `item.Name`, `item.Amount`, … each with the kind of its field. - Right-click on a field pin: **Recombine**. - Field pins follow the struct asset like a typed `Expand` (add, remove, rename, delete asset). - Renaming a variable carries the split along. - At runtime the node still produces the whole value, a field pin reads its field. ## Limits Outputs only, one level, behavior graphs only.
Author
Owner

Done in 38e0f65, wiki: Structs (Split outputs), note in Behaviors.

  • Right-click on an output pin: Split into fields when the type is known (typed variables, typed Pack/Expand, fields of another split, item of For each/Find/Match/Item at over a typed list), Split as … for any other struct asset.
  • Right-click on a field pin: Recombine. Edges of the replaced pins are dropped, one undo brings them back.
  • Field pins follow the struct asset (add, remove, rename keeps the edge, deleting the asset keeps the last fields). The delete dialog counts splits.
  • Renaming a variable carries the split along. Copy/paste keeps it.
  • Limits: outputs only, one level, behavior graphs only.

Tests: ./check.sh 185 files, 2706 tests, CHECK EXIT 0. e2e 1-6, 54, 55: 303 checks passed. New port-splits.test.ts (12 tests), e2e 6z-vi (3 checks, real mouse, the run logs 7). Counter-checks in unit and browser all fail as expected.

Done in 38e0f65, wiki: *Structs* (Split outputs), note in *Behaviors*. - Right-click on an output pin: **Split into <Type> fields** when the type is known (typed variables, typed `Pack`/`Expand`, fields of another split, `item` of `For each`/`Find`/`Match`/`Item at` over a typed list), **Split as …** for any other struct asset. - Right-click on a field pin: **Recombine**. Edges of the replaced pins are dropped, one undo brings them back. - Field pins follow the struct asset (add, remove, rename keeps the edge, deleting the asset keeps the last fields). The delete dialog counts splits. - Renaming a variable carries the split along. Copy/paste keeps it. - Limits: outputs only, one level, behavior graphs only. Tests: `./check.sh` 185 files, 2706 tests, CHECK EXIT 0. e2e 1-6, 54, 55: 303 checks passed. New `port-splits.test.ts` (12 tests), e2e 6z-vi (3 checks, real mouse, the run logs 7). Counter-checks in unit and browser all fail as expected.
admin added this to the Development project 2026-09-28 21:22:16 +02:00
admin moved this to Done in Development on 2026-09-28 21:22:25 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: meleki/feuerwerk#256