I would like to set Paraview’s global time programmatically from the Python Shell (and later from a plugin).
I open a PVD file ‘results.pvd’ containing several time steps from Paraviews menu. Then I execute the following code in the Python Shell:
r=FindSource('results.pvd') tk=GetTimeKeeper() def setTime(tx): tk.Time=tx tk.UpdateVTKObjects() r.UpdatePipeline(tx) setTime(10.0)
The Render View now shows the correct data for Time=10.0. But the Time display next to Paraview’s VCR buttons shows “Time: 0.1 | 0 | (max is 499)”. Nothing changes in this display, when I execute the above python code.
This looks like a bug, because the TimeKeeper is supposed to signal the new time to the Time display.
Secondly, it seems strange that I need both commands “tk.Time=tx” and “r.UpdatePipeline(tx)”. If I leave out any of the commands inside the function setTime(tx), the time won’t be updated. Shouldn’t it suffice to set the TimeKeepers time, which forwards the time to all registered sources?