question

Tomi Kosunen avatar image
0 Likes"
Tomi Kosunen asked Kavika F edited

Animated gif

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


FlexSim 23.0.0
texture
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

·
Kavika F avatar image
1 Like"
Kavika F answered Kavika F edited

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).

animated-image.fsm (22.8 KiB)
scale-image-1.fsm (35.3 KiB)
· 1
5 |100000

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

Tomi Kosunen avatar image Tomi Kosunen commented ·

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

1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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