Help! How create a "depth map" using ParaView (Is it possible)

Hi,
There is probably a easier way to do it but here is a solution using VTK python bindings:

import vtk
ss = vtk.vtkWindowToImageFilter()
ss.SetInputBufferTypeToZBuffer()
ss.SetInput(GetActiveView().SMProxy.GetRenderWindow())
writer = vtk.vtkXMLImageDataWriter()
writer.SetInputConnection(ss.GetOutputPort())
writer.SetFileName('/tmp/capture.vti')
writer.Write()

More information here: https://www.vtk.org/doc/nightly/html/classvtkWindowToImageFilter.html

Cheers,
Michael

1 Like