Python API bmesh.deselect_history, aka enabling De-select Shortest Path
Blender has a nice Select Shortest Path tool. Blender maintains an internal element sequence (a list) of the vertices, edges, and faces that the user selects when the user clicks on them in Edit mode. By knowing the most recently selected elements Select Shortest Path can add to the selection all of the elements between the most recently selected elements.
This list is exposed to the Python API
for add-on devs to use as well in the form of the
bmesh select_history
which is super awesome and has been very helpful to me.
The Proposal
One thing that Select Shortest Path can't do, however, is de -select from an existing selection. So my proposal is to:
- Add a new de -selection history list that does essentially the exact same thing as the selection history, only it tracks the recently de -selected vertices, edges, and faces.
-
And then expose this list to the Python API as
bmesh deselect_historyso that add-on devs can make use of it.
8 Comments
your idea is just a special case. make it other operators
***@mod moder *** Deselection is a fundamental part of all modeling workflows, not a special case. Frankly it is baffling that Blender doesn't have such a basic action as deselecting elements between two points. This is a standard feature in 3D DCC programs.
And I don't know what you are trying to say with "make it other operators".
* @Chris Kohl * you actually already Can do this, simply by doing what you would do to select faces, but over your selection.
* @Alex M * Can you elaborate with the steps and/or tools to accomplish this?
* @Chris Kohl * imgur.com/3ctZ4ow
* @Alex M * That is not helpful. What tool is it?
* @Chris Kohl * it's the default selection tool. What i did is just made the face where i want to start to deselect active, then ctrl+shift+click on the opposite corner of the area i want to deselect
* @Alex M * Oh that's interesting. Thank you. That isn't documented in the manual or the python API reference for the way Pick Shortest Path functions. The documentation (and the available options in the keymap) implies that it only works for creating a selection, not for subtraction from an existing one.
With that being said, though, I'm not a fan of having to set an active face as selected before deselecting. It feels wonky to have to 'create' a selection in order to do a deselection. I'd much rather deselect at the starting component and the ending component straight away.
Plus the Select Shortest Path operator is deficient when it comes to selecting along loops; it can't handle curvature.
i.imgur.com/Rnm6564.jpg
That is why this is a python API request. I've already written my own operator to completely replace Pick Shortest Path for simple loop-based selections (it won't deviate from loops) but the existing API isn't sufficient for a deselection-only type of operator.
Anyway, thank you again for the tip. I'll have to consider amending this API proposal.