Is it possible to use a custom filter from pvpython?

Hi,
I have created a very long python script from a trace. Unfortunately I used a custom filter, so the trace took it as a function. Now, if I want to re-run the script generated by the trace, I get the error that pvpython does not know anything about the custom filter. Is there a way to load the custom filter into pvpython? In the trace script the custom filter is a function, so I tried to look for a file to import without any success. I tried looking for a file called as the custom filter but did not find it anywhere and the only file with something related is the file ~/.config/ParaView/ParaView5.6.0.ini where the custom filter is mentioned but I don’t see how to use the info there into the trace script. BTW, I am using Mac Os X Mojave with Paraview 5.6.0.
Thnkas in advance

Programmable filter are supported in python script.

Unfortunately I used a custom filter, so the trace took it as a function.

What do you mean by that ?

Could you explain how did you manage to obtain an unusable python script ?

Hello,
Regarding your questions:

  • Custom filter as a function: At least in the trace I get, a custom filter looks like a function call. Example: My filter is called spheres. Here is the code that appears in the trace when I use the custom filter:
    # create a new 'spheres'
    spheres1 = spheres(Input=packing_initialvtp)

  • How I managed to obtain an unusable script : Well, I just used the trace function and a custom filter, and since a custom filter is a function call, when I try to run the trace script with pvpython the interpreter does not know where that function (the custom filter) is defined, so that throws an error. I am attaching the script generated by the trace. It just opens a file and then applies the custom filter. As you can see, there is no declaration of the function spheres (that is, the custom filter) .
    example.py (4.6 KB)

So my original question remains: How do I use a custom filter with pvpython? Should I include some special path? should I export the custom filter as a python script (currently it looks than I can only export it as an xml). My work around was to not use the custom filter and just use the primitive glyphs. But the question still remains.

Thanks in advance

Edit: formatting

Looks like using CustomFilter in pvpython is not supported sadly. This is an usability bug imo.

Am I mistaken @utkarsh.ayachit ?

3 Likes