How to set the default value for a proxy property?

Dear all,

I’m having trouble adding a proxy property to an existing source proxy.

On Paraview 5.7, after loading an already existing state file containing a source proxy instance, selecting the instance shows an empty proxy property rather than a given proxy from the proxy_list.

I do not find commits related to this behavior in recent commits so I believe it should still be the same on 5.9. Perhaps I did something wrong or is it simply by design?

Thank you!
Have a good day,
Patrick Laurin

Can you elaborate? Preserving values for proxy properties when loaded from state files is critical to any functional loading of state files so I don’t think that’s the issue here. Something else is going on.

Hi Utkarsh!

I’ve just realized I could’ve been clearer on this. My issue is about adding a proxy property to a filter already used in our state files. If I update the XML definition of the filter, compile and load the state file, the property shows as empty. I do confirm that saving a state file with a value selected preserves the said value.

Although it is possible to make a v2 version of the filter, maybe there is some kind of mechanism I can use such as using vtkSMStateVersionController

Thank you,
Patrick Laurin

Assuming you’re doing this in a ParaView plugin and not a custom application, there;s no easy way. Maybe creating an auto-load plugin that monitors pqApplicationCore::aboutToLoadState and then modify the XML state to take into account your change is a way to go.

1 Like

Hi Utkarsh,

It is a custom application with our own modules attached to it. The filter in question would be found inside one of the modules. Let’s say I add the following proxy property to the filter (Example taken here):

<ProxyProperty name="Kernel" command="SetKernel">
  <ProxyListDomain name="proxy_list">
    <Proxy group="point_interpolation_kernels" name="VoronoiKernel" />
    <Proxy group="point_interpolation_kernels" name="EllipsoidalGaussianKernel" />
    <Proxy group="point_interpolation_kernels" name="GaussianKernel" />
    <Proxy group="point_interpolation_kernels" name="LinearKernel" />
    <Proxy group="point_interpolation_kernels" name="ProbabilisticVoronoiKernel" />
    <Proxy group="point_interpolation_kernels" name="ShepardKernel" />
    <Proxy group="point_interpolation_kernels" name="VoronoiKernel" />
  </ProxyListDomain>
</ProxyProperty>

There is no mechanism pushing GaussianKernel as the default value? If I instantiate the filter, I know the first element of the list (VoronoiKernel) is chosen.

If I load a state file with the filter previously saved without the proxy property, I’d have to add a mechanism in pqApplicationCore::aboutToLoadState to add the correct proxy to the XML state?

Wouldn’t it be better to edit vtkSMProxyListDomain for support of something similar in the style of default_values="GaussianKernel"?

Thank you,
Patrick Laurin

Yes, makes sense. Feel free to push an MR or report an issue.

1 Like