I’m trying to setup nested blend trees on an anim component, following this example from the original PR .
I’m getting some very strange results when logging the path of each nested child. I’ve setup a demo project here: PlayCanvas | HTML5 Game Engine
Everything looks normal when running a blendtree 1 level deep (2 layers total including the state):
When adding children on Level2 I get this:
It seems that Level2’s name is assigned as “Level1”, and it’s not part of the path
property.
When adding children to Level3, it seems to break immediately. The first layers children is an array containing a single undefined
.
Am I approaching this incorrectly or is this an outdated JSON structure for anim state graphs?
Apologies if this explanation is all over the place, hopefully the example project can shed some light.
Thanks
Engine examples all use only a single level depth trees: PlayCanvas Examples
So it’s possible these is a bug in multi-level somewhere.
So suffice to say nested blend trees are currently not supported?
I’m not super familiar with engine code, would this be something that’s relatively straightforward to fix?
They’re supported, but as it’s likely not commonly used, it might need some fixes in some cases and similar. Hard to say, but it seems you’ve found an issue already.
Not sure about the fix, as we don’t understand the reason here. It could be just a tiny fix and the rest works, or a larger refactoring might be needed.
1 Like
LeXXik
March 22, 2024, 9:46am
5
I’ve created a ticket. @BenBean303 would you like to submit a PR?
opened 09:45AM - 22 Mar 24 UTC
Forum: https://forum.playcanvas.com/t/nested-blend-trees/35338
Repro: https://p… laycanvas.com/project/1202126/overview/nest-blend-trees
When Anim Blend Tree loops through children, it takes a parent's name, instead of a child's one.
![image](https://github.com/playcanvas/engine/assets/5677782/249a87c0-2317-429b-abaf-075d6c5569d8)
1 Like