So I try to add animation to my scene in paraview using Python. I started with wiki script. Animation plays only when scene.Play()
is called. While it is playing ParaView (5.0.1 in my case) get stuck with window paying animation - scene can not be rotated while it is playing, buttons cannot be pushed. How to keep editor alive in ParaView animation from script?
Also when I click on editor animation Play Scene
button nothing is played at all.
I wonder how to embed animation into scene so that it would be playable and savable from ParaView editor?
That wiki example appears to be a little dated.
Try this in a script instead:
# get active source.
sphere1 = GetActiveSource()
# get animation track
sphere1StartThetaTrack = GetAnimationTrack('StartTheta', index=0, proxy=sphere1)
# create keyframes for this animation track
# create a key frame
keyFrame1 = CompositeKeyFrame()
# create a key frame
keyFrame2 = CompositeKeyFrame()
keyFrame2.KeyTime = 1.0
keyFrame2.KeyValues = [360.0]
# initialize the animation track
sphere1StartThetaTrack.KeyFrames = [keyFrame1, keyFrame2]
# get animation scene
animationScene = GetAnimationScene()
animationScene.Play()
You should be able to interact with the visualization while the animation runs and start it or stop it with the animation controls.
Note that I used ParaView's Python Trace feature to arrive at this code example.