It works fine until I want to fade between states which have same animations (i.e. I add add(0.1).animation('idle').animation("random").end() instead of idle)
and add(0.1).animation('idle').animation("random").end() instead of swim-idle) I can't properly calculate blend weights for cross-blend between 2 states.
I know people did that in Ogre in the past as there were animation trees implemented in the past, but I got no idea how this could be implemented.
Any ideas?
if I hard-switch state without fading in/out there is no problem. If states are totally different (no same animations between states),
there is no problem fading. Looks like I need to somehow specially handle case where states have the same animation otherwise the blend amount is calculated incorrectly. I think either it should be possible to duplicate animation states for that case or it is impossible to do. But logic tells me that as I flatten the tree, I get a set of states with blend amounts and cross-fade between them it should work, but I could not find any implementation doing this.
I think I could use duplicate animations but that sounds a bit crazy... also no similar implementations have problems like this...
If animation system supported additive animations that would avoid problems like that, but that's what we have...