< Back

Generating Animations One Frame at a Time in Parallel Using PyTecplot


Leveraging Python’s multiprocessing library when paired with PyTecplot scripting creates powerful efficiency. One such example is using multiprocessing to output a large amount of images in parallel. As a result, reducing the time needed to execute.

This ParallelImageCreator.py script located in the Tecplot handyscripts GitHub saves every timestep of the active frame as an individual png image. It contains the following arguments:

positional arguments:

layoutfile Tecplot layout file to open

optional arguments:

-h, –help show a help message and exit
-numprocs NUMPROCS Number of concurrent processes to run, default=int(multiprocessing.cpu_count()/2)
-imagewidth IMAGEWIDTH Width in pixels of the image, default=1024
-supersample SUPERSAMPLE Supersample factor to use for image export, default=2
-imagebasename IMAGEBASENAME Basename for exported PNG images, default=image

For example, exporting pngs with a width of 3840 with no supersampling, would be like this:

python ParallelImageCreator.py mylayout.lay -numprocs 2 -imagewidth 3840 -supersample 1 -imagebasename output