[Paraview] Animation with pvbatch

Mathias Winkel win_wa at gmx.net
Tue Jul 16 15:45:40 EDT 2013


Hello,

I am trying to produce an animated series of images with pvbatch and the 
scriptbelow. The pvsm fileloads a pvd file with a time series and 
applies a number of filters.
When executed in the Paraview GUI (version 4.0.1) via Tools->Python 
Shell->Run Script, it successfully steps through the animation.

Whenrun with pvbatch, I see the correct output of "print AN.EndTime" 
(2999- the same number as when run in the GUI), but AN.GoToNext() 
apparently does nothing and the loop immediately terminates after one 
step with newtime==oldtime==0.0. What am I doing wrong?
I browsed through numerous examples for animation with pvbatch but none 
of them did really fit (most of them are rather old or use 
AnimateReader() which does not seem to be appropriate here).
Do you have a suggestions?

Thanks in advance,

Mathias





8<-----------------------------------------

from paraview.simple import *

servermanager.LoadState("paraview.pvsm")

V=GetRenderView()
SetActiveView(V)

AN=GetAnimationScene()
AN.Caching=False
AN.GoToFirst()

oldtime = -1
newtime = AN.AnimationTime

print AN.EndTime

while newtime>oldtime:
   print newtime
   V.StillRender()
   #WriteImage("animation_%6.6d.png" % int(newtime))
   AN.GoToNext()
   oldtime = newtime
   newtime = AN.AnimationTime
   print oldtime, newtime


More information about the ParaView mailing list