Hello, How can reproduce the Animation by Camera Orbit of the graphic client in Python?
Thanks
Just use the Python trace in ParaView to generate a trace to use in pvpython.
Hi Mathieu, thanks. The problem is that the trace generate the positions of the camera for an specific case I want a general orbit procedure given camera and positions and rotation center. At the end I am doing this:
def saveAnimationOrbit(render_view, path, resolution, animation):
num_of_keyframes = animation.frames
animationScene = simple.GetAnimationScene()
animationScene.ViewModules = [render_view]
animationScene.NumberOfFrames = num_of_keyframes
cameraAnimationCue = simple.GetCameraTrack(view=render_view)
camera = render_view.GetActiveCamera()
cue = []
for i in range(0, num_of_keyframes):
camera.Azimuth(360.0 / num_of_keyframes)
keyFrame = simple.CameraKeyFrame()
keyFrame.KeyTime = i * 1.0 / num_of_keyframes
keyFrame.Position = camera.GetPosition()
keyFrame.FocalPoint = camera.GetFocalPoint()
keyFrame.ViewUp = camera.GetViewUp()
keyFrame.ViewAngle = camera.GetViewAngle()
cue.append(keyFrame)
cameraAnimationCue.KeyFrames = cue
simple.SaveAnimation(path, render_view, ImageResolution=resolution, FrameWindow=[0, num_of_keyframes - 1],
FrameRate=animation.frame_rate)
What do you think?
Thanks
Reynaldo
Seems good enough ! Thanks for sharing your script.
Is there a way in the previous script to interpolate frames in order to not render all?
I do not think so.