dodo27
dodo27

Reputation: 11

How to create a paraview animation from python script?

So, I have a set of vtk files named file_0.vtk, file_1.vtk ... In paraview I can read all these files, choose a variable ( for example 'V'), create slices in the Z direction then save a temporal animation. I get a nice movie.

Now, I wonder if it is possible to get the same result automatically in python without using the paraview interface, i.e. just by doing :

python3 ./animation.py

I know that it is possible to save python scripts in python from the commands we do through paraview or even use python from paraview, but I don't know how to create the animation without using the software. Can you help me?

Upvotes: 0

Views: 772

Answers (1)

Nico Vuaille
Nico Vuaille

Reputation: 2498

Just use the SaveAnimation() method at the end of the python script for your pipeline. See this doc (python part at the end of the section).

If you want to see the animation at runtime, then add the AnimateReader(reader, view) method instead. Here is an example.

Upvotes: 1

Related Questions