How to run an operator's "execute" only when the mouse released?


I have a regular operator with its own pop up arguments. Everything works fine except that I do not want the execution happens until the user is done dragging some values in the argument value box (using the left right slider controls).

The reason I am looking for this way because I do not want user to expect that the results of value dragging should be shown in realtime as the user drags left and right expecially when the model that is operated on is very heavy.


to execute custom code on mouseup, you’d need to make it a modal operator and wait for the leftmouse (release) event, then run your operator logic.

that said, the reality is that the operator panel changes DO happen in realtime whether you want them to or not. When you change a value, the operator gets run again and there’s no way to prevent it (as an example- use the subdivide mesh operator and scroll the subdivisions intproperty, the subdivisions will change while you’re dragging).

1 Like

Thanks for the reply. I was wondering if I could use some kind of timer event, or maybe use + / - buttons for changing values but I could not locate such interface items. That could slow down value entry.

I will take a look at Modal way , however wondering if modal operators can sense if the mouse is inside the arg panel or not, probably not. I am guessing that I will need to use some keyboard clicks for changing values.