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

[WIP] Feature: NewGenAnim #9331

Merged
merged 61 commits into from
Oct 11, 2021
Merged

Conversation

shrinktofit
Copy link
Contributor

@shrinktofit shrinktofit commented Sep 16, 2021

Re: cocos-creator/3d-tasks#

Internal discussion: https://github.com/cocos-creator/3d-tasks/discussions/8771

Internal issue: https://github.com/cocos-creator/3d-tasks/issues/5845

Internal editor requirements and info tracks: https://github.com/cocos-creator/3d-tasks/issues/8520

Changelog:
*

shrinktofit and others added 25 commits August 25, 2021 15:33
* The default ExitCondition should be 1.0

* Do correct graph eval
Fix single frame exit condition behaviours; Fix pose -> subgraph behaviours
* Temp

* Flat whole layer statemachine

* Add test for test reset triggers

* Allow self transition

* Self transition test
@shrinktofit
Copy link
Contributor Author

shrinktofit commented Sep 16, 2021

Reviewer notes

This PR is in pretty early stage and may varies a lot. However, to reduce reviewing stress, I made this PR for now. Unless stated in later comments(and it'd be definitely covered before this PR can be merged), you should only review, discuss and suggest to the design, concepts or structure of this PR. You shall not care the trivial details about for example:

  • the name of each piece of code;

  • blame the lack-of-document on APIs.

@shrinktofit shrinktofit marked this pull request as draft September 16, 2021 08:10
@shrinktofit shrinktofit reopened this Sep 16, 2021
weights[weights.length - 1] = 1;
} else {
let iUpper = 0;
for (let iThresholds = 1; iThresholds < thresholds.length; ++iThresholds) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: Binary search

private _currentTransitionPath: TransitionEval[] = [];
private _transitionProgress = 0;
private declare _triggerReset: TriggerResetFn;
private _fromWeight = 0.0;
Copy link
Contributor

Choose a reason for hiding this comment

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

fromWeight 和 toWeight 是什么概念

Copy link
Contributor Author

Choose a reason for hiding this comment

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

const nComponents = components.length;
for (let iComponent = 0; iComponent < nComponents; ++iComponent) {
const component = components[iComponent];
if (component.onEnter !== DEFAULT_ENTER_METHOD) {
Copy link
Contributor

Choose a reason for hiding this comment

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

这个判断的目的是优化性能?感觉这个判断都能进啊

Copy link
Contributor Author

Choose a reason for hiding this comment

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

是的,优化性能,如果它没复写基类方法(也就是没自定义组件方法),就不调用了,我个人觉得这比现有的 Node 生命周期方法的实现好点。

Copy link
Contributor

@jareguo jareguo left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@gameall3d gameall3d left a comment

Choose a reason for hiding this comment

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

LGTM

@shrinktofit shrinktofit marked this pull request as ready for review October 11, 2021 07:35
@SantyWang SantyWang merged commit 8488972 into cocos:v3.4.0 Oct 11, 2021
pandamicro pushed a commit that referenced this pull request Oct 14, 2021
* NewGenAnim

* Fix/Optimize simple directional blending

* Class transition by type (#29)

* Transition & Gradient transition (#30)

* The default ExitCondition should be 1.0

* Do correct graph eval

* Fix PoseSubgraph connect() signature order (#31)

* Graph defaults test (#32)

* Conditions (#33)

* Trigger (#34)

* Transition should only be considered when satemachine exited (#35)

* Add layer.name (#36)

* Fix some behaviours; add API to query poses and transition (#37)

Fix single frame exit condition behaviours; Fix pose -> subgraph behaviours

* Support self transition; refactor sub state machine implementation (#38)

* Temp

* Flat whole layer statemachine

* Add test for test reset triggers

* Allow self transition

* Self transition test

* Fix deserialize (#39)

* update animgraph template (#40)

* The inheritance of any state (#41)

* StateMachine events (#42)

* Fix state machine events; Allow multiple transitions between two nodes (#43)

* Transition priority test (#44)

* Optimize variable bind (#45)

* Fix variable bind errors (#46)

* Expose blend algorithm to editor (#47)

* Cont (#48)

* update animgraph template (#49)

* update animgraph template

* update animgraph template

* Pose speed (#50)

* blend tree add EditorExtendable data (#51)

* Correct pose blend duration (#52)

* Export some types (#53)

* animation pose EditorExtendable (#54)

(cherry picked from commit d5dd5f3)

* Implement clone() (#55)

* Fix trigger condition serialization (#56)

* Add variable type: integer (#57)

* Optimize 0 weight case (#58)

* Relative duration (#59)

* update_hdr_skybox (#9230)

* Rename.. (#60)

* Optimize animation blend item export (#61)

* Fix Type (#62)

* modify aniamtion graph template data (#63)

* modify aniamtion graph template data

* add animation graph component template

* Fix serialize issue (#64)

* Optimize (#65)

* Remove MotionState.startRatio, loop (#66)

* Update (#67)

* Fix circular reference (#68)

* CR (#69)

* Fix exit time greater than 1 (#70)

Co-authored-by: 黄森斌 <arsen2010@126.com>
Co-authored-by: linshunjun <49218738+linshunjun@users.noreply.github.com>
@shrinktofit shrinktofit deleted the share/NewGenAnim branch October 14, 2021 02:38
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.

6 participants