[Paraview] animation + python

Jean M. Favre jfavre at cscs.ch
Fri Aug 28 04:26:30 EDT 2009


Stephane PLOIX wrote:
> Hi,
> 
> At the end of the python scripting wiki page 
> (http://paraview.org/Wiki/ParaView/Python_Scripting), you give an example 
> on how to create an animation via python.
> 
> However, this animation is not visible in the Animation View, and I did 
> not find how to save the images to create a film. 


> *How to dump the animation to images with the scene.Play method? 

the answer lies in the source code of servermanager.py

Add these 5 lines to your code:

writer = servermanager.vtkSMAnimationSceneImageWriter()
writer.SetFileName("/tmp/foo.jpg")
writer.SetFrameRate(1)
writer.SetAnimationScene(scene.SMProxy)
writer.Save()

Jean--
Swiss National Supercomputing Center


More information about the ParaView mailing list