question

Kyle Y avatar image
0 Likes"
Kyle Y asked Phil BoBo edited

how to play a video in FlexSim, but not in dashboard

I have seen a topic asking how to play a video in Dashboard in this forum. But sometimes, the video playing need to be played in the model which can be rotated with the perspective. Is there some method? Thank you.

FlexSim 19.0.0
video
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

Phil BoBo avatar image
0 Likes"
Phil BoBo answered Phil BoBo edited

FlexSim doesn't have any built-in support for playing video files in the 3D view as animated textures, 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 (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 showing that way: animated-image-2.fsm

5 |100000

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