![]() |
|
Start animation from specific frame - Printable Version +- AB4D Forum (https://forum.ab4d.com) +-- Forum: Products Forums (https://forum.ab4d.com/forumdisplay.php?fid=4) +--- Forum: Ab3d.PowerToys (https://forum.ab4d.com/forumdisplay.php?fid=9) +--- Thread: Start animation from specific frame (/showthread.php?tid=4310) |
Start animation from specific frame - Alex3d - 01-03-2022 Hello How to start the animation from the specific frame? I tried next: assimpAnimationController.StopAnimation(); assimpAnimationController.GoToFrame(frame); assimpAnimationController.StartAnimation(); // animation starts from first frame But it always animates from the first frame Pause/Resume also doesn't work as I wish Thanks RE: Start animation from specific frame - abenedik - 01-04-2022 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: Code: public class MyAnimationController : AssimpAnimationControllerTo 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. RE: Start animation from specific frame - Alex3d - 01-04-2022 Thank you! In general, it works, but if the animation has been paused, then you need to call the StopAnimation () method before StartAnimation (); In another case, a frame will jump. Code: if (_assimpAnimationController.IsAnimationPaused) |