Hello.
I read the instruction https://www.paraview.org/Wiki/ParaView/Plugin_HowTo and build a simple HelloWorldRedaer but it doesn’t work. It load a dynamic library but can’t apply a HelloWorldReader reader.
Thanks, Mathieu.
Maybe I don’t understand but it is examples of clear python filters. And it’s working. But I can’t embedding python source as module (native dynamic library). Is it possible? What should I doing for that?
This wasn’t updated in the new module system because ParaView didn’t have any up-to-date plugins doing Python (.py) module loading. Do you have a plugin I could use to implement the functionality?
Ben, thanks for the reply. I have about 15 python plugins and I need embedding them. If you can update the example that I uploaded in the first message then I can rewrite my scripts for embedding.
This fixes ParaView’s module loading so that it can work: https://gitlab.kitware.com/paraview/paraview/merge_requests/3308. For your plugin, changing it to be an actual package (I did HelloWorldReader/{__init__.py,hello_world_reader.py}), it now loads properly. However, I don’t know how to actually use the plugin to get the proxy to show up in the File > Open dialog. @mwestphal@utkarsh.ayachit Any ideas?
So after talking here, it seems that here’s the current status:
The PYTHON_MODULES argument to paraview_add_plugin is working as-intended as of the above MR. This makes code available to import in the shell after loading the associated plugin
Proxy Python filters should be loaded directly through the load plugin dialog. This makes them available for use in the paraview.simple module.
What your example is doing is making a proxy in a module made available in a plugin. This is the intersection of the above two use cases and is not currently supported.
There are some obstacles to overcome before this can happen:
Separate client/server cases would need to make the proxy available on the server as well by loading the plugin and then importing the associated proxy.
Proxies are registered globally right now by inspecting the globals of the module after direct importing. The decorators would need to learn how to register upon being called instead.