[Paraview] Setting up an animation of time-varying data in pvpython

Dray, Colan Colan.Dray at alcoa.com
Thu Aug 16 10:07:05 EDT 2012


Hello,

I am trying to load some time-varying data in pvpython, and then animate it. The data I am trying to load is a PVD file wrapping a few VTP files. The files I am working with are small test files, so size is not an issue whatsoever. When I load the PVD file in ParaView, the animation is already loaded properly, and I can just click play. When I load the PVD file through pvpython (code at bottom of message), the animation is not automatically created. The ParaView Guide mentions that "When you load time-varying data, ParaView automatically creates a default animation that allows you to play through the temporal domain of the data without manually creating an animation to do so." This does seem to explain what I am experiencing, however, I have not been able to figure out how to manually create the animation.

My guess is that I am not using the right value for "cue.AnimatedPropertyName", but I am not sure what else is available to use.


Thanks!
-Colan

P.S. The test files are just a cube that has some varying data on one corner, I would be happy to send them to anyone that would like them.

### CODE ###
from paraview.simple import *

view = CreateRenderView()
view.Background = [0.31999694819562063, 0.3400015259021897, 0.4299992370489052]
view.CenterAxesVisibility = 0

r = PVDReader(FileName='colantest.pvd')
keyf0 = servermanager.animation.CompositeKeyFrame()
keyf0.Interpolation = 'Ramp'
keyf0.KeyTime = 0.0
keyf0.KeyValues = r.TimestepValues[0]
keyf1 = servermanager.animation.CompositeKeyFrame()
keyf1.KeyTime = 10.0
keyf1.KeyValues = r.TimestepValues[-1]
cue = servermanager.animation.KeyFrameAnimationCue()
cue.AnimatedProxy = GetActiveSource()
cue.AnimatedPropertyName = 'TimestepValues'
cue.KeyFrames = [keyf0, keyf1]
scene = servermanager.animation.AnimationScene()
scene.ViewModules = [GetActiveView()]
scene.Cues = [cue]
scene.NumberOfFrames = 50
scene.Play()

### ERROR ###
ERROR: In /home/ianc/projects/ParaView-3.14.1-Source/ParaViewCore/ServerManager/vtkPVKeyFrameAnimationCueForProxies.cxx, line 95
vtkPVKeyFrameAnimationCueForProxies (0x1a793d0): Cue does not have domain or property set!




More information about the ParaView mailing list