I am displaying a Blender model in Actionscript-3 using Papervision3D.
The model has animations, and so I have set up some AnimationClip3D animations in the code:
clip[0] = new AnimationClip3D("Clip0", 0.0, 1.0); //first animation
clip[1] = new AnimationClip3D("Clip1", 1.0, 2.0); //second animation
and so on. These are small animations 1 or 2 seconds long. The numbers indicate the start and end time in seconds.
The model shows up fine and performs the animations correctly in a random order as intended, but every 15 seconds or so, the animation pauses and 'jumps' as though there is a delay.
I set up a NEXT_FRAME listener to trace the data at each frame, and this is the output, where time is the AnimationEvent time:
Frame 1 Time 0.389
Frame 2 Time 0.995
...
Frame 25 Time 14.539
Frame 26 Time 15.128
Frame 27 Time 15.707
Frame 28 Time 0.132
Frame 29 Time 0.714
As you can see, the AnimationEvent time gets reset to zero at around 16 seconds.
Excuse my newbie question but, what causes this, and how can I stop my animation from pausing and jumping at 16 seconds?
UPDATE: I believe the problem is sorted now - please see my solution below.
I believe the problem is sorted now.
I forgot to add the animation clips to the animation of the DAE:
myDAE.animation.addClip(clip[0]);
myDAE.animation.addClip(clip[1]);
and so on.
What this means is that before adding these lines it was using clip "All" - the whole animation - and getting confused.
I can now play the correct clip (false = without looping):
myDAE.play(clip[0], false);