For the Construct 3 Spine plugin, it renders a skeleton instance to a texture and the texture is then used by C3 to display the rendered Spine instance as a Sprite.
One performance enhancement I am looking at implementing is having Spine only rendering to texture when the skeleton instance is still animating. So, for example, if the instance was walking, the render would be continuous through the walk (e.g. looping animation). However if the instance was doing a sit animation, it would stop after the animation is complete, at this point we could stop rendering to texture and just the last render of the animation as a texture until something changes (e.g. new animation applied.)
What is the best way to check that all tracks of animations are complete on an instance (or that all animations have been completed?) We may need to render one last time at this point, but then none after that.
I was initially thinking about using listeners for complete on each active track and checking that complete is done for all active tracks and that none of the tracks are looping. However, I will need to do some boo keeping on which tracks are active, if their animations are changed, if they completed, etc.
Is there a simpler way to know that all animations on all tracks are complete, so I can stop rendering the skeleton to texture? Perhaps using isComplete() along with a check on if looping is enabled?
Thanks in advance for any comment or other suggested directions to look at.