Custom filters problems

Hi, I’m using paraview 5.6.0 on macOS. I am trying to get custom filters to perform multiple mundane tasks like add 3d text or lines (sources) to a plot. I highlight the items in the pipeline browser (usually a sequence of objects) and then apply the create custom filter in the “standard way”. It seems to work and appears in my Custom Filter Manager. But when I look for it under Filters it is not there, but it appears in my Sources list but if I select it then paraview crashes. In my case I am not applying filters but inserting a number of sources, does this matter? Thanks,

When creating the custom filter, do you define an output ? I think you have to.

That said, crash are not acceptable we should fix it (issue here)

No luck so far, my attempt is probably the most simple kind so I’m afraid the interface is not very intuitive if I’m getting it wrong. I’ve looked all over the web for clear demonstrations, but nothing exists. Anyway, I’ll keep trying as it is really an essential feature as no one wants to be doing repetitive actions.

Another approach that I have taken is to generate a python script by using the trace feature, I can then run that from the python prompt at the “Run Script” area. I’m not that familiar with this but assume I can build up sophisticated objects this way, and will report back later if it completely solves the issue.

If you use python, you can also look at the Macro mechanism. A macro is basically a bunch of python code that you can recall easily from a button in the ParaView interface. No need to look for a file in your system each time you need it.

Once you stop the trace, save it using Save / save as macro menu of the script editor (the window that contains your trace). Then in ParaView go to Macros / Add new macro ... and choose your saved trace.
Now, you will have an item in the macro menu and a button in the toolbar, named as your script. In one click it will apply your script again ! It will be stored with ParaView preferences, so it will be there when you re-open PV later.

Main differences with custom filter :

  • you can do really more with macro, as it is just a shortcut to python scripting in ParaView.
  • custom filter ‘pack’ all filters into only one pipeline item, for easy reading in the pipeline, whereas macro just add items as if you did it manually.

Thanks for the clear description. Yes the packing from filters would be nice but beggars can’t be choosers as the expressions goes. Thanks

Please precise which sources and/or filter you want to put in a custom filter.

OK I’ll follow this up, I have a solution to a problem that doesn’t really require custom filters. It was really just adding a line in 3d space without any transformation. I think the inputs/outputs should have just been default (or next). Cheers

Adding a CustomFilter for a line works perfectly and out of the box.

OK. My approach was to use existing objects in the pipeline browser (by highlighting them) loaded from a state file rather than creating it on the fly, but it probably shouldn’t matter. We’ve been using paraview to create isosurfaces of complex quantities and its rendering is 2nd to none in my opinion so we have been very happy with it in our research, just to finish on a positive note!