Added support for multiple animation clips in Collada models in Papervision3D

On my current FLARToolkit project (release soon!), I needed the ability to trigger more than one animation for a Collada file.  No problem, I figured, I’ll just use the convenient DAE.play(clip:String) method.  Unfortunately, I discovered that the implementation of that method didn’t make use of the “optional” clip name:

/**
* Plays the animation.
 *
 * @param clip Optional clip name.
 */
public function play(clip:String=null):void
{
    _currentFrame = 0;
    _currentTime = getTimer();
    _isPlaying = (_isAnimated && _channels && _channels.length);
}

Luckily, the original author, Tim Knip, had coded enough of the foundations that adding in support for multiple clips was pretty straightforward. If you need to play multiple animations for your Collada models, and can’t wait for the fix to make it into Papervision3D, you can download a replacement: DAE.as.

The bug report is Issue 191, if you want to follow progress on its inclusion in the Papervision3D trunk.

2 Comments

  1. patrick says:

    Thanks for the catch, creek23. Link has been updated, and should be working now.