[Paraview] Animation with pvbatch

Brian Corrie bcorrie at sfu.ca
Tue Jul 16 15:53:43 EDT 2013


Hi Mathias,

I recently created the following script to do an animation. Hard coded 
number of time steps, but shouldn't be hard to get the begin/end etc. 
The python program is at the bottom of the page.

https://www.westgrid.ca/support/visualization/remote_visualization#batchvis

Famous last words, this worked for me 8-)

Brian


On 16/07/2013 12:45 PM, Mathias Winkel wrote:
> 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
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview


More information about the ParaView mailing list