Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix evaluate value error when switch layer state && get target value error in stateMachine callback and animation event #2258

Merged
merged 23 commits into from
Jul 26, 2024

Conversation

luzhuang
Copy link
Contributor

@luzhuang luzhuang commented Jul 23, 2024

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

What is the current behavior? (You can also link to an open issue here)

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

Other information:

Summary by CodeRabbit

  • New Features

    • AnimatorController now requires an engine parameter during instantiation, enhancing its integration with the rendering engine and potentially improving animation management.
  • Documentation

    • Updated documentation to reflect changes in the AnimatorController instantiation, providing clarity on the new requirement for the engine parameter.
  • Bug Fixes

    • Adjusted instantiation in various examples and cases to ensure compatibility with the new AnimatorController constructor, preventing potential errors in existing implementations.
  • Tests

    • Introduced new test cases to evaluate state transitions and ensure the animator correctly applies animation curves during updates, enhancing the reliability of the animation system.

@luzhuang luzhuang added bug Something isn't working animation Built-in animation system related functions labels Jul 23, 2024
@luzhuang luzhuang requested a review from GuoLei1990 July 23, 2024 03:33
Copy link

coderabbitai bot commented Jul 23, 2024

Warning

Rate limit exceeded

@luzhuang has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 10 minutes and 42 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between 30f8e7c and 2474737.

Walkthrough

The recent updates enhance the AnimatorController by requiring an engine parameter across various files, promoting improved integration with engine functionalities, resource management, and performance. Developers must adjust their implementations accordingly, leading to a more cohesive and efficient animation system.

Changes

Files Change Summary
docs/en/animation/animatorController.md
docs/zh/animation/animatorController.md
Updated AnimatorController instantiation to require an engine parameter, altering how developers create instances.
e2e/case/animator-customAnimationClip.ts
e2e/case/animator-customBlendShape.ts
e2e/case/animator-multiSubMeshBlendShape.ts
Modified AnimatorController constructor to accept an engine parameter, linking it to the rendering engine for improved functionality.
examples/animation-customAnimationClip.ts
examples/animation-sprite.ts
Changed instantiation of AnimatorController to include engine, enhancing interaction with the engine.
packages/core/src/animation/AnimatorController.ts Extended AnimatorController from ReferResource, adding an engine parameter to the constructor for resource management.
packages/loader/src/AnimatorControllerLoader.ts Updated constructor to accept resourceManager.engine, enhancing context awareness during initialization.
packages/core/src/animation/Animator.ts Updated state management methods to operate with AnimatorControllerLayer and a new aniUpdate parameter for refined control.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant Engine
    participant AnimatorController

    Developer->>Engine: Create instance of Engine
    Developer->>AnimatorController: Instantiate AnimatorController(engine)
    Engine->>AnimatorController: Provide engine context
    AnimatorController->>AnimationSystem: Manage animations with engine capabilities
Loading

🐰 In a world so bright and fair,
A change was made with loving care.
The Animator now needs a hand,
From the Engine's mighty band.
With hops and jumps, we celebrate,
Resource-aware, we elevate! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (2)
docs/zh/animation/animatorController.md (1)

138-138: Clarify the need for the engine parameter.

The documentation should explain why the AnimatorController now requires an engine parameter for instantiation. This will help developers understand the change and its implications.

animator.animatorController = new AnimatorController(engine);
docs/en/animation/animatorController.md (1)

140-140: Clarify the need for the engine parameter.

The documentation should explain why the AnimatorController now requires an engine parameter for instantiation. This will help developers understand the change and its implications.

animator.animatorController = new AnimatorController(engine);
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e3bf27e and 1dba4a9.

Files selected for processing (10)
  • docs/en/animation/animatorController.md (1 hunks)
  • docs/zh/animation/animatorController.md (1 hunks)
  • e2e/case/animator-customAnimationClip.ts (1 hunks)
  • e2e/case/animator-customBlendShape.ts (1 hunks)
  • e2e/case/animator-multiSubMeshBlendShape.ts (1 hunks)
  • examples/animation-customAnimationClip.ts (3 hunks)
  • examples/animation-sprite.ts (5 hunks)
  • packages/core/src/animation/AnimatorController.ts (2 hunks)
  • packages/loader/src/AnimatorControllerLoader.ts (1 hunks)
  • packages/loader/src/gltf/parser/GLTFAnimatorControllerParser.ts (1 hunks)
Files skipped from review due to trivial changes (2)
  • examples/animation-customAnimationClip.ts
  • examples/animation-sprite.ts
Additional comments not posted (9)
packages/loader/src/gltf/parser/GLTFAnimatorControllerParser.ts (2)

18-18: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to _createAnimatorController match the new signature.

Verification successful

Function usage verified and correct.

The _createAnimatorController function is called with the appropriate parameters (context and animations) as per the new signature.

  • packages/loader/src/gltf/parser/GLTFAnimatorControllerParser.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `_createAnimatorController` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type typescript -A 5 $'_createAnimatorController'

Length of output: 88


Script:

#!/bin/bash
# Description: Verify all function calls to `_createAnimatorController` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --glob '*.ts' -A 5 '_createAnimatorController'

Length of output: 1275


23-26: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to _createAnimatorController match the new signature.

Verification successful

Function usage verified.

The _createAnimatorController method is used correctly with the new signature within the GLTFAnimatorControllerParser.ts file.

  • packages/loader/src/gltf/parser/GLTFAnimatorControllerParser.ts: Lines 23-26
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `_createAnimatorController` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type typescript -A 5 $'_createAnimatorController'

Length of output: 88


Script:

#!/bin/bash
# Description: Verify all function calls to `_createAnimatorController` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type ts -A 5 $'_createAnimatorController'

Length of output: 1271

e2e/case/animator-customBlendShape.ts (1)

75-75: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all instantiations of AnimatorController use the engine parameter.

Verification successful

All instances of AnimatorController correctly use the engine parameter.

  • examples/animation-sprite.ts
  • examples/animation-customAnimationClip.ts
  • packages/loader/src/AnimatorControllerLoader.ts
  • packages/loader/src/gltf/parser/GLTFAnimatorControllerParser.ts
  • e2e/case/animator-customBlendShape.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all instantiations of `AnimatorController` use the `engine` parameter.

# Test: Search for the instantiation. Expect: Only occurrences with the `engine` parameter.
rg --type typescript -A 5 $'new AnimatorController'

Length of output: 87


Script:

#!/bin/bash
# Description: Verify all instantiations of `AnimatorController` use the `engine` parameter.

# Test: Search for the instantiation. Expect: Only occurrences with the `engine` parameter.
rg --type ts -A 5 $'new AnimatorController'

Length of output: 8678

e2e/case/animator-multiSubMeshBlendShape.ts (1)

52-52: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all instantiations of AnimatorController use the engine parameter.

Verification successful

All instantiations of AnimatorController correctly use the engine parameter.

The code changes are consistent across the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all instantiations of `AnimatorController` use the `engine` parameter.

# Test: Search for the instantiation. Expect: Only occurrences with the `engine` parameter.
rg --type typescript -A 5 $'new AnimatorController'

Length of output: 87


Script:

#!/bin/bash
# Description: Verify all instantiations of `AnimatorController` use the `engine` parameter.

# Test: Search for the instantiation. Expect: Only occurrences with the `engine` parameter.
rg --glob '*.ts' -A 5 'new AnimatorController'

Length of output: 8682

packages/core/src/animation/AnimatorController.ts (3)

5-6: Imports verified.

The ReferResource and Engine modules are necessary for the new functionality.


11-11: Class extension verified.

The AnimatorController class correctly extends ReferResource.


37-39: Constructor implementation verified.

The constructor correctly initializes the class and calls the superclass constructor if an engine is provided.

packages/loader/src/AnimatorControllerLoader.ts (1)

27-27: Instantiation verified.

The AnimatorController is correctly instantiated with resourceManager.engine.

e2e/case/animator-customAnimationClip.ts (1)

71-71: Instantiation verified.

The AnimatorController is correctly instantiated with engine.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1dba4a9 and 38cd5f1.

Files selected for processing (3)
  • packages/core/src/animation/Animator.ts (23 hunks)
  • packages/core/src/animation/internal/AnimatorStatePlayData.ts (1 hunks)
  • tests/src/core/Animator.test.ts (3 hunks)
Additional comments not posted (35)
packages/core/src/animation/internal/AnimatorStatePlayData.ts (1)

52-52: Ensure the change in the condition is intentional.

The condition has been changed from Math.abs(time) > duration to Math.abs(time) >= duration, which means that the state will now be marked as Finished when time is exactly equal to duration. Verify that this change is intentional and does not introduce any unintended behavior.

tests/src/core/Animator.test.ts (2)

Line range hint 2-17:
Imports look good.

The new imports are necessary for the added test case.


560-602: New test case implementation looks good.

The new test case "change state in one update" is well-implemented and verifies the functionality of state transitions within the animator system. It sets up an AnimatorController with two states and corresponding animation clips, and checks the correct application of rotation transformations over time.

packages/core/src/animation/Animator.ts (32)

481-481: Method signature update looks good.

The method signature of _updateState has been updated to replace the stateMachine parameter with layer and add a new boolean parameter aniUpdate.


507-509: Method signature update looks good.

The method signature of _updateState has been updated to replace the stateMachine parameter with layer and add a new boolean parameter aniUpdate.


513-525: Method calls updated to reflect new parameters.

The calls to various methods within _updateState have been updated to reflect the new parameters.


534-536: Method signature update looks good.

The method signature of _updatePlayingState has been updated to replace the stateMachine parameter with layer and add a new boolean parameter aniUpdate.


Line range hint 539-563:
Method calls updated to reflect new parameters.

The calls to various methods within _updatePlayingState have been updated to reflect the new parameters.


567-574: Method calls updated to reflect new parameters.

The calls to various methods within _applyStateTransitions have been updated to reflect the new parameters.


Line range hint 602-632:
Ensure logic correctness for state transitions.

The logic for determining needChangeState and updating the state has been modified. Ensure that this change is intentional and does not introduce any unintended behavior.


670-672: Method signature update looks good.

The method signature of _updateCrossFadeState has been updated to replace the stateMachine parameter with layer and add a new boolean parameter aniUpdate.


718-722: Ensure logic correctness for cross-fade state transitions.

The logic for determining needChangeState and updating the state has been modified. Ensure that this change is intentional and does not introduce any unintended behavior.


811-813: Method signature update looks good.

The method signature of _updateCrossFadeFromPoseState has been updated to replace the stateMachine parameter with layer and add a new boolean parameter aniUpdate.


853-856: Ensure logic correctness for cross-fade from pose state transitions.

The logic for determining needChangeState and updating the state has been modified. Ensure that this change is intentional and does not introduce any unintended behavior.


931-933: Method signature update looks good.

The method signature of _updateFinishedState has been updated to replace the stateMachine parameter with layer and add a new boolean parameter aniUpdate.


946-953: Method calls updated to reflect new parameters.

The calls to various methods within _updateFinishedState have been updated to reflect the new parameters.


957-964: Method calls updated to reflect new parameters.

The calls to various methods within _applyStateTransitions have been updated to reflect the new parameters.


1034-1041: Method signature update looks good.

The method signature of _applyStateTransitions has been updated to replace the stateMachine parameter with layer and add a new boolean parameter aniUpdate.


1053-1058: Method calls updated to reflect new parameters.

The calls to various methods within _applyStateTransitions have been updated to reflect the new parameters.


1065-1070: Method calls updated to reflect new parameters.

The calls to various methods within _applyStateTransitions have been updated to reflect the new parameters.


1077-1082: Method calls updated to reflect new parameters.

The calls to various methods within _applyStateTransitions have been updated to reflect the new parameters.


1090-1095: Method calls updated to reflect new parameters.

The calls to various methods within _applyStateTransitions have been updated to reflect the new parameters.


1102-1107: Method calls updated to reflect new parameters.

The calls to various methods within _applyStateTransitions have been updated to reflect the new parameters.


1114-1119: Method calls updated to reflect new parameters.

The calls to various methods within _applyStateTransitions have been updated to reflect the new parameters.


1130-1135: Method signature update looks good.

The method signature of _checkSubTransition has been updated to replace the stateMachine parameter with layer and add a new boolean parameter aniUpdate.


1150-1150: Method calls updated to reflect new parameters.

The calls to various methods within _checkSubTransition have been updated to reflect the new parameters.


1164-1169: Method signature update looks good.

The method signature of _checkBackwardsSubTransition has been updated to replace the stateMachine parameter with layer and add a new boolean parameter aniUpdate.


1184-1184: Method calls updated to reflect new parameters.

The calls to various methods within _checkBackwardsSubTransition have been updated to reflect the new parameters.


1198-1201: Method signature update looks good.

The method signature of _applyTransitionsByCondition has been updated to replace the stateMachine parameter with layer and add a new boolean parameter aniUpdate.


1206-1206: Method calls updated to reflect new parameters.

The calls to various methods within _applyTransitionsByCondition have been updated to reflect the new parameters.


1236-1238: Method signature update looks good.

The method signature of _applyTransition has been updated to replace the stateMachine parameter with layer and add a new boolean parameter aniUpdate.


1243-1243: Method calls updated to reflect new parameters.

The calls to various methods within _applyTransition have been updated to reflect the new parameters.


1455-1457: Method signature update looks good.

The method signature of _checkAnyAndEntryState has been updated to replace the stateMachine parameter with layer and add a new boolean parameter aniUpdate.


1465-1470: Method calls updated to reflect new parameters.

The calls to various methods within _checkAnyAndEntryState have been updated to reflect the new parameters.


1474-1479: Method calls updated to reflect new parameters.

The calls to various methods within _checkAnyAndEntryState have been updated to reflect the new parameters.

packages/core/src/animation/Animator.ts Outdated Show resolved Hide resolved
packages/core/src/animation/Animator.ts Outdated Show resolved Hide resolved
packages/core/src/animation/Animator.ts Outdated Show resolved Hide resolved
packages/core/src/animation/Animator.ts Outdated Show resolved Hide resolved
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 38cd5f1 and a7dbcb9.

Files selected for processing (2)
  • packages/core/src/animation/Animator.ts (22 hunks)
  • tests/src/core/Animator.test.ts (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • tests/src/core/Animator.test.ts
Additional context used
Biome
packages/core/src/animation/Animator.ts

[error] 758-758: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 908-908: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)

Additional comments not posted (7)
packages/core/src/animation/Animator.ts (7)

482-482: Verify the correctness of the new parameter usage.

The new parameter aniUpdate is added to control whether certain updates should occur. Ensure that its usage is consistent and correct throughout the function.


540-542: Verify the correctness of the new parameter usage.

The new parameter aniUpdate is added to control whether certain updates should occur. Ensure that its usage is consistent and correct throughout the function.


567-569: Verify the correctness of the new parameter usage.

The new parameter aniUpdate is added to control whether certain updates should occur. Ensure that its usage is consistent and correct throughout the function.


1258-1261: Verify the correctness of the new parameter usage.

The new parameter aniUpdate is added to control whether certain updates should occur. Ensure that its usage is consistent and correct throughout the function.


713-715: Verify the correctness of the new parameter usage.

The new parameter aniUpdate is added to control whether certain updates should occur. Ensure that its usage is consistent and correct throughout the function.


997-999: Verify the correctness of the new parameter usage.

The new parameter aniUpdate is added to control whether certain updates should occur. Ensure that its usage is consistent and correct throughout the function.


1514-1516: Verify the correctness of the new parameter usage.

The new parameter aniUpdate is added to control whether certain updates should occur. Ensure that its usage is consistent and correct throughout the function.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (1)
packages/core/src/animation/Animator.ts (1)

1251-1261: Function calls to _applyTransitionsByCondition do not match the new signature.

The following calls to _applyTransitionsByCondition are missing the aniUpdate parameter:

  • packages/core/src/animation/Animator.ts:1251
  • packages/core/src/animation/Animator.ts:1257

Please update these calls to include the aniUpdate parameter.

Analysis chain

LGTM! But verify the function usage in the codebase.

The changes to the _applyTransitionsByCondition function are approved.

However, ensure that all function calls to _applyTransitionsByCondition match the new signature.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `_applyTransitionsByCondition` match the new signature.

# Test: Search for the function usage. Expect: Only occurances of the new signature.
rg --type python -A 5 $'_applyTransitionsByCondition'

Length of output: 83


Script:

#!/bin/bash
# Description: Verify all function calls to `_applyTransitionsByCondition` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type ts -A 5 '_applyTransitionsByCondition'

Length of output: 2155

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a7dbcb9 and 9ea76c0.

Files selected for processing (1)
  • packages/core/src/animation/Animator.ts (23 hunks)
Additional context used
Biome
packages/core/src/animation/Animator.ts

[error] 747-747: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 900-900: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)

Additional comments not posted (6)
packages/core/src/animation/Animator.ts (6)

Line range hint 553-648:
LGTM! But verify the function usage in the codebase.

The changes to the _updatePlayingState function are approved.

However, ensure that all function calls to _updatePlayingState match the new signature.

Verification successful

All function calls to _updatePlayingState match the new signature.

  • The function is called with the parameters layerIndex, layerData, layer, deltaTime, and aniUpdate as expected.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `_updatePlayingState` match the new signature.

# Test: Search for the function usage. Expect: Only occurances of the new signature.
rg --type python -A 5 $'_updatePlayingState'

Length of output: 74


Script:

#!/bin/bash
# Description: Verify all function calls to `_updatePlayingState` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type ts -A 5 '_updatePlayingState'

Length of output: 963


Line range hint 697-785:
LGTM! But verify the function usage in the codebase.

The changes to the _updateCrossFadeState function are approved.

However, ensure that all function calls to _updateCrossFadeState match the new signature.

Verification successful

Function calls to _updateCrossFadeState match the new signature.

The changes to the _updateCrossFadeState function are correctly reflected in the codebase.

  • packages/core/src/animation/Animator.ts:
    • Line 738: this._updateCrossFadeState(layerIndex, layerData, layer, deltaTime, aniUpdate);
    • Line 799: Function definition with the new signature.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `_updateCrossFadeState` match the new signature.

# Test: Search for the function usage. Expect: Only occurances of the new signature.
rg --type python -A 5 $'_updateCrossFadeState'

Length of output: 76


Script:

#!/bin/bash
# Description: Verify all function calls to `_updateCrossFadeState` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type ts -A 5 '_updateCrossFadeState'

Length of output: 961

Tools
Biome

[error] 747-747: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


Line range hint 479-515:
LGTM! But verify the function usage in the codebase.

The changes to the _updateLayer function are approved.

However, ensure that all function calls to _updateLayer match the new signature.

Verification successful

Verified: The function _updateLayer is correctly called with the new signature in the codebase.

  • The function call in packages/core/src/animation/Animator.ts matches the updated signature, including the aniUpdate parameter.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `_updateLayer` match the new signature.

# Test: Search for the function usage. Expect: Only occurances of the new signature.
rg --type python -A 5 $'_updateLayer'

Length of output: 67


Script:

#!/bin/bash
# Description: Verify all function calls to `_updateLayer` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type typescript -A 5 '_updateLayer'

Length of output: 75


Script:

#!/bin/bash
# Description: Verify all function calls to `_updateLayer` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg '_updateLayer' -A 5

Length of output: 786


Line range hint 526-548:
LGTM! But verify the function usage in the codebase.

The changes to the _updateState function are approved.

However, ensure that all function calls to _updateState match the new signature.

Verification successful

Function usage verified

All calls to _updateState match the new function signature.

  • packages/core/src/animation/Animator.ts: All instances of _updateState have been updated correctly.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `_updateState` match the new signature.

# Test: Search for the function usage. Expect: Only occurances of the new signature.
rg --type python -A 5 $'_updateState'

Length of output: 67


Script:

#!/bin/bash
# Description: Verify all function calls to `_updateState` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type typescript -A 5 '_updateState'

Length of output: 75


Script:

#!/bin/bash
# Description: Verify all function calls to `_updateState` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type ts -A 5 '_updateState'

Length of output: 3459


990-1027: LGTM! But verify the function usage in the codebase.

The changes to the _updateFinishedState function are approved.

However, ensure that all function calls to _updateFinishedState match the new signature.

Verification successful

All function calls to _updateFinishedState match the new signature.

The changes to the _updateFinishedState function are correctly implemented and consistent throughout the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `_updateFinishedState` match the new signature.

# Test: Search for the function usage. Expect: Only occurances of the new signature.
rg --type python -A 5 $'_updateFinishedState'

Length of output: 75


Script:

#!/bin/bash
# Description: Verify all function calls to `_updateFinishedState` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type js -A 5 '_updateFinishedState'

Length of output: 40


Script:

#!/bin/bash
# Description: Verify all function calls to `_updateFinishedState` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type js,ts -A 5 '_updateFinishedState'

Length of output: 73


Script:

#!/bin/bash
# Description: Verify all function calls to `_updateFinishedState` match the new signature.

# Test: Search for the function usage in JavaScript files. Expect: Only occurrences of the new signature.
rg --type js -A 5 '_updateFinishedState'

# Test: Search for the function usage in TypeScript files. Expect: Only occurrences of the new signature.
rg --type ts -A 5 '_updateFinishedState'

Length of output: 1018


Line range hint 1087-1172:
LGTM! But verify the function usage in the codebase.

The changes to the _applyStateTransitions function are approved.

However, ensure that all function calls to _applyStateTransitions match the new signature.

Verification successful

All calls to _applyStateTransitions match the new signature.

The changes to the _applyStateTransitions function are correctly reflected in all instances where it is called within the Animator.ts file.

  • All calls include the aniUpdate parameter.
  • The function signature is consistent across the codebase.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `_applyStateTransitions` match the new signature.

# Test: Search for the function usage. Expect: Only occurances of the new signature.
rg --type python -A 5 $'_applyStateTransitions'

Length of output: 77


Script:

#!/bin/bash
# Description: Verify all function calls to `_applyStateTransitions` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type typescript -A 5 '_applyStateTransitions'

Length of output: 85


Script:

#!/bin/bash
# Description: Verify all function calls to `_applyStateTransitions` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type ts -A 5 '_applyStateTransitions'

Length of output: 1216


Script:

#!/bin/bash
# Description: Verify all function calls to `_applyStateTransitions` match the new signature.

# Test: Search for the function usage and ensure the full parameter list is captured.
rg '_applyStateTransitions' packages/core/src/animation/Animator.ts -A 10

Length of output: 891

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9ea76c0 and be9d132.

Files selected for processing (2)
  • packages/core/src/animation/Animator.ts (22 hunks)
  • tests/src/core/Animator.test.ts (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • tests/src/core/Animator.test.ts
Additional context used
Biome
packages/core/src/animation/Animator.ts

[error] 727-727: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 879-879: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)

Additional comments not posted (7)
packages/core/src/animation/Animator.ts (7)

969-971: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to _updateFinishedState match the new signature.

Verification successful

Verified: All function calls to _updateFinishedState match the new signature.

  • packages/core/src/animation/Animator.ts line 969: The function _updateFinishedState is called with the new parameters layer, deltaTime, and aniUpdate.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `_updateFinishedState` match the new signature.

# Test: Search for the function usage. Expect: Only occurances of the new signature.
rg --type ts -A 5 $'_updateFinishedState'

Length of output: 977


677-679: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to _updateCrossFadeState match the new signature.

Verification successful

All function calls to _updateCrossFadeState match the new signature.

  • Verified that the function _updateCrossFadeState is called with the correct parameters in all instances.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `_updateCrossFadeState` match the new signature.

# Test: Search for the function usage. Expect: Only occurances of the new signature.
rg --type ts -A 5 $'_updateCrossFadeState'

Length of output: 961


1230-1233: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to _applyTransitionsByCondition match the new signature.

Verification successful

Function usage matches the new signature.

The function _applyTransitionsByCondition is used consistently with the new signature across the codebase.

  • packages/core/src/animation/Animator.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `_applyTransitionsByCondition` match the new signature.

# Test: Search for the function usage. Expect: Only occurances of the new signature.
rg --type ts -A 5 $'_applyTransitionsByCondition'

Length of output: 2155


1486-1488: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to _checkAnyAndEntryState match the new signature.

Verification successful

All function calls to _checkAnyAndEntryState match the new signature.

The function _checkAnyAndEntryState has been correctly updated, and all its usages in the codebase conform to the new signature.

  • packages/core/src/animation/Animator.ts: Lines 1486-1488
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `_checkAnyAndEntryState` match the new signature.

# Test: Search for the function usage. Expect: Only occurances of the new signature.
rg --type ts -A 5 $'_checkAnyAndEntryState'

Length of output: 1345


506-508: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to _updateState match the new signature.

Verification successful

Verification complete: All function calls to _updateState match the new signature.

  • The function _updateState is consistently called with the parameters layerIndex, layerData, layer, deltaTime, and aniUpdate throughout the Animator.ts file.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `_updateState` match the new signature.

# Test: Search for the function usage. Expect: Only occurances of the new signature.
rg --type ts -A 5 $'_updateState'

Length of output: 3459


1066-1073: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to _applyStateTransitions match the new signature.

Verification successful

Verified: All function calls to _applyStateTransitions match the new signature, including the layer and aniUpdate parameters.

  • packages/core/src/animation/Animator.ts lines where _applyStateTransitions is called:
    • Line 1066
    • Line 1073
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `_applyStateTransitions` match the new signature.

# Test: Search for the function usage. Expect: Only occurances of the new signature.
rg --type ts -A 5 $'_applyStateTransitions'

Length of output: 1216


Script:

#!/bin/bash
# Description: Verify all function calls to `_applyStateTransitions` match the new signature with complete parameters.

# Test: Search for the function usage and display complete function calls.
rg --type ts -A 10 $'_applyStateTransitions'

Length of output: 2181


533-535: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to _updatePlayingState match the new signature.

Verification successful

Let's verify all instances of _updatePlayingState to ensure they match the new signature.


All function calls to _updatePlayingState match the new signature.

The verification confirms that the function calls are consistent with the updated signature.

  • packages/core/src/animation/Animator.ts: Line 533
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `_updatePlayingState` match the new signature.

# Test: Search for the function usage. Expect: Only occurances of the new signature.
rg --type ts -A 5 $'_updatePlayingState'

Length of output: 963


Script:

#!/bin/bash
# Description: Verify all function calls to `_updatePlayingState` match the new signature.

# Test: Search for all instances of the function usage. Expect: Only occurrences of the new signature.
rg --type ts '_updatePlayingState'

Length of output: 231

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between be9d132 and 7ea24f2.

Files selected for processing (1)
  • packages/core/src/animation/Animator.ts (22 hunks)
Additional context used
Biome
packages/core/src/animation/Animator.ts

[error] 727-727: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 882-882: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)

Additional comments not posted (7)
packages/core/src/animation/Animator.ts (7)

506-508: LGTM! The method signature update is appropriate.

The addition of layer and aniUpdate parameters enhances the method's flexibility.


533-535: LGTM! The method signature update is appropriate.

The addition of layer and aniUpdate parameters enhances the method's flexibility.


676-678: LGTM! The method signature update is appropriate.

The addition of layer and aniUpdate parameters enhances the method's flexibility.


972-974: LGTM! The method signature update is appropriate.

The addition of layer and aniUpdate parameters enhances the method's flexibility.


1069-1076: LGTM! The method signature update is appropriate.

The addition of layer and aniUpdate parameters enhances the method's flexibility.


1233-1236: LGTM! The method signature update is appropriate.

The addition of layer and aniUpdate parameters enhances the method's flexibility.


1489-1491: LGTM! The method signature update is appropriate.

The addition of layer and aniUpdate parameters enhances the method's flexibility.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jul 26, 2024
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7ea24f2 and 009adba.

Files selected for processing (4)
  • packages/core/src/animation/Animator.ts (26 hunks)
  • packages/core/src/animation/AnimatorController.ts (3 hunks)
  • packages/core/src/animation/AnimatorControllerParameter.ts (1 hunks)
  • tests/src/core/Animator.test.ts (7 hunks)
Files skipped from review due to trivial changes (1)
  • packages/core/src/animation/AnimatorControllerParameter.ts
Files skipped from review as they are similar to previous changes (1)
  • tests/src/core/Animator.test.ts
Additional context used
Biome
packages/core/src/animation/Animator.ts

[error] 755-755: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 910-910: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)

Additional comments not posted (22)
packages/core/src/animation/AnimatorController.ts (4)

5-6: LGTM! New imports are necessary.

The new imports for ReferResource and Engine are appropriate and necessary for the changes made to the class inheritance and constructor.


11-11: LGTM! Class inheritance change is appropriate.

The AnimatorController class correctly extends ReferResource, aligning with the PR objectives.


44-44: LGTM! Method signature change is appropriate.

The parameter name change from value to initialValue in addParameter method clarifies its purpose.


37-39: Verify the constructor usage in the codebase.

The constructor change is approved.

However, ensure that all instantiations of AnimatorController correctly pass the engine parameter if required.

Verification successful

All instantiations of AnimatorController correctly pass the engine parameter.

The constructor change is verified, and all instances in the codebase adhere to the new signature.

  • examples/animation-customAnimationClip.ts
  • examples/animation-sprite.ts
  • e2e/case/animator-customAnimationClip.ts
  • e2e/case/animator-customBlendShape.ts
  • e2e/case/animator-multiSubMeshBlendShape.ts
  • packages/loader/src/gltf/parser/GLTFAnimatorControllerParser.ts
  • packages/loader/src/AnimatorControllerLoader.ts
  • tests/src/core/Animator.test.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all instantiations of `AnimatorController` match the new constructor signature.

# Test: Search for the class instantiation. Expect: Only occurances of the new constructor signature.
rg --type ts -A 5 $'new AnimatorController'

Length of output: 9254

packages/core/src/animation/Animator.ts (18)

12-12: LGTM! New import is necessary.

The new import for AnimatorControllerParameter is appropriate and necessary for the changes made in the file.


508-508: LGTM! Method signature change is appropriate.

The method _updateState now correctly accepts layer and aniUpdate parameters, enhancing flexibility and control.


534-536: LGTM! Method signature change is appropriate.

The method _updateState now correctly accepts layer and aniUpdate parameters, enhancing flexibility and control.


561-563: LGTM! Method signature change is appropriate.

The method _updatePlayingState now correctly accepts layer and aniUpdate parameters, enhancing flexibility and control.


704-706: LGTM! Method signature change is appropriate.

The method _updateCrossFadeState now correctly accepts layer and aniUpdate parameters, enhancing flexibility and control.


867-869: LGTM! Method signature change is appropriate.

The method _updateCrossFadeFromPoseState now correctly accepts layer and aniUpdate parameters, enhancing flexibility and control.


1000-1002: LGTM! Method signature change is appropriate.

The method _updateFinishedState now correctly accepts layer and aniUpdate parameters, enhancing flexibility and control.


1097-1104: LGTM! Method signature change is appropriate.

The method _applyStateTransitions now correctly accepts layer and aniUpdate parameters, enhancing flexibility and control.


1261-1264: LGTM! Method signature change is appropriate.

The method _applyTransitionsByCondition now correctly accepts layer and aniUpdate parameters, enhancing flexibility and control.


540-543: LGTM! Control flow change is appropriate.

The control flow for managing animation state updates has been correctly refined to incorporate the new parameters.


578-588: LGTM! Control flow change is appropriate.

The control flow for managing animation state updates has been correctly refined to incorporate the new parameters.


627-643: LGTM! Control flow change is appropriate.

The control flow for managing animation state updates has been correctly refined to incorporate the new parameters.


748-769: LGTM! Control flow change is appropriate.

The control flow for managing animation state updates has been correctly refined to incorporate the new parameters.

Tools
Biome

[error] 755-755: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


Line range hint 806-861:
LGTM! Control flow change is appropriate.

The control flow for managing animation state updates has been correctly refined to incorporate the new parameters.


908-924: LGTM! Control flow change is appropriate.

The control flow for managing animation state updates has been correctly refined to incorporate the new parameters.

Tools
Biome

[error] 910-910: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


Line range hint 949-994:
LGTM! Control flow change is appropriate.

The control flow for managing animation state updates has been correctly refined to incorporate the new parameters.


1004-1037: LGTM! Control flow change is appropriate.

The control flow for managing animation state updates has been correctly refined to incorporate the new parameters.


1518-1542: LGTM! Control flow change is appropriate.

The control flow for managing animation state updates has been correctly refined to incorporate the new parameters.

packages/core/src/animation/Animator.ts Outdated Show resolved Hide resolved
packages/core/src/animation/Animator.ts Outdated Show resolved Hide resolved
packages/core/src/animation/Animator.ts Outdated Show resolved Hide resolved
packages/core/src/animation/Animator.ts Outdated Show resolved Hide resolved
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 009adba and 1b37930.

Files selected for processing (5)
  • packages/core/src/animation/Animator.ts (28 hunks)
  • packages/core/src/animation/AnimatorCondition.ts (2 hunks)
  • packages/core/src/animation/AnimatorController.ts (3 hunks)
  • packages/core/src/animation/AnimatorControllerParameter.ts (1 hunks)
  • packages/core/src/animation/AnimatorStateTransition.ts (3 hunks)
Files skipped from review as they are similar to previous changes (2)
  • packages/core/src/animation/AnimatorController.ts
  • packages/core/src/animation/AnimatorControllerParameter.ts
Additional context used
Biome
packages/core/src/animation/Animator.ts

[error] 764-764: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 919-919: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)

Additional comments not posted (6)
packages/core/src/animation/AnimatorCondition.ts (2)

1-1: Update import statement.

The import statement has been updated to import AnimatorControllerParameterValue instead of AnimatorControllerParameterValueType. Ensure that this change is consistent with the rest of the codebase.


13-13: Update type of threshold property.

The type of the threshold property has been changed from AnimatorControllerParameterValueType to AnimatorControllerParameterValue. This change should be verified for consistency with other parts of the codebase.

packages/core/src/animation/AnimatorStateTransition.ts (3)

1-1: Update import statement.

The import statement has been updated to import AnimatorControllerParameterValue instead of AnimatorControllerParameterValueType. Ensure that this change is consistent with the rest of the codebase.


64-64: Update type of threshold parameter in addCondition method.

The type of the threshold parameter in the addCondition method has been changed from AnimatorControllerParameterValueType to AnimatorControllerParameterValue. This change should be verified for consistency with other parts of the codebase.


76-76: Update type of threshold parameter in overloaded addCondition method.

The type of the threshold parameter in the overloaded addCondition method has been changed from AnimatorControllerParameterValueType to AnimatorControllerParameterValue. This change should be verified for consistency with other parts of the codebase.

packages/core/src/animation/Animator.ts (1)

12-12: Update import statement.

The import statement has been updated to import AnimatorControllerParameter and AnimatorControllerParameterValue. Ensure that this change is consistent with the rest of the codebase.

packages/core/src/animation/Animator.ts Show resolved Hide resolved
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1b37930 and 30f8e7c.

Files selected for processing (3)
  • packages/core/src/animation/Animator.ts (28 hunks)
  • packages/core/src/animation/AnimatorController.ts (3 hunks)
  • packages/loader/src/AnimatorControllerLoader.ts (4 hunks)
Additional context used
Biome
packages/core/src/animation/Animator.ts

[error] 510-510: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 733-733: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


[error] 890-890: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)

Additional comments not posted (15)
packages/core/src/animation/AnimatorController.ts (5)

11-11: LGTM! Class inheritance change approved.

The AnimatorController class now correctly extends ReferResource.


55-70: LGTM! Method parameter name change approved.

The addParameter method now uses defaultValue instead of value for better clarity.


65-70: LGTM! Method update approved.

The addParameter method update is consistent and improves clarity.


Line range hint 101-103:
LGTM! Method approved.

The _registerChangeFlag method is straightforward and does not require any changes.


37-50: Verify the constructor change.

The constructor now accepts an optional engine parameter and calls the superclass constructor if provided.

Verification successful

Constructor change verification successful.

All instances of AnimatorController correctly use the new constructor signature with the optional engine parameter.

  • examples/animation-sprite.ts
  • examples/animation-customAnimationClip.ts
  • e2e/case/animator-customBlendShape.ts
  • e2e/case/animator-multiSubMeshBlendShape.ts
  • e2e/case/animator-customAnimationClip.ts
  • packages/loader/src/AnimatorControllerLoader.ts
  • packages/loader/src/gltf/parser/GLTFAnimatorControllerParser.ts
  • tests/src/core/Animator.test.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all instantiations of `AnimatorController` match the new constructor signature.

# Test: Search for the class instantiation. Expect: Only occurrences of the new constructor signature.
rg --type typescript -A 5 $'new AnimatorController'

Length of output: 87


Script:

#!/bin/bash
# Description: Verify all instantiations of `AnimatorController` match the new constructor signature.

# Test: Search for the class instantiation. Expect: Only occurrences of the new constructor signature.
rg --type ts -A 5 $'new AnimatorController'

Length of output: 9282

packages/loader/src/AnimatorControllerLoader.ts (2)

27-27: LGTM! Instantiation change approved.

The AnimatorController is now correctly instantiated with resourceManager.engine.


105-105: LGTM! Parameter update approved.

The parameter.value has been correctly replaced with parameter.defaultValue.

packages/core/src/animation/Animator.ts (8)

500-526: LGTM! Method update approved.

The _updateState method now accepts layer and aniUpdate parameters, enhancing flexibility.

Tools
Biome

[error] 510-510: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


Line range hint 553-643:
LGTM! Method update approved.

The _updatePlayingState method now accepts layer and aniUpdate parameters, enhancing flexibility.


Line range hint 681-793:
LGTM! Method update approved.

The _updateCrossFadeState method now accepts layer and aniUpdate parameters, enhancing flexibility.

Tools
Biome

[error] 733-733: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


Line range hint 844-932:
LGTM! Method update approved.

The _updateCrossFadeFromPoseState method now accepts layer and aniUpdate parameters, enhancing flexibility.

Tools
Biome

[error] 890-890: The assignment should not be in an expression.

The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.

(lint/suspicious/noAssignInExpressions)


980-1021: LGTM! Method update approved.

The _updateFinishedState method now accepts layer and aniUpdate parameters, enhancing flexibility.


Line range hint 1081-1166:
LGTM! Method update approved.

The _applyStateTransitions method now accepts layer and aniUpdate parameters, enhancing flexibility.


1245-1255: LGTM! Method update approved.

The _applyTransitionsByCondition method now accepts layer and aniUpdate parameters, enhancing flexibility.


1501-1525: LGTM! Method update approved.

The _checkAnyAndEntryState method now accepts layer and aniUpdate parameters, enhancing flexibility.

packages/core/src/animation/Animator.ts Show resolved Hide resolved
packages/core/src/animation/Animator.ts Outdated Show resolved Hide resolved
packages/core/src/animation/Animator.ts Outdated Show resolved Hide resolved
@luzhuang luzhuang changed the title fix: animatorController extends ReferResource Fix evaluate value is not correct when switch layerState && Fix get target value in stateMachine callback and animation event is not correct Jul 26, 2024
@luzhuang luzhuang changed the title Fix evaluate value is not correct when switch layerState && Fix get target value in stateMachine callback and animation event is not correct Fix evaluate value is not correct when switch layerState & Fix get target value in stateMachine callback and animation event is not correct Jul 26, 2024
@GuoLei1990 GuoLei1990 changed the title Fix evaluate value is not correct when switch layerState & Fix get target value in stateMachine callback and animation event is not correct Fix evaluate value error when switch layer state && get target value error in stateMachine callback Jul 26, 2024
@GuoLei1990 GuoLei1990 changed the title Fix evaluate value error when switch layer state && get target value error in stateMachine callback Fix evaluate value error when switch layer state && get target value error in stateMachine callback and animation event Jul 26, 2024
@GuoLei1990 GuoLei1990 merged commit 8b02aa0 into galacean:dev/1.3 Jul 26, 2024
6 of 7 checks passed
@GuoLei1990 GuoLei1990 removed the documentation Improvements or additions to documentation label Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
animation Built-in animation system related functions bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants