Filter: Limited number of output ports
Following the documentation of util.vtkAlgorithm I want to write a filter which provides multiple output ports.
n = 10
from vtkmodules.util.vtkAlgorithm import VTKPythonAlgorithmBase
from paraview.util.vtkAlgorithm import smproxy, smproperty, smdomain
@smproxy.filter(label='testMultipleOutput')
@smproperty.input(name='Input')
@smdomain.datatype(dataTypes=['vtkDataSet'], composite_data_supported=False)
class TestMultipleOutput(VTKPythonAlgorithmBase):
def __init__(self):
VTKPythonAlgorithmBase.__init__(self, nOutputPorts=n, outputType='vtkUnstructuredGrid')
def RequestData(self, request, inInfo, outInfo):
print(outInfo.GetNumberOfInformationObjects())
for i in range(n):
print(outInfo.GetInformationObject(i))
return 1
The above filter is doing fine. But if n is increased to some value > 10 the for loop crashes when i >= 10.