For a past project, where I needed to visualize the complex space-time varying coordinate structure of my dataset, I had:
- preprocessed the data, and added the coordinate (space-time varying) matrix
- created a programmable filter in PV to read, at each timestep, the coordinates contained in that matrix
- reassigning coordinates
- updating coordinates.
With the newer version of PV, the same code seems to have a problem with point 4 (all the rest is working, input data is the same: netcdf format, regular structured grid, [x, y, z, time]).
This is the line that used to work:
#impose new points (modified!)
but now I got following error:
Traceback (most recent call last): File "<string>", line 22, in <module> File "<string>", line 32, in RequestData AttributeError: 'vtkmodules.vtkCommonDataModel.vtkImageData' object has no attribute 'SetPoints'
It is very frustrating. I know all the rest is working, I can just not inject the new, corrected data and visualize it. Anyone knows how to? Has the syntax changed?
P.s.: filter attached:
input = self.GetInputDataObject(0, 0) output = self.GetOutputDataObject(0) output.ShallowCopy(input) newPoints = vtk.vtkPoints() numPoints = input.GetNumberOfPoints() t =self.GetInputDataObject(0,0).GetInformation().Get(vtk.vtkDataObject.DATA_TIME_STEP()) print("time: ",t) q = "zlev" input0 = inputs zlev = input0.PointData[q] print(zlev) #foreach gridpoint in my domain: for i in range(0, numPoints): #extract coordinates coord = input.GetPoint(i) x, y, z = coord[:3] z = zlev[i] #insert newPoints.InsertPoint(i, x, y, z) #impose new points (modified!) output.SetPoints(newPoints) ----- this is the culprit