Skip to content

Revert "Allow anyState transitions to interrupt crossFade & fix transition bugs"#2891

Open
GuoLei1990 wants to merge 1 commit intodev/2.0from
revert-2885-fix/animatorAnyState
Open

Revert "Allow anyState transitions to interrupt crossFade & fix transition bugs"#2891
GuoLei1990 wants to merge 1 commit intodev/2.0from
revert-2885-fix/animatorAnyState

Conversation

@GuoLei1990
Copy link
Member

Reverts #2885

@augmentcode
Copy link

augmentcode bot commented Feb 18, 2026

🤖 Augment PR Summary

Summary: This PR reverts the animation state-machine changes introduced in #2885, restoring the previous transition/cross-fade behavior.

Changes:

  • Removes the added logic that allowed AnyState no-exit-time transitions to interrupt an in-progress crossFade.
  • Simplifies cross-fade update flow by dropping the early “interrupt crossFade” checks in both normal and from-pose cross-fade paths.
  • Reverts transition scanning behavior back toward the pre-Allow anyState transitions to interrupt crossFade & fix transition bugs #2885 approach (including removal of the helper methods added for cross-fade interruption).
  • Reverts parts of AnimatorStateTransitionCollection transition insertion/sorting logic.
  • Removes the additional animator tests that validated cross-fade interruption and no-exit-time transition scanning behavior.
  • Updates the Vitest config by removing fsevents from optimizeDeps.exclude, matching the pre-Allow anyState transitions to interrupt crossFade & fix transition bugs #2885 configuration.

Technical Notes: Net effect is a behavioral rollback: AnyState transitions no longer preempt cross-fades, and transition ordering/selection logic returns to the earlier implementation assumptions.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

excludeDestState?: AnimatorState
): AnimatorStateTransition {
for (let i = 0, n = transitionCollection.noExitTimeCount; i < n; ++i) {
for (let i = 0, n = transitionCollection.count; i < n; ++i) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_checkNoExitTimeTransition() now iterates over transitionCollection.count (all transitions) even though it’s only called when noExitTimeCount > 0. This can allow hasExitTime transitions to be applied immediately (bypassing exit-time gating) if their conditions pass after the no-exit-time transitions fail.

Severity: high

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

let index = count;
// Stop at noExitTimeCount boundary to avoid comparing with noExitTime transitions
while (--index >= noExitTimeCount && exitTime < transitions[index].exitTime);
while (--index >= 0 && exitTime < transitions[index].exitTime);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The insertion loop for hasExitTime transitions now compares against the entire transitions array, including hasExitTime=false transitions whose exitTime still defaults to 1.0. That can insert exit-time transitions into the [0, noExitTimeCount) segment and break the noExitTimeCount ordering invariant relied on by the forward/backward exit-time scans.

Severity: high

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.02%. Comparing base (d68166b) to head (26ced47).

Files with missing lines Patch % Lines
...src/animation/AnimatorStateTransitionCollection.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           dev/2.0    #2891      +/-   ##
===========================================
- Coverage    83.03%   83.02%   -0.02%     
===========================================
  Files          796      796              
  Lines        90449    90398      -51     
  Branches      9503     9492      -11     
===========================================
- Hits         75107    75054      -53     
- Misses       15260    15262       +2     
  Partials        82       82              
Flag Coverage Δ
unittests 83.02% <80.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Comments