Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Whitfield, Ross
wand
Commits
f52d0691
Commit
f52d0691
authored
Aug 30, 2018
by
Whitfield, Ross
Browse files
Update IPTS-21442/pv.py
parent
59fe2414
Changes
1
Hide whitespace changes
Inline
Side-by-side
IPTS-21442/pv.py
View file @
f52d0691
...
...
@@ -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
=
1
00
scene
.
NumberOfFrames
=
2
00
cameraAnimationCue1
=
GetCameraTrack
(
view
=
renderView1
)
import
vtk
p
=
vtk
.
vtkSMUtilities
.
CreateOrbit
((
0
,
0
,
0
),
(
0
,
0
,
1
),
7
,
(
100
,
10
0
,
-
50
))
p
=
vtk
.
vtkSMUtilities
.
CreateOrbit
((
0
,
0
,
0
),
(
0
,
0
,
1
),
7
,
(
80
,
8
0
,
-
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()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment