Make source a VTK object?

I know that in programmable filters, I can get the input in the scene easily by using self.GetInputDataObject(0, ). It is already a vtkPolyData object.

When I tried to troubleshoot, I am trying to first locate a source (which is an STL file I already loaded):
src = GetSources().values()[0]

And I can see the type:
type(src)
<class ‘paraview.servermanager.STLReader’>

But I cannot pass it to many vtk functions (e.g. vtk.vtkImplicitPolyDataDistance().SetInput()) because it is not a VTK object. How can I convert it into a VTK object?

The error message is:
pdd = vtk.vtkImplicitPolyDataDistance()
pdd.SetInput(src)

Traceback (most recent call last):
File “”, line 1, in
TypeError: SetInput argument 1: method requires a VTK object

Thanks,
Shawn

Ah here it is:

Use servermanager.Fetch(src) to get the data.

1 Like