Visualizer and Python based Paraview plugins

Hello All,

I’ve created a Python based plugin (which include a number of new sources and filters) that I routinely use in Paraview (5.7.0, Python 3) successfully.

Recently I’ve attempted to integrate and use these through Visualizer … i.e.

  1. Copy and update the default proxies.json template with the additional names of my original sources and filters
  2. Start a local server, linking the python plugin file:

…/pvpython -dr /usr/lib/node_modules/pvw-visualizer/server/pvw-visualizer.py --content /usr/lib/node_modules/pvw-visualizer/dist --port 8080 --data …/data_location --plugins …/paraview_plugin.py --proxies ./proxies.json

The server works well, and the additional names of the sources/filters are shown. But these sources or filters are not functional … i.e. the visualizer icon flashes once when the custom source is selected, and that’s it … (I’ve also tried starting the server without the ‘-dr’ and autoloading the plugin in paraview)

My initial question … can visualizer/pvpython function with Python based plugins (or do I need to develop C++/XML versions)? … or is it something else simple that I have missed??

Thank you to all the contributors to Paraview and it’s tools … it’s an awesome piece of software :slight_smile:

Kind regards,
Azure

Hi Azure,

I’ve been using Python plugins in many pvw apps but I guess I never tried to load them with the --plugins protocol and it is possible that we have a bug in that protocol.

Looking at the code the --plugins run simple.LoadPlugin('/.../file.py', ns=globals()) while the code I used that seems to work is simply doing simple.LoadPlugin('/.../file.py').

Feel free to create your own python server by cloning the visualizer one and adding the load plugin call yourself…

BTW, visualizer is bundled along with the ParaView binaries that you can download from our website.

HTH,

Seb

Thank you Seb,

That worked like a treat! … I simply added simple.LoadPlugin('/.../mypluginfile.py') prior to starting the server in a pvw-visualizer.py example script :slight_smile:

Cheers again, and for the quick response!
Azure