Inconsistency in UX and ambiguous func parameter: remove_on_cancel (all related)

I was playing with UX ideas for Blender and noticed that some operations have special know-how behavior for you to know in advance, otherwise the user might get a rough and “buggy” experience.

Specifically the “Extrude and Move” and “Duplicate” (in edit and object mode), which can be thought as “generative” (creating new mesh). On cancel (whether you press right-click or esc) the mentioned operators leave behind a duplicate in the same exact spot, which is not obvious for the user at all.
Other interactive ops like “Inset” and “Bevel”, for example, don’t leave any duplicates behind when you cancel them, however they are also “generative” operators.

I think that canceling an operator shouldn’t leave anything behind and in order to make the UX more consistent i stumbled upon the "remove_on_cancel " parameter. The docs of the parameter simply say: Remove elements on cancel (blender docs). Toggling this in the Preferences → Keymap didn’t result in what i thought it would do, the operators still would leave newly generated mesh on cancel.

I would like to ask for help on how to go about this.

1 Like

This comes down to some legacy design choices about keymaps, operators, and chaining operators together.

When you add a node, it is actually two operators: first one to add new node, and second one to translate the node (so you can position it wherever you want it). From the perspective of how operators work, it is only the translate which will receive the “cancel” request. This is why the add node part sets this remove_on_cancel flag.

The proper way to solve this is to decouple keymap from the low level operators. This will make it possible to hide all those internals, and, hopefully, will also help defining keymap in the terms of “I want to pan using ” rather than defining shortcut to a specific operator for every possible area.

That is quite big and challenging project though.


Is there a way to hack in some quick solution without writing let’s say an addon (as an example)?
What I mean is - can anything be in the Keymap editor with some python commands? Im just asking if it’s possible to do in that way, and if yes i’ll try to figure it out myself.

It is not possible to change architectural limitations from Python API.

May that be the case, however, I’ve also noticed something interesting. In my recent bug report the Rip operator cancels the rip if you readjust the position afterwards in the operator menu… although it’s a buggy behavior but it’s also the desired outcome after pressing Esc, for example.

If the Rip operator has the same chaining operator logic, then triggering the “buggy” behavior, oddly enough, is what we want, the only difference is that now we may trigger this "buggy’ behavior intentionally when pressing Esc. Can this be an ad-hoc solution to what I describe in the original post?

I use ‘E’ and then immediately Esc in order to leave the extrusion at the initial location, so that I can then move it on a single axis, or by a specific distance. It sounds like this will break my ability to do this, but I’m pretty much a beginner in modelling in Blender so I am wondering if I am missing an obvious methods to do this (typical example is I want the extrusion to move exactly 1 meter and only on the X axis).