Using a c++ plugin on a Python Programmable Filter


I have c++ plugin, compiled and working, this plugin has a reader and a filter.

Now I want to use the c++ plugin filter inside a programmable filter but I don’t know how to create the vtk instance of my filter.

I tried to inspect the paraview module and I can see that the filter is loaded but I don’t know how to use it (in the Script section of a ProgrammableFilter):

import paraview

PVPTinstance = paraview.modules.vtkRemotingCore.vtkPVPluginTracker().GetInstance()
a = PVPTinstance.GetNumberOfPlugins()
for i in range(a):
    if PVPTinstance.GetPluginName(i) == "ZsetToolsNativePlugin":

The output (in the “Output Messages” is :


Any ideas.

You would need to Python-wrap your VTK module (that is part of your ParaView plugin) using the CMake function vtk_module_wrap_python:

The resulting Python module can then be placed within your ParaView’s Python module search path, such that it can be imported from within a programmable filter.

When using a Plugin from python, the functions are loaded in globals().

Maybe the loaded plugin can be found in paraview.servermanger.ActiveConnection.Modules.{filters/sources/writers}.{YourPluginFunctions}