"Reload Python Module" does not reload XML properties
Steps to reproduce:
- Load
source.py
as plugin (Manage Plugins -> Load New) with the following contents
from paraview.util.vtkAlgorithm import *
@smproxy.source(name="PythonSuperquadricSource",
label="Python-based Superquadric Source Example")
class PythonSuperquadricSource(VTKPythonAlgorithmBase):
def __init__(self):
VTKPythonAlgorithmBase.__init__(self,
nInputPorts=0,
nOutputPorts=1,
outputType='vtkPolyData')
from vtkmodules.vtkFiltersSources import vtkSuperquadricSource
self._realAlgorithm = vtkSuperquadricSource()
def RequestData(self, request, inInfo, outInfo):
from vtkmodules.vtkCommonDataModel import vtkPolyData
self._realAlgorithm.Update()
output = vtkPolyData.GetData(outInfo, 0)
output.ShallowCopy(self._realAlgorithm.GetOutput())
return 1
@smproperty.doublevector(name="Scale", default_values=[1, 1, 1])
@smdomain.doublerange()
def SetScale(self, x, y, z):
self._realAlgorithm.SetScale(x,y,z)
self.Modified()
- Create an instance of the source in ParaView
- Remove
SetScale
insource.py
(i.e., the last five lines) - Click "Reload Python Module"
- Create a new instance of the source
At step 4, ParaView will already complain "vtkPVSessionCore (0x55ac0f22fe20): No method named SetScale
found."
At step 5, ParaView will abort after error in ParaViewCore/ServerImplementation/Core/vtkSIProxy.cxx, line 576: vtkSIPythonSourceProxy (0x7fe49800fef0): Could not parse property: Scale
If instead of clicking "Reload Python Module", the python file is loaded from the Manage Plugins menu, step 5 works as expected (newly created instances show updated GUI elements), but existing instances continue to show the SetScale property.
This was tested with version ParaView-v5.6.0-RC1-1-g13ebbf80 and python 3.7.