Using a c++ plugin on a Python Programmable Filter

hello,

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":
        print(PVPTinstance.GetPluginName(i))
        #print(PVPTinstance.GetPlugin(i))
        print(PVPTinstance.GetPluginLoaded(i)) 

The output (in the “Output Messages” is :

 ZsetToolsNativePlugin
 True

Any ideas.
Thanks
Felipe

You would need to Python-wrap your VTK module (that is part of your ParaView plugin) using the CMake function vtk_module_wrap_python:
https://vtk.org/doc/nightly/html/group__module-wrapping-python.html

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}