01-04-2022, 10:23 AM
Good question. Currently there is no easy way to do that.
But you can derive your own class from AssimpAnimationController and then override the GetFrameNumber to provide a custom frame number based on the animation time. This allows you to add an offset to the frame number. The following code shows an example:
To provide an easier way to support that case in the future I have added an overload to the StartAnimation method that takes the start frame number as a parameter. This will be available in the next version.
But you can derive your own class from AssimpAnimationController and then override the GetFrameNumber to provide a custom frame number based on the animation time. This allows you to add an offset to the frame number. The following code shows an example:
Code:
public class MyAnimationController : AssimpAnimationController
{
public double FrameNumberOffset { get; set; }
public MyAnimationController(AssimpWpfImporter assimpWpfImporter)
: base(assimpWpfImporter)
{
}
public override double GetFrameNumber(double animationTimeInSeconds)
{
double frameNumber = base.GetFrameNumber(animationTimeInSeconds);
frameNumber = (frameNumber + FrameNumberOffset) % LastFrameNumber;
return frameNumber;
}
}
// then start animation by:
_assimpAnimationController.FrameNumberOffset = startFrameNumber;
_assimpAnimationController.StartAnimation();To provide an easier way to support that case in the future I have added an overload to the StartAnimation method that takes the start frame number as a parameter. This will be available in the next version.
Andrej Benedik

