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

Anim Blend Tree accessor override #6217

Open
LeXXik opened this issue Apr 3, 2024 · 0 comments
Open

Anim Blend Tree accessor override #6217

LeXXik opened this issue Apr 3, 2024 · 0 comments
Labels
area: animation Animation related issue bug

Comments

@LeXXik
Copy link
Contributor

LeXXik commented Apr 3, 2024

A followup on #6211:

Anim Blend Tree overrides the inherited weight accessor from Anim Node:

get weight() {
this.calculateWeights();
return this._parent ? this._parent.weight * this._weight : this._weight;

set weight(value) {
this._weight = value;
}
get weight() {
return this._parent ? this._parent.weight * this._weight : this._weight;
}

Solution:
The accessor should be removed from the Anim Blend Tree (or a setter added), and the Anim Node should add a conditional calculateWeights call:

get weight() {
    this.calculateWeights?.();
    return this._parent ? this._parent.weight * this._weight : this._weight;
}

Repro:
https://playcanvas.com/project/1205544/overview/blend-tree-forked

@mvaligursky mvaligursky added bug area: animation Animation related issue labels Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: animation Animation related issue bug
Projects
None yet
Development

No branches or pull requests

2 participants