question

Lars Jacobsen avatar image
0 Likes"
Lars Jacobsen asked Jason Lightfoot edited

Run animation from keyframe x to keyframe y

Is it possible, in a simple way, to run an animation from keyframe X to keyframe Y? I.e. from keyframe 2 to keyframe3.

Animation.fsm

FlexSim 23.2.1
animation
animation.fsm (33.8 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot edited

To sklp to the next keyframe you could try stopping the animation after a breathe and then use Animation.resume(RESUME_AT_NEXT_KEYFRAME). Then if you know the time between the keyframes* you can stop it finally at the third keyframe. Using that technique it should be quite simple to create a subflow to run based on passed parameters - startkeyframe and numkeyframes.

Example attached.

animation_keyframe_2to3.fsm


* You can find the duration of the keyframes from the difference in keyframe node values (from the tree). If you've specified a different duration when starting the animation then you'll need to calculate the effective keyframe intervals on a pro-rata basis assuming they are scaled linearly.


5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.