I am trying to use paraview.simple to render a vtkMultiBlockDataset.
If I try to do:
paraview.simple.Show(multiblock)
I get the following error: RuntimeError: Cannot show a sink i.e. algorithm with no output.
I understand I need to wrap the vtkMultiBlockDataset in some kind of wrapper but I can’t find any documentation on how to do this. Can anyone help me understand how to make this work and where to find this information?
I am using pvpython to run my script. I have a HDF5 file for which we have a library that converts it to a vtkMultiBlockDataset.
So I currently have this VTK version:
mb = read_hdf5(file) # mb is of type vtkMultiBlockDataset
mapper = vtk.vtkCompositePolyDataMapper2()
mapper.SetInputDataObject(mb)
cdda = mapper.GetCompositeDataDisplayAttributes()
mapper.SetCompositeDataDisplayAttributes(cdda)
if not mapper.GetScalarVisibility():
mapper.SetColorModeToMapScalars()
mapper.ScalarVisibilityOn()
mapper.SelectColorArray("PressureCoefficient")
mapper.SetScalarModeToUsePointFieldData()
mapper.InterpolateScalarsBeforeMappingOn()
renderer = vtk.vtkRenderer()
renderWindow = vtk.vtkRenderWindow()
renderWindow.AddRenderer(renderer)
renderWindowInteractor = vtk.vtkRenderWindowInteractor()
renderWindowInteractor.SetRenderWindow(renderWindow)
renderWindowInteractor
.GetInteractorStyle()
.SetCurrentStyleToTrackballCamera()
actor = vtk.vtkActor()
actor.SetMapper(mapper)
renderer.AddActor(actor)
renderer.ResetCamera()
renderWindow.Render()
I am looking to replace this with a Paraview version where I use paraview.simple but I don’t know how to add the mb vtkMultiBlockDataset to the Paraview pipeline.