Hello everyone. First of all thanks for paraview and the great python plugin support!
Is there some API to change the name of the output after the filename was set?
Context:
I started off the VTKAlgorithmBase based csv reader example and managed to read multiple vtkPolydata from my hdf5 based files. The number of vtkPolydata and their names are not known beforehand. But hardcoding to 10 should suffice for now. But then it would be nice to have human-readable names. I hoped for FillOutputPortInformation, but that seems to be for output types only.
I figure that changing the number of ports is not possible with VTKPythonAlgorithmBase. Maybe directly with vtkAlgorithm as it has the Initialize() method.
You can’t renamed sources at the VTK level where you are writing code, but you can at the ParaView Python scripting level. After loading your datasets, you can write a script that executes in ParaView’s Python Shell. Some functions to help you:
# Get a list of sources
sources = list(GetSources().values())
# Rename source 0
RenameSource('new name', sources[0])
Sorry if I didn’t make it clear. I’d like to rename the Output-0… Output-9. Not the source itself.
Is it possible to automatically trigger this script from the reader?