Hello,
I have a user with a python plugin (VTKPythonAlgorithmBase as the base class) with two outputs :
class OnlineRomReader(VTKPythonAlgorithmBase):
def init(self):
VTKPythonAlgorithmBase.init(self, nInputPorts=0, nOutputPorts=2, outputType=“vtkUnstructuredGrid”)
We use the nOutputPorts to set the numbers of ports.
Almost everything works well. The only problem is that Paraview does not update the visualisation for the second output as time runs. Looks like I’m missing something in the code. I tried to set the DATA_TIME_STEP on the second port data:
outputPortII.GetInformation().Set(outputPortII.DATA_TIME_STEP(), time)
but this has no effect on the ParaView GUI.
Any ideas?
Felipe
Using Paraview 5.9.1 on linux (home made compilation)
this is the time related part on the plugin
@smproxy.reader(name="OnlineRomReader", label="Online Rom Reader With Parameters", extensions="json", file_description= "Online Rom With Parameters")
class OnlineRomReader(VTKPythonAlgorithmBase):
def __init__(self):
VTKPythonAlgorithmBase.__init__(self, nInputPorts=0, nOutputPorts=2, outputType="vtkUnstructuredGrid")
....
def RequestInformation(self, request, inInfoVec, outInfoVec):
executive = self.GetExecutive()
outInfo = outInfoVec.GetInformationObject(0)
outInfo.Remove(executive.TIME_STEPS())
outInfo.Remove(executive.TIME_RANGE())
filep = open(self._filename,"r")
import json
self.metaData = json.load(filep)
timesteps = self.GetTimestepValues()
if timesteps is not None:
for t in timesteps:
outInfo.Append(executive.TIME_STEPS(), t)
outInfo.Append(executive.TIME_RANGE(), timesteps[0])
outInfo.Append(executive.TIME_RANGE(), timesteps[-1])
return 1
def RequestData(self, request, inInfoVec, outInfoVec):
outInfo = outInfoVec.GetInformationObject(0)
executive = self.GetExecutive()
if outInfo.Has(executive.UPDATE_TIME_STEP()):
time = outInfo.Get(executive.UPDATE_TIME_STEP())
else:
time = 0
...