I started building my paraview plugin using the paraview-easy-plugin-builder. I successfully build my plugin and also tested it in the corresponding paraview release (5.10.0).
However, I could not get the python wrapping of my plugin to work properly.
Previously, I built my plugin locally on top of a paraview that I built from source, however for the python wrapping, the cmake-files I used do not exist in the superbuild (vtkPythonWrapping, vtkWrapPython, vtk_wrap_python3, python_add_module):
However, the python module is now not available within paraview.simple.
Is there anything I am missing, or did I just put the python-library into the wrong folder (I just keep it in the Plugin/ThetaReaderModule folder).
Maybe I also need to use vtk_module_add_python_module or vtk_module_add_python_package for this?
I hope someone can help me or hint into the right direction.
I am using the “Easy Builder” and changed the link in the first post accordingly (otherwise Paraview 5.10.0 would not work, right?)
Yes, the wrapping itself works (creates the vtkThetaReader.so file), which I can also load in pvpython after setting the PYTHONPATH to the location of the vtkThetaReader.so file.
However, to load my plugin, I have to do:
That’s what I wanted to avoid, since I would have to completely install paraview 5.10.0 from source locally.
Isn’t there any example, on how to wrap a plugin to the vtk/paraview python? Or at least a hint, on where to put the python-library, so that pvpython can find it?
Isn’t there any example, on how to wrap a plugin to the vtk/paraview python? Or at least a hint, on where to put the python-library, so that pvpython can find it?
The wrapping si automatic and should not require anything specific in your plugin. You should be able to load your plugin and just use the python shell as if the code you built is part of actual paraview.
Ok, So I think I found the solution (or rather my error):
When I finished building the Plugin, I copied it to $PARAVIEW_DIR/plugins instead of $PARAVIEW_DIR/lib/paraview-5.10./plugins.
Now the plugin is automatically found by paraview and can be imported via from paraview.simple import vtkThetaReader
I reread all the info on the Plugins from the HowTo and found another mistake I (unintenionally) made:
I forgot to set the PV_PLUGIN_PATH variable.
When I set it to point to the $PARAVIEW_DIR/plugins folder, everything loads fine and also the python-import still works as expected.