# Plugin with multiple custom filters

**URL:** https://discourse.paraview.org/t/plugin-with-multiple-custom-filters/8424
**Category:** ParaView Support
**Created:** [November 17, 2021, 2:13am UTC](https://discourse.paraview.org/t/plugin-with-multiple-custom-filters/8424 "2021-11-17T02:13:01Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![anthomas](https://discourse.paraview.org/user_avatar/discourse.paraview.org/anthomas/32/7342_2.png) [@anthomas](https://discourse.paraview.org/u/anthomas)
#### Post date: [November 17, 2021, 2:13am UTC](https://discourse.paraview.org/t/plugin-with-multiple-custom-filters/8424/1 "2021-11-17T02:13:01Z")

</div>

I have two separate plugins that add filters to paraview. The plugins expose different existing filters. When I load both plugins into paraview, selecting either added filter loads the same interface in the pipeline under different names, with this being the first plugin that was loaded. Both plugins work successfully if loaded in different sessions. Is there a way around this?

I believe it was also mentioned that a plugin can add multiple filters to paraview, which may also solve the problem. Are there any examples for a plugin that contains multiple filters? I have not been able to find any.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [November 17, 2021, 9:16am UTC](https://discourse.paraview.org/t/plugin-with-multiple-custom-filters/8424/2 "2021-11-17T09:16:47Z")

</div>

> [@anthomas](#):
>
> The plugins expose different existing filters. When I load both plugins into paraview, selecting either added filter loads the same interface in the pipeline under different names, with this being the first plugin that was loaded. Both plugins work successfully if loaded in different sessions. Is there a way around this?

You have some name collisions.

> I believe it was also mentioned that a plugin can add multiple filters to paraview, which may also solve the problem. Are there any examples for a plugin that contains multiple filters? I have not been able to find any.

Of course, you can find one here: [https://gitlab.kitware.com/paraview/paraview/-/tree/master/Plugins/ExplicitStructuredGrid](https://gitlab.kitware.com/paraview/paraview/-/tree/master/Plugins/ExplicitStructuredGrid)

Please note, you can even use a single .xml file instead of multiple ones.

---

<div class="post-metadata">

### Author: ![anthomas](https://discourse.paraview.org/user_avatar/discourse.paraview.org/anthomas/32/7342_2.png) [@anthomas](https://discourse.paraview.org/u/anthomas)
#### Post date: [November 19, 2021, 3:23am UTC](https://discourse.paraview.org/t/plugin-with-multiple-custom-filters/8424/3 "2021-11-19T03:23:00Z")

</div>

Thank you for the example - I was able to get my plugin to compile successfully implementing two filters. The plugin shared lib  
rary successfully loads into paraview and the filters are available in the filter tree, however, when I select either filter paraview crashes.

I am building against the paraview superbuild v5.9.1 on windows, here is the plugin file [pvOptGUI.zip](https://discourse.paraview.org/uploads/short-url/sAT5vMDN4AWNkuxfE3UK2iJXihr.zip) (261.0 KB)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [November 19, 2021, 9:45am UTC](https://discourse.paraview.org/t/plugin-with-multiple-custom-filters/8424/4 "2021-11-19T09:45:31Z")

</div>

pvOptUMesh seems to work perfectly.

pvOptAirFoil does not work because the filter it uses, vtkCountCellVertices, does not exist in your plugin nor in VTK/ParaView

---

<div class="post-metadata">

### Author: ![anthomas](https://discourse.paraview.org/user_avatar/discourse.paraview.org/anthomas/32/7342_2.png) [@anthomas](https://discourse.paraview.org/u/anthomas)
#### Post date: [November 20, 2021, 1:03am UTC](https://discourse.paraview.org/t/plugin-with-multiple-custom-filters/8424/5 "2021-11-20T01:03:54Z")

</div>

I tried changing the filter type for pvOptAirfoil a few times to filters that existed in the superbuild, each time making sure I was including the library that the filter came from:

vtkCountVertices - caused paraview to crash on loading the plugin  
vtkMeshQuality - plugin loaded but selecting either filter selected the first built one again  
vtkEvenlySpacedStreamlines2D - pvOptUMesh was loaded in filter tree and working but pvOptAirfoil was missing.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [November 20, 2021, 10:09am UTC](https://discourse.paraview.org/t/plugin-with-multiple-custom-filters/8424/6 "2021-11-20T10:09:57Z")

</div>

Not sure what you mean, in any case, the filter vtkCountCellVertices is absent from the plugin you shared, this can’t work.

Share your other versions if you need help.

---

<div class="post-metadata">

### Author: ![anthomas](https://discourse.paraview.org/user_avatar/discourse.paraview.org/anthomas/32/7342_2.png) [@anthomas](https://discourse.paraview.org/u/anthomas)
#### Post date: [November 29, 2021, 9:49pm UTC](https://discourse.paraview.org/t/plugin-with-multiple-custom-filters/8424/7 "2021-11-29T21:49:57Z")

</div>

Here is the example where the two filters are exposing the same vtk class vtkMeshQuality. Both pvOptAirfoil and pvOptUMesh load the pvOptAirfoil custom filter when selected. You mentioned something about name clashing? What could cause this?

[pvOptGUI.zip](https://discourse.paraview.org/uploads/short-url/2kL3IQ4KQbi29tPEdrvETYtnNQr.zip) (261.1 KB)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [November 30, 2021, 10:11am UTC](https://discourse.paraview.org/t/plugin-with-multiple-custom-filters/8424/8 "2021-11-30T10:11:39Z")

</div>

Your plugin is working perfectly here.

> You mentioned something about name clashing? What could cause this?

Do not use the same name for proxies.

---

<div class="post-metadata">

### Author: ![anthomas](https://discourse.paraview.org/user_avatar/discourse.paraview.org/anthomas/32/7342_2.png) [@anthomas](https://discourse.paraview.org/u/anthomas)
#### Post date: [November 30, 2021, 5:26pm UTC](https://discourse.paraview.org/t/plugin-with-multiple-custom-filters/8424/9 "2021-11-30T17:26:38Z")

</div>

I was able to make it work, the issue was that both the property widgets I was creating in the cmakelists had the same name. Thank you for the help.
