Hi,
This topic probably has multiple issues but they may be related so I figured I’d put it all together. I’m using ParaView 5.9 downloaded from the main location. What I wanted to do was to load a time-series data, use a Slice
filter, animate the location of that slice filter plane’s location through the Slice Offset Values
and save that as a time series dataset. In addition, I wanted to use the Python trace on the entire workflow for later use. The generated Python trace output was (note that I disabled the output of rendering components in the Python trace since I just wanted the data files):
# trace generated using paraview version 5.9.0
#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
# create a new 'XML Partitioned Image Data Reader'
input_ = XMLPartitionedImageDataReader(registrationName='input_*', FileName=['/home/acbauer/Code/ParaView/JUNK/Catalyst/CxxImageDataExample/input_0.pvti', '/home/acbauer/Code/ParaView/JUNK/Catalyst/CxxImageDataExample/input_5.pvti', '/home/acbauer/Code/ParaView/JUNK/Catalyst/CxxImageDataExample/input_10.pvti', '/home/acbauer/Code/ParaView/JUNK/Catalyst/CxxImageDataExample/input_15.pvti', '/home/acbauer/Code/ParaView/JUNK/Catalyst/CxxImageDataExample/input_20.pvti', '/home/acbauer/Code/ParaView/JUNK/Catalyst/CxxImageDataExample/input_25.pvti', '/home/acbauer/Code/ParaView/JUNK/Catalyst/CxxImageDataExample/input_30.pvti', '/home/acbauer/Code/ParaView/JUNK/Catalyst/CxxImageDataExample/input_35.pvti', '/home/acbauer/Code/ParaView/JUNK/Catalyst/CxxImageDataExample/input_40.pvti', '/home/acbauer/Code/ParaView/JUNK/Catalyst/CxxImageDataExample/input_45.pvti', '/home/acbauer/Code/ParaView/JUNK/Catalyst/CxxImageDataExample/input_50.pvti', '/home/acbauer/Code/ParaView/JUNK/Catalyst/CxxImageDataExample/input_55.pvti', '/home/acbauer/Code/ParaView/JUNK/Catalyst/CxxImageDataExample/input_60.pvti', '/home/acbauer/Code/ParaView/JUNK/Catalyst/CxxImageDataExample/input_65.pvti', '/home/acbauer/Code/ParaView/JUNK/Catalyst/CxxImageDataExample/input_70.pvti', '/home/acbauer/Code/ParaView/JUNK/Catalyst/CxxImageDataExample/input_75.pvti', '/home/acbauer/Code/ParaView/JUNK/Catalyst/CxxImageDataExample/input_80.pvti', '/home/acbauer/Code/ParaView/JUNK/Catalyst/CxxImageDataExample/input_85.pvti', '/home/acbauer/Code/ParaView/JUNK/Catalyst/CxxImageDataExample/input_90.pvti', '/home/acbauer/Code/ParaView/JUNK/Catalyst/CxxImageDataExample/input_95.pvti', '/home/acbauer/Code/ParaView/JUNK/Catalyst/CxxImageDataExample/input_99.pvti'])
input_.CellArrayStatus = ['pressure']
input_.PointArrayStatus = ['velocity']
# get animation scene
animationScene1 = GetAnimationScene()
# update animation scene based on data timesteps
animationScene1.UpdateAnimationUsingDataTimeSteps()
UpdatePipeline(time=0.0, proxy=input_)
# rename source object
RenameSource('input', input_)
# create a new 'Slice'
slice1 = Slice(registrationName='Slice1', Input=input_)
slice1.SliceType = 'Plane'
slice1.HyperTreeGridSlicer = 'Plane'
slice1.SliceOffsetValues = [0.0]
# init the 'Plane' selected for 'SliceType'
slice1.SliceType.Origin = [35.0, 33.0, 28.6]
# init the 'Plane' selected for 'HyperTreeGridSlicer'
slice1.HyperTreeGridSlicer.Origin = [35.0, 33.0, 28.6]
UpdatePipeline(time=0.0, proxy=slice1)
# get animation track
slice1ContourValuesTrack = GetAnimationTrack('ContourValues', index=-1, proxy=slice1)
# create keyframes for this animation track
# create a key frame
keyFrame15535 = CompositeKeyFrame()
keyFrame15535.KeyValues = [-55.96391694654691]
# create a key frame
keyFrame15536 = CompositeKeyFrame()
keyFrame15536.KeyTime = 1.0
keyFrame15536.KeyValues = [55.96391694654691]
# initialize the animation track
slice1ContourValuesTrack.KeyFrames = [keyFrame15535, keyFrame15536]
# save data
SaveData('/home/acbauer/Code/ParaView/JUNK/Catalyst/CxxImageDataExample/timedslice.vtp', proxy=slice1, PointDataArrays=['velocity'],
CellDataArrays=['pressure'],
FieldDataArrays=['TimeValue', '__CatalystChannel__'],
Writetimestepsasfileseries=1)
So a couple of issues here:
- When I saved the data in the GUI it didn’t animate the location of the slice plane
Slice Offset Values
property though it did generate the time series data properly. The animation was set up correctly though since if I played the animation with the VCR controls I see the slice plane moving. - The Python trace isn’t capturing the modifications to the animation
KeyValue
changes. I changed them from -55.96391694654691 to -10 and 55.96391694654691 to 10. - If I run the script with pvpython the slice location also doesn’t move though this is probably to be expected.
So which of the above issues are expected behaviors and which ones are bugs? Note that I also tried animating the slice plane through the filter’s Slice.Origin value and had similar results.
Thanks,
Andy