Commit f52d0691 authored by Whitfield, Ross's avatar Whitfield, Ross
Browse files

Update IPTS-21442/pv.py

parent 59fe2414
......@@ -8,6 +8,7 @@ ringraw.DataScalarType = 'double'
ringraw.DataByteOrder = 'LittleEndian'
ringraw.DataExtent = [0, 40, 0, 40, 0, 24]
ringraw.DataSpacing = [1.0, 1.0, 2.0]
ringraw.DataOrigin = [-20.0, -20.0, -24.0]
# get active view
renderView1 = GetActiveViewOrCreate('RenderView')
......@@ -34,7 +35,7 @@ imageFileLUT = GetColorTransferFunction('ImageFile')
imageFilePWF = GetOpacityTransferFunction('ImageFile')
# show color bar/color legend
ringrawDisplay.SetScalarBarVisibility(renderView1, True)
# ringrawDisplay.SetScalarBarVisibility(renderView1, True)
# Rescale transfer function
imageFileLUT.RescaleTransferFunction(0.0, 10.0)
......@@ -49,21 +50,31 @@ renderView1.CameraViewUp = [0,0,1]
renderView1.CameraPosition = [100, 100, -50]
scene = GetAnimationScene()
scene.NumberOfFrames = 100
scene.NumberOfFrames = 200
cameraAnimationCue1 = GetCameraTrack(view=renderView1)
import vtk
p=vtk.vtkSMUtilities.CreateOrbit((0,0,0), (0,0,1), 7, (100,100,-50))
p=vtk.vtkSMUtilities.CreateOrbit((0,0,0), (0,0,1), 7, (80,80,-50))
keyFrame0 = CameraKeyFrame()
keyFrame0.ViewUp = [0.0, 0.0, 1.0]
keyFrame0.PositionPathPoints = sum([list(p.GetPoint(n)) for n in range(p.GetNumberOfPoints())], [])
keyFrame0.ClosedPositionPath = 1
keyFrame1 = CameraKeyFrame()
keyFrame1.KeyTime = 1.0
keyFrame1.ViewUp = [0.0, 0.0, 1.0]
cameraAnimationCue1.Mode = 'Path-based'
cameraAnimationCue1.KeyFrames = [keyFrame0, keyFrame1]
SaveAnimation('/tmp/Skyrmion.png', renderView1, ImageResolution=[600, 600], FrameWindow=[0, 99])
SaveAnimation('/tmp/Skyrmion.png', renderView1, ImageResolution=[1280, 720])
# ffmpeg -i /tmp/Skyrmion.%04d.png Skyrmion.mp4
scene.NumberOfFrames = 100
SaveAnimation('/tmp/Skyrmion.png', renderView1, ImageResolution=[400, 400])
# ffmpeg -i /tmp/Skyrmion.%04d.png Skyrmion.gif
#### uncomment the following to render all views
# RenderAllViews()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment