Animated gif

Animated gif

tomi_kosunen
Not applicable
20 Views
2 Replies
Message 1 of 3

Animated gif

tomi_kosunen
Not applicable

[ FlexSim 23.0.0 ]

Is there any chance to add and play animated gif in FlexSim?


0 Likes
Accepted solutions (1)
21 Views
2 Replies
Replies (2)
Message 2 of 3

kavika_faleumu
Autodesk
Autodesk
Accepted solution

Hey @Tomi Kosunen, here are a few links that may help you display a gif in your model.

  • FlexSim doesn't have any built-in support for animated textures such as gif files, but you could load each frame in as a texture and then use setobjecttextureindex() to cycle through them. You do could that within an object's animation by calling setobjecttextureindex() in the triggers of the animation. Here's an example model demonstrating this: animated-image.fsm
    • To minimize events for performance optimization, you could also just write your own code in the object's OnPreDraw trigger that switches the texture index instead of using the Animator's triggers. Here's an example model demonstrating this: animated-image-2.fsm
  • You can also display it using an HTML viewer (check this post out). The example in this post uses an image, but you can replace the image with a file path to a gif (like this: scale-image-1.fsm).
Message 3 of 3

tomi_kosunen
Not applicable

Thanks a lot @Kavika F . Model animated-image-2.fsm was the best for me and it was easy to modify. As for loading the bunch of frames into model I used command loadimage.

animation-in-flexsim.gif