[Paraview] ParaView 3.6 animation script causes a segmentation fault
Wim van der Meer
wpjvandermeer at gmail.com
Sat Jun 13 04:22:26 EDT 2009
Hi,
Running the animation script below from the built-in python
interpreter with ParaView 3.6 (using the latest CVS updates today)
results in a segmentation fault.
I'd like to get camera animation to work, but I am not sure if I
should do anything different compared to 3.4. Any help would be
appreciated.
Here is the script:
#!/usr/bin/python
# -*- coding: utf-8 -*-
fps = 24.0 # frames/seconds
view = GetActiveView()
camera = GetActiveCamera()
movie = servermanager.animation.AnimationScene()
movie.ViewModules = [view]
movie.NumberOfFrames = int(round(fps * 3.0, 0))
cam_vu = camera.GetViewUp()
cam_pos = camera.GetPosition()
cue = servermanager.animation.KeyFrameAnimationCue()
cue.StartTime = 0.0
cue.EndTime = 1.0
movie.Cues.append(cue)
keyf0 = servermanager.animation.CameraKeyFrame()
keyf0.KeyTime = 0.0
keyf0.Position = camera.GetPosition()
keyf0.FocalPoint = camera.GetFocalPoint()
keyf0.ViewUp = camera.GetViewUp()
keyf0.ViewAngle = camera.GetViewAngle()
camera.SetRoll(60.0)
camera.Elevation(-50.0)
keyf1 = servermanager.animation.CameraKeyFrame()
keyf1.KeyTime = 1.0
keyf1.Position = camera.GetPosition()
keyf1.FocalPoint = camera.GetFocalPoint()
keyf1.ViewUp = camera.GetViewUp()
keyf1.ViewAngle = camera.GetViewAngle()
cue.KeyFrames = [keyf0, keyf1]
camera.SetViewUp(cam_vu)
camera.SetPosition(cam_pos)
#movie.Play() # Play the animation
movieWriter = servermanager.vtkSMAnimationSceneImageWriter()
movieWriter.SetFrameRate(fps)
movieWriter.SetFileName("movie.png")
movieWriter.SetAnimationScene(movie.SMProxy)
movieWriter.Save()
More information about the ParaView
mailing list