# Build plugin that already exists with different SM xml

**URL:** https://discourse.paraview.org/t/build-plugin-that-already-exists-with-different-sm-xml/4529
**Category:** ParaView Support
**Created:** [June 7, 2020, 2:19pm UTC](https://discourse.paraview.org/t/build-plugin-that-already-exists-with-different-sm-xml/4529 "2020-06-07T14:19:16Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Yoshino](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/bcef8e/32.png) [@Yoshino](https://discourse.paraview.org/u/Yoshino)
#### Post date: [June 7, 2020, 2:19pm UTC](https://discourse.paraview.org/t/build-plugin-that-already-exists-with-different-sm-xml/4529/1 "2020-06-07T14:19:16Z")

</div>

I’m trying to build paraview plugin `Temporal Interpolator` outside paraview source because i want to its property `DiscreteTimeStepInterval` to be displayed in a _dropdown list_ instead of a _double input_, which is possible, right?.  
Since this filter already exists in paraview, I have the source .h|.cxx files and altered ServerManager xml, however, I’m puzzled over the `Module` file. I’m not sure which module it depends on and so I simiply copied an example and CMake reported errors:  
`CMake Error at E:/ParaView-Build/lib/cmake/paraview-5.7/ParaViewPlugin.cmake:532 (message):
Unparsed arguments for paraview_add_plugin:
MODULE;TemporalInterpolator::TemporalaInterpolator`  
How should I fix this, or is there any convenient way to do this?

Thanks for any advice.

Yoshino.

---

<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: [June 8, 2020, 1:57am UTC](https://discourse.paraview.org/t/build-plugin-that-already-exists-with-different-sm-xml/4529/2 "2020-06-08T01:57:50Z")

</div>

> is there any convenient way to do this?

Yes, XML plugins. [ParaView: Plugin Howto](https://kitware.github.io/paraview-docs/latest/cxx/PluginHowto.html) : XML plugins part.

You will not need to build anything, just rewrite the XML of the filter as you see fit.

---

<div class="post-metadata">

### Author: ![Yoshino](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/bcef8e/32.png) [@Yoshino](https://discourse.paraview.org/u/Yoshino)
#### Post date: [June 8, 2020, 6:04am UTC](https://discourse.paraview.org/t/build-plugin-that-already-exists-with-different-sm-xml/4529/3 "2020-06-08T06:04:02Z")

</div>

Thanks! It works and I’m able to choose the new filter in the alphabetical filter menu.

However, as I mentioned above, a drop down list is what I want, and I changed the XML property to `<EnumerationDomain ` with several `Entry` as [Plugin\_HowTo#Drop down list](https://www.paraview.org/Wiki/ParaView/Plugin_HowTo#Drop_down_list) describes. As a result, the property `DiscreteTimeStepValue` was displayed without a dropdown list, nor even any input, just like this:  
 ![image](https://discourse.paraview.org/uploads/default/original/2X/c/c934976ba54a81f09b0922371c71b57b94e279b0.png)  
Is the GUI parameter `EnumerationDomain` deprecated or it won’t work in this case?

---

<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: [June 8, 2020, 8:18am UTC](https://discourse.paraview.org/t/build-plugin-that-already-exists-with-different-sm-xml/4529/4 "2020-06-08T08:18:40Z")

</div>

Can you share the xml you are using ?

---

<div class="post-metadata">

### Author: ![Yoshino](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/bcef8e/32.png) [@Yoshino](https://discourse.paraview.org/u/Yoshino)
#### Post date: [June 8, 2020, 9:44am UTC](https://discourse.paraview.org/t/build-plugin-that-already-exists-with-different-sm-xml/4529/5 "2020-06-08T09:44:40Z")

</div>

Here is my XML, I copy this from the `filters.xml` from paraview source and made little modification.  
[MultiTimeResolution.xml](https://discourse.paraview.org/uploads/short-url/mntIMvA9updcuYF0cZ0NVV9Obqo.xml) (2.7 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: [June 8, 2020, 9:52am UTC](https://discourse.paraview.org/t/build-plugin-that-already-exists-with-different-sm-xml/4529/6 "2020-06-08T09:52:23Z")

</div>

The DoubleVectorProperty does not support enumeration domain sadly.  
I’m afraid you need to create a class inheriting vtkTemporalInterpolator with its own int interface, then you could be able to control it from an IntVectorProperty.

---

<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: [June 8, 2020, 9:55am UTC](https://discourse.paraview.org/t/build-plugin-that-already-exists-with-different-sm-xml/4529/7 "2020-06-08T09:55:00Z")

</div>

[https://gitlab.kitware.com/paraview/paraview/-/issues/19977](https://gitlab.kitware.com/paraview/paraview/-/issues/19977)

---

<div class="post-metadata">

### Author: ![Yoshino](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/bcef8e/32.png) [@Yoshino](https://discourse.paraview.org/u/Yoshino)
#### Post date: [June 9, 2020, 12:08am UTC](https://discourse.paraview.org/t/build-plugin-that-already-exists-with-different-sm-xml/4529/8 "2020-06-09T00:08:31Z")

</div>

But it will lose its meaning if set to int type, it has to be double(0.0~1.0) for interpolation. Do you think it possible for me to create a custom property widget(e.g. Exclusive QGroupBox), which has almost identical function, to show this property? Or the DoubleVectorProperty is just incompatible with any enum type widgets?

---

<div class="post-metadata">

### Author: ![Yoshino](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/bcef8e/32.png) [@Yoshino](https://discourse.paraview.org/u/Yoshino)
#### Post date: [June 9, 2020, 12:51am UTC](https://discourse.paraview.org/t/build-plugin-that-already-exists-with-different-sm-xml/4529/9 "2020-06-09T00:51:28Z")

</div>

I think I found the solution. The property `DiscreteTimeStepValue` could be used to both aggregate(when set \>1) and interpolate(when set between 0~1) dataset timesteps, while the latter function could be replaced by another proeprty `ResampleFactor`, which was not exposed in SM XML. A issue was raised: [https://gitlab.kitware.com/paraview/paraview/-/issues/19979](https://gitlab.kitware.com/paraview/paraview/-/issues/19979).

In my case, I add the property `ResampleFactor` in sm xml and it works. So I guess there is no need to set `DiscreteTimeStepValue` to double type, an integar value is all we need plus `ResampleFactor`. Is it ok for me if I manually change the type of `DiscreteTimeStepValue` to int from the source?

---

<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: [June 9, 2020, 1:18am UTC](https://discourse.paraview.org/t/build-plugin-that-already-exists-with-different-sm-xml/4529/10 "2020-06-09T01:18:14Z")

</div>

> [@Yoshino](#):
>
> Is it ok for me if I manually change the type of `DiscreteTimeStepValue` to int from the source?

Well, you can, but it means you are building a patched ParaView.

---

<div class="post-metadata">

### Author: ![Yoshino](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/bcef8e/32.png) [@Yoshino](https://discourse.paraview.org/u/Yoshino)
#### Post date: [June 9, 2020, 2:46am UTC](https://discourse.paraview.org/t/build-plugin-that-already-exists-with-different-sm-xml/4529/11 "2020-06-09T02:46:58Z")

</div>

The amazing thing is that I made it work not by rewriting the source but changing the xml property from `DoubleVectorProperty` to `IntVectorProiperty` and then the `EnumerationDomain` works. Here it is:  
 ![image](https://discourse.paraview.org/uploads/default/original/2X/a/a6da92da4523a37f8e40cd5428ea0e91ae33accd.png)  
You can see all the enum were listed and `ResampleFactor` was shown. I hope this is a side-effect other than a potential bug.

---

<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: [June 9, 2020, 2:47am UTC](https://discourse.paraview.org/t/build-plugin-that-already-exists-with-different-sm-xml/4529/12 "2020-06-09T02:47:53Z")

</div>

but the values are not correct, are they ?

---

<div class="post-metadata">

### Author: ![Yoshino](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/bcef8e/32.png) [@Yoshino](https://discourse.paraview.org/u/Yoshino)
#### Post date: [June 9, 2020, 2:53am UTC](https://discourse.paraview.org/t/build-plugin-that-already-exists-with-different-sm-xml/4529/13 "2020-06-09T02:53:44Z")

</div>

For the double values, which are not needed, they are not, and I’ll remove them. But for the integar values, yes they are, at least I didn’t see any weird result yet. How do you think? 😅

---

<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: [June 9, 2020, 2:54am UTC](https://discourse.paraview.org/t/build-plugin-that-already-exists-with-different-sm-xml/4529/14 "2020-06-09T02:54:25Z")

</div>

Of course, it should work with integer values.

---

<div class="post-metadata">

### Author: ![Yoshino](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/bcef8e/32.png) [@Yoshino](https://discourse.paraview.org/u/Yoshino)
#### Post date: [June 9, 2020, 4:07am UTC](https://discourse.paraview.org/t/build-plugin-that-already-exists-with-different-sm-xml/4529/15 "2020-06-09T04:07:51Z")

</div>

> [@mwestphal](#):
>
> I’m afraid you need to create a class inheriting vtkTemporalInterpolator with its own int interface,

Then I have to build this plugin, right?

---

<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: [June 9, 2020, 4:44am UTC](https://discourse.paraview.org/t/build-plugin-that-already-exists-with-different-sm-xml/4529/16 "2020-06-09T04:44:31Z")

</div>

Yes.

If building is not an option for you, a similar result could be obtained with a PythonAlgorithmPlugin.
