Commit 9b75b94
Fix validate_animation subpath track parsing (rfind → find) (#371)
* Fix validate_animation subpath track parsing (rfind → find)
validate_animation was extracting the node portion of each track path with
rfind(":"), so a subpath track like "Target:modulate:a" (the shape every
preset_* produces, plus any "position:y" / "modulate:a" / etc. subpath
track) had its property+subpath glued onto the node part. The validator
then looked up "Target:modulate" against root_node, found nothing, and
reported the track as broken even when the target node was perfectly
healthy.
Split on the FIRST colon — the node↔property boundary — instead. The rest
of the string is property+subpath, which validate_animation doesn't need
to inspect (it's only checking that the target node exists).
Add a regression test that creates a Sprite2D sibling of the player,
attaches a "Target:modulate:a" track, and asserts validate_animation
reports valid_count == 1 / broken_count == 0.
Surfaced by Copilot review on #367. Filing here so the cherry-pick stays
clean and the bug fix carries its own test.
https://claude.ai/code/session_011QxzADbf9zHwfZicjzdvCw
* Narrow comment claim: only preset_fade produces subpath tracks
Per Copilot review on #371: of the four motion presets, only preset_fade
emits a subpath track ("Target:modulate:a"). preset_slide / preset_shake /
preset_pulse use plain ":position" or ":scale" paths.
Tighten the comments in animation_values.gd and test_animation.gd so
future readers debugging validator behavior aren't misled.
https://claude.ai/code/session_011QxzADbf9zHwfZicjzdvCw
* Empty commit to retrigger CI (Godot tests / macOS flake)
* Retrigger CI (third attempt; Godot tests / macOS keeps flaking)
* Replace regression test with broken_tracks.node_path shape assertion
Godot's `get_node_or_null` strips the `:property` suffix of a NodePath
natively — so the original `rfind(":")` and the new `find(":")` produce
the same valid/broken classification at runtime. The bug Copilot flagged
on #371 turns out to only be visible in the broken_tracks[].node_path
field for missing-target subpath tracks: rfind surfaces
"MissingTarget:modulate" while find correctly surfaces "MissingTarget".
The previous test asserted valid_count == 1 on a healthy subpath track,
which passed equally with both rfind and find — i.e. it didn't actually
prove the fix. Replace it with a missing-target test that asserts the
broken_tracks[0].node_path field, which is the real behavior change.
The new test also no longer needs a sibling Sprite2D (the missing target
intentionally doesn't exist), so the test is smaller and avoids any
macOS-specific test-runner sensitivity that surfaced on the prior shape.
Comment in animation_values.gd narrowed to match — the fix matters for
diagnostic output, not for the broken/valid classification.
https://claude.ai/code/session_011QxzADbf9zHwfZicjzdvCw
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 758d821 commit 9b75b94
2 files changed
Lines changed: 41 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
187 | 194 | | |
188 | 195 | | |
189 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1494 | 1494 | | |
1495 | 1495 | | |
1496 | 1496 | | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
1497 | 1530 | | |
1498 | 1531 | | |
1499 | 1532 | | |
| |||
0 commit comments