Change the order of properties in python plugin

Dear all,

I’ve finally managed to create my own python plugin. @utkarsh.ayachit Thanks for the great example here:

But one point is still open for me: how can I change the order of the properties in the GUI? The order of the functions decorated by @smproperty in the python code does not have any influence.

Alas that’s not currently possible. It’ll need some coding to fix that. The issue is that Python doesn’t order member functions any particular way. In fact, it changes in different runs. To avoid the properties moving around between invocations, I sorted them, IIRC.

Indeed, they are sorted by the command name. See https://gitlab.kitware.com/paraview/paraview/-/issues/21493.

@mwestphal we should consider adding a hint or attribute to determine ordering of property widgets in the property panel. This could then be exposed as a decorator in Python-based plugins.

1 Like

Definitely !