Proxy modified state is different in Python

Hello! When I open some model and create a filter on it (Clip, for example), the modified state on Clip proxy in pqFiltersMenuReaction is UNINITIALIZED. However, when I do the same in Python,

reader = OpenDataFile(‘myfile.pvd’)
filter = Clip(reader)

The modified state is UNMODIFIED. Is that an expected behaviour? Why is the state different in Python?

Is the UNINITIALIZED before you hit Apply in the UI? I suspect the API (C++ too) might be doing auto-Apply.

Yes, UNINITIALIZED is before hitting the Apply button. The auto-apply button is off, the request data method of the filter is not being called neither in paraview, nor in the python shell. I noticed that UNMODIFIED status is the default value in pqProxy constructor and the UNINITIALIZED status in Paraview is being set by pqObjectBuilder::create_filter, however it doesn’t seem to get called via Python shell

@cory.quammen ?

FYI @nicolas.vuaille

Indeed, from what I see the modifiedState is changed only when clicking on buttons (apply, reset, changing property value). But nothing connects Python to it. So I feel like it was designed only for GUI interactions.

Another way to see that:

  • Source / Sphere
  • Apply
  • Turn on “advanced properties”
  • Python Shell
    • s=GetActiveSource()
    • s.StartTheta = 90

Start Theta is up to date in the Properties panel but the Apply button is disabled and the View was not updated. So nothing says that a change is “pending”.

I think it is an issue. @jeDuck would you mind create a ticket here https://gitlab.kitware.com/paraview/paraview/-/issues?sort=created_date&state=opened&first_page_size=50 ?

Here is the ticket:

https://gitlab.kitware.com/paraview/paraview/-/issues/23133

1 Like