I found a bug in away3d gold when playing the same non-looping animation on more than one mesh.
Each mesh has its own SkeletonAnimator, using a shared AnimationSet. When 2 or more meshes play the same AnimationState, simultaneously or not, it creates a weird error in SkeletonClipNode with _currentFrame being a ridiculously high number (in the billions).
Attached is a simple FlashDevelop project that shows the bug using the HellKnight mesh. I modified slightly SkeletonAnimationState, IAnimationNode and AnimationNodeBase in order to get the animation duration, but didn’t touch anything else. This issue happens with any MD5 mesh I tried.
I also “found” quite a big problem with the way animations are handled in Gold version : out of the box, sharing animations doesn’t work (Shegl if you’re reading this, I was wrong in the other thread, got mistaken by the fact I was used to have it working and it was hard to notice in my game with the non-looping animation error popping up every few seconds).
To illustrate, in my diablo-like project I can have 2 skeleton warriors (same geometry, same material, same animationSet, different animator) play different animations : one attacking and the other walking for example.
But I can’t have both playing the same attack animation : technically I can of course, but visually both skeleton warriors will play the animation in perfect synchronization, even if one started attacking before the other.
This was not the case before the animation refactor, with “old” dev releases I could have all my skeleton warriors play the same animation independantly without any trouble.
My first question is : is this intended ? Or is it something that was overlooked during the animation refactoring ?
If it is intended, what’s the “official” / recommended way of dealing with the situation I exposed ?
Duplicating AnimationStates and create an AnimationSet per skeleton warrior ? If I’m not mistaken that aso requires a different material for each skeleton warrior, while they all should look the same so performance-wise that’s very bad (and out of question in my case).
Having “pools” of AnimationStates in the AnimationSet ? Meaning for example having 10 clones of the skeleton attack AnimationState, and keeping track of which ones are currently played so that every AnimationState is only used by one mesh/animator at a time ?
Modifying the SkeletonAnimator code (like Shegl suggested in another thread) so that it clones AnimationStates before playing them ?
I can hack myself through this for now, but it looks quite a big issue to me as this is a rather typical thing one wants to do in many games / apps.