Start a new topic

Saving simulations to a video file

Hi,

How can I save my simulations into a video file using the SDK? I'm running the simulations at 1000 fps but would like to record them so that I can see how they look in real time (and use them in presentations and such) - so I need them to be recorded at a different rate. 


Thanks,

Corey


Hi Corey,


Attached is an extension that saves the 3D graphics output of your Vortex Studio simulation to a series of png files. This series of screenshots can be compiled into a video using the video editing software of your choosing.

You can just drop the ExScreenshot folder in the tutorials folder of your Vortex installation, and then add the contained visual studio project to the visual studio solution tutorials/tutorials.sln and compile it. This creates a plugin file (ExScreenshot.vxp) which you can copy to the Vortex plugins folder and which will make the extension available in your simulation.

Create the extension as usual using the extension factory with the factory key used in the Plugin.cpp file.

The extension is self-explanatory. It has two parameters, an "Output path" parameter (by default this is your system's temp folder) and a "Save screenshots" parameter which you need to set to true for the screenshot files to be produced.


Let me know if this gets the job done.


Cheers,

Daniel

zip

Hi Daniel,

Is this compatible with Vortex Studio 2017c? When I load the project, it says (Visual Studio 2015), whereas my simulation uses (Visual Studio 2010). 


Thanks,

Corey

It's a tutorial project for 2018b.

You can easily create the project for your version of Vortex as I just did by copy-pasting the ExUserExtension project and replacing all the source files with the ones from the zip.

And then adding the dependency VxGraphics.lib and VxGraphicsd.lib for Release and Debug configurations in the properties of the project manually. This is under right click on the project in the solution -> Properties -> C++ -> Input.

Here is a screenshot of that in vc14. It's the same in vc10.

After that you will be able to compile.


Debug configuration:

image


Example for the release configurations:

image


Let me know if this works for you.


Daniel

One last thing: after copy pasting the ExUserExtension vcproj file, just go in with a text editor and replace all occurrences of ExUserExtension by ExScreenshot. Then save the file and only then add it to the tutorials.sln solution.

Among other things, this will make sure that the plugin (vxp file) will be saved as ExScreenshot.vxp and not as ExUserExtension.vxp.

Hi Daniel,

I'm a little bit confused. I'm not including any of the tutorial projects in my solution, I have it set up like this: 

image


All I'm missing is the VxGraphics/Window.h file. If I have this file, it should work, right?



I see. The Window.h header file was internal in 2017c. You will need to upgrade to 2018b for this to work.


Daniel

Oh okay,

I don't think I'll have the time to port my simulation to the new version


Thanks anyways! 

Hi Corey,


Porting from 2017c to 2018b should be seamless. All 2017c files can be loaded in 2018b without issue. So it should be just a replacement of the SDK.


Daniel

Login to post a comment