mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
102.79k stars 35.38k forks source link

Blend Trees #6935

Open bhouston opened 9 years ago

bhouston commented 9 years ago

Unity & Unreal Engine use blend trees to blend between different clips in a realistic way. Details are here:

https://github.com/mrdoob/three.js/issues/6881#issuecomment-126839845

https://github.com/mrdoob/three.js/issues/6881#issuecomment-126890409

/ping @crobi

donmccurdy commented 6 years ago

Is this addressed by the new animation system, or is the request here for more of a state machine abstraction around AnimationActions?

crobi commented 6 years ago

AFAIK the issue was opened before there was the new animation system.

Blend trees are mostly for blending of related animations (e.g., running and walking), not transitions between unrelated ones (e.g., running into jumping).

In a blend tree, leaves are animation clips and inner nodes control the weight (and time warp) of their subtrees. An example inner node would be a crossfade, which assigns weights w and 1-w to its two subtrees.

From what I see, AnimationAction could be used to implement a blend tree, but it would require some work.

bhouston commented 6 years ago

Blend trees could be done via converting AnimationMixer from a single node into a tree of AnimationMixers I understand.

looeee commented 4 years ago

Presumably related: #18822

jmschrack commented 9 months ago

I've recreated Unity's blendtrees for anyone else finding this post in the future. https://www.npmjs.com/package/three-blendtree