Pipeline source gets stuck in broken state when REQUEST_DATA_OBJECT fails (v5.10.0-RC1)
When the REQUEST_DATA_OBJECT request fails once for a filter in the pipeline, the pipeline source seems to get stuck in some invalid state where it is never updated again, even if its input is changed.
This does not seem happen for any other request (REQUEST_INFORMATION, REQUEST_UPDATE_EXTENT, etc), where the pipeline source keeps working as expected even if such a request fails.
I originally discovered this bug when using "Extract Subset" on a filter that can change its output data object (e.g. Programmable Source), where the output data type changed from vtkImageData to vtkTable and back. A "constructed" example is attached below.
Tested with v5.10.0-RC1. The issue is not present in v5.9.1.
To Reproduce
(see screen capture below)
- Load the following Python plugin: MyFilter.py
My Filter
from vtkmodules.vtkCommonDataModel import vtkDataObject, vtkDataSet
from vtkmodules.util.vtkAlgorithm import VTKPythonAlgorithmBase
from paraview.util.vtkAlgorithm import smproxy, smproperty, smdomain
from datetime import datetime
@smproxy.filter(label="My Filter")
@smproperty.input(name="Input")
class MyFilter(VTKPythonAlgorithmBase):
def __init__(self):
self._request_data_object_fail = False
self._dummy = False
VTKPythonAlgorithmBase.__init__(self)
@smproperty.intvector(label='RequestDataObject Fail', default_values=0)
@smdomain.xml('<BooleanDomain name="bool"/>')
def SetRequestDataObjectFail(self, b):
self._request_data_object_fail = b
self.Modified()
@smproperty.intvector(label='Dummy', default_values=0)
@smdomain.xml('<BooleanDomain name="bool"/>')
def SetDummy(self, b):
self._dummy = b
self.Modified()
def RequestDataObject(self, request, inInfo, outInfo):
if self._request_data_object_fail:
return 0
inp = vtkDataSet.GetData(inInfo[0], 0)
if not inp:
return 0
for i in range(self.GetNumberOfOutputPorts()):
output = vtkDataSet.GetData(outInfo, i)
if not output or not output.IsA(inp.GetClassName()):
outInfo.GetInformationObject(i).Set(
vtkDataObject.DATA_OBJECT(), inp.NewInstance())
return 1
def RequestData(self, request, inInfo, outInfo):
input0 = vtkDataSet.GetData(inInfo[0])
output = vtkDataSet.GetData(outInfo)
output.ShallowCopy(input0)
print('RequestData', datetime.now())
return 1
- Create a few sources, attach "My Filter" to one of them
- Checking/unchecking the "Dummy" property updates the filter as expected
- Checking "RequestDataObject Fail" causes REQUEST_DATA_OBJECT to fail
- Unchecking "RequestDataObject Fail" does not execute the filter anymore; changing the "Dummy" property also does not update it
- Changing the filter's input does not recover its state (so far I have found no method that returns to a valid state)
Edited by Lutz Hofmann