Start a new topic
Answered

How to record a simulation

Hi, i am running a simulation (Vortex Studio 2019c) in Python script. The simulation does not run real-time since i am running it with another program, and i want to record it as a video file which shows real-time scene. How could i do that?


Thanks in advance


Best Answer

Hi


I don't know what is the nature of that other program, I am assuming it is blocking the Vortex simulation, preventing it to run at the frame rate as set in the VxApplication.


Vortex Studio does not offer any tools to record a video. 


However, I can suggest some alternatives:


- I am assuming you are running a single Vortex Process (dynamics and physics are running in the same process), you could try to simply record the video that show in the graphics window using a 3rd Party software (windows 10 comes with Xbox game bar for example) and then speed up the video to get the desired frame rate.


- Use Vortex Kinematic Recorder. When set to record, Vortex will basically record every input and outputs. When played back, those inputs and outputs will be played back rather than being simulated. If when playing back your other program is not running, Vortex will run at his desired frame rate, so it will playback as if real-time. This should give you the desired effect. 


The Vortex Player has a page to control the recorder, see  https://www.cm-labs.com/vortexstudiodocumentation/Vortex_User_Documentation/Default.htm#Player/vplayer__r_a_p.html?Highlight=record%20and%20playback 

The API is available from the Application Context of the application. The C++ tutorial Mechanism Viewer has a keyboard listener extension that shows how to use the API, the API is similar in python. See "C:\CM Labs\Vortex Studio 2019c\tutorials\MechanismViewer\RecorderKeyboardListener.cpp"


Hope that helps.

Have a good day,


Nicolas




1 Comment

Answer

Hi


I don't know what is the nature of that other program, I am assuming it is blocking the Vortex simulation, preventing it to run at the frame rate as set in the VxApplication.


Vortex Studio does not offer any tools to record a video. 


However, I can suggest some alternatives:


- I am assuming you are running a single Vortex Process (dynamics and physics are running in the same process), you could try to simply record the video that show in the graphics window using a 3rd Party software (windows 10 comes with Xbox game bar for example) and then speed up the video to get the desired frame rate.


- Use Vortex Kinematic Recorder. When set to record, Vortex will basically record every input and outputs. When played back, those inputs and outputs will be played back rather than being simulated. If when playing back your other program is not running, Vortex will run at his desired frame rate, so it will playback as if real-time. This should give you the desired effect. 


The Vortex Player has a page to control the recorder, see  https://www.cm-labs.com/vortexstudiodocumentation/Vortex_User_Documentation/Default.htm#Player/vplayer__r_a_p.html?Highlight=record%20and%20playback 

The API is available from the Application Context of the application. The C++ tutorial Mechanism Viewer has a keyboard listener extension that shows how to use the API, the API is similar in python. See "C:\CM Labs\Vortex Studio 2019c\tutorials\MechanismViewer\RecorderKeyboardListener.cpp"


Hope that helps.

Have a good day,


Nicolas





1 person likes this
Login to post a comment