Non persistent tool modes?

Action launched by tools (new “N” panel tools) are now “persistent” aka the tool remains active.
Any way to define a tool as “non persistent”, so complex actions dosen’t trigger the tool again and again - allowing pass_through modals ?

Current behaviour:

  • launch the tool
  • run a modal - if modal return pass_through the tool start again on mouse click.

Can you be more specific about what kind of tool you are writing?

When activating a tool in the new tool system, it basically activates some keymap items and gizmos. Those will trigger an operator, which if it needs to run modal would usually handle all the events itself and not pass them through, when e.g. dragging a gizmo. What is the reason you want to pass through the event?

The tool itself does show a preset menu (modal pass_through) and then allow users to create many objects using picked preset also modal pass_through. (archipack)
Alternative is a regular button, but at this time i’m not able to achieve same look and feel as tools (size - icon size).

Then I think you can selectively pass through some events and block others? Or add poll() functions to your operators so they are only active when the tool is in a particular state?

Any non blocking modal will trigger the tool on user click, so pass_through is not possible.

But a modal operator does not have to be completely non-blocking. It can use or block events it needs, and pass through other events.

Or the operator that executes the tool can get a poll() function or be aware of the tool state in some way so that it does not get executed when not needed.