Commit 0e8a9fc
authored
feat: add MergeEventQueues node (#133)
This PR adds a `MergeEventQueues` node that concatenates two event
queues into one. This is needed when you have multiple event sources
(e.g. a `FireEventNode` and a `ClipNode`'s event output) that need to
feed into a single event queue input like the FSM's driver.
### What it does
- **`MergeEventQueues`** (`Merge Events`): Takes two `EventQueue` inputs
and concatenates them into a single output queue.
### Discussion: is explicit merging the right approach?
In the current architecture, event queues are explicit data pins that
users must manually wire through the graph. This means combining events
from multiple sources requires an explicit merge node.
Esoterica takes a fundamentally different approach: events are appended
into a **single shared buffer** during graph evaluation. Each node
returns a `SampledEventRange` (start/end index pair) describing its
slice. Blend nodes call `BlendEventRanges()` to combine children's
ranges and scale weights by the blend factor. Events propagate
implicitly alongside poses — users never wire event connections
manually.
The Esoterica approach is more elegant (no manual wiring, events
automatically weighted by blend factors), but would require significant
architectural changes to adopt here. This node is a pragmatic stopgap
for the current pin-based event architecture.
I may be missing prior discussion or design notes on this — apologies if
this has already been considered and the current explicit approach was a
deliberate choice. But I wanted to flag the question: is there interest
in moving toward implicit event propagation (Esoterica-style shared
buffer), or is the explicit pin-based approach the intended long-term
design? Happy to hear if there's context I'm not aware of. Either way,
this node solves an immediate wiring problem I ran into.
### AI Disclosure
I used AI (Claude Code) to research how Esoterica handles event
propagation and to generate the node implementation.1 parent 7feaced commit 0e8a9fc
4 files changed
Lines changed: 55 additions & 1 deletion
File tree
- crates/bevy_animation_graph_builtin_nodes/src
- event_queue
- release-content/release-notes
Lines changed: 43 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
| 91 | + | |
89 | 92 | | |
90 | 93 | | |
91 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
0 commit comments