TimeValues not updating from OpenFoam reader when using Python interface
Might be related to #20418
TimestepValues are not being updated when using the OpenFOAM Reader via Python Shell. I performed these actions via the Pipeline Browser / Properties panel and always got the correct values back. When I wrote a test case, and then just used the trace mechanism you can see the values are not what are expected. Via Pipeline Browser With Skip Zero Time unchecked I get back
With Skip Zero Time checked I get back
When I do this via python
# 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 'OpenFOAMReader'
runfoam = OpenFOAMReader(registrationName='run.foam', FileName='/opt/dev/temp/reconstruct/run.foam')
# get animation scene
animationScene1 = GetAnimationScene()
# update animation scene based on data timesteps
animationScene1.UpdateAnimationUsingDataTimeSteps()
# Properties modified on runfoam
runfoam.SkipZeroTime = 0
# get active view
renderView1 = GetActiveViewOrCreate('RenderView')
# show data in view
runfoamDisplay = Show(runfoam, renderView1, 'UnstructuredGridRepresentation')
# trace defaults for the display properties.
runfoamDisplay.Representation = 'Surface'
# reset view to fit data
renderView1.ResetCamera(False)
# show color bar/color legend
runfoamDisplay.SetScalarBarVisibility(renderView1, True)
# update the view to ensure updated data information
renderView1.Update()
# get color transfer function/color map for 'p'
pLUT = GetColorTransferFunction('p')
# get opacity transfer function/opacity map for 'p'
pPWF = GetOpacityTransferFunction('p')
# get TimestepValues
runfoam.TimestepValues
# Properties modified on runfoam
runfoam.SkipZeroTime = 1
# update the view to ensure updated data information
renderView1.Update()
# get TimestepValues
runfoam.TimestepValues
TimestepValues comes back the same
runfoam.TimestepValues [1.0, 2.0, 3.0, 4.0, 5.0]
The only way to get the TimestepValues correct is to utilize the pipeline browser and properties panel and force something to expose the apply button to trigger the operation again.