I have a sequence of legacy VTK files , such as: file_0.vtk, file_1.vtk, file_2.vtkI can open in ParaView as a time series ( described here ) as file_..vtkand sequence files can be viewed and animated with the help of a time control. I am currently using ParaView 4.4.0.
Inherited VTK files look like this: where is the timestep value stored in the header (second line):
# vtk DataFile Version 3.0
vtk output: file at time 0.0
ASCII
...
However, in ParaView, the timestep values are the same as the index, i.e. index 0 is 0.0, index 1 is 1.0, and index 2 is time 2.0. And adding the AnnotateTime filter also shows these timestamps for timestep indices.
However, my files use timesteps variables as described in the header of each file. (I do not think that the legacy VTK format allows you to specify these values). I looked at the ParaView app to find out if there is a way to import or modify these values, but I cannot find it.
Using the Python built-in shell, here is my sad attempt to create an object with LegacyVTKReader :
files = ['file_0.vtk', 'file_1.vtk', 'file_2.vtk']
times = [0.0, 0.022608, 0.73781]
r = LegacyVTKReader(FileNames=files, TimestepValues=times)
print(r.TimestepValues)
r.TimestepValues = times
print(r.TimestepValues)
Show(r)
Which shows correctly in the Info dialog box until I add AnnotateTimeFilter, which resets 0 to 0, 1 to 1, and 2 to 2.
, point-click Python, timestep VTK ParaView?