I am working on an operator which will do some heavy calculations for animation. I want it the user to be able to interrupt it by pressing escape or the x button, just like when rendering. I thought that I should use a modal operator for this, as normal operators freeze blender.
how do I add the X (cancel) button?
I have some properties that need to be set before it starts calculating, but the call to wm.invoke_props_dialog(self) does not go well together with the modal operator. How do I make my modal operator work together with the properties dialog?
You’re right, the modal operator will wait till next user input. (except if I use the timer, like in one of the examples, but I actually want it to go as fast as possible).
To explain my Idea about the modal operator: the operator loops through all the frames of the scene to animate objects. I want the UI to remain responsive (and show the progress), while the operator is doing that.
I finally ended up having two operators: a GUI operator, which calls the modal operator. Seems to work OK, except that it is a bit hacky. (From the spacebar search you can find both operators)