This patch implements a new option for mesh selection tools called select through. It’s availiable in box, paint and lasso selection tools.
While this setting is enabled the user can select occluded mesh elements without the need to switch to xray mode. It does not change any existing behaviours in blender as far as I know.
The main motivation to add such a feature is, that this is the default selection behaviour in many 3d applications. That means I looked at 3ds max, maya and houdini... there might be more. So it’s always quite a surprise that such a basic thing is absent from blender. Selecting this way the user is not distracted by the need to switch display modes to do mundane selections.
Discussion about this can be found here: https://devtalk.blender.org/t/decoupling-x-ray-and-limit-selection-to-visible/3498
Quick example: selecting the cap of a cylinder is very easy to do this way, as its clear where the vertices are there is no need to switch to a different view mode. While this is a bit of an artifical example - it happens quite often that the model at hand is actually pretty simple and the user can predict whats on the 'other' side just fine.
Here I made a … lengthy ..demonstration video of this new feature showing the various selection modes/tools (sorry boring box models):
- In edge mode, I set it up such that it always selects partial edges, the preference for full edges felt very strange/wrong to me. On a sidenote - while modeling I was always irritated by this, I just couldn’t put my finger on it, selections just felt ‘wrong’ sometimes. I was quite surprised by what the code was doing there…
- In polygon mode, polygons are used to determine the selection instead of the face centers.
The code follows the existing design and mostly uses the existing code to test the selections. The only real addition is a new view3d_iterator function to generate the screen coordinates of all the polygons. These are then used to determine face selection.
I’m not sure if my approach is sufficent, as it’s a pretty brute force problem, there might be better solutions. The other tests are implemented in a very simliar fashion, so I thought it would be okay to try it this way. None the less from all of the existing geometry tests this is the heaviest.
I did not look into alternative approaches here, as I don't know enough about parallel processing / gpu compute etc.
The setting itself is setup as a toolsetting and not as an operator property, mostly because it was easier for me to access it in the draw code (needed do decide if we draw the facedots in xray mode).
Im still not too savvy on this C thing, any feedback is welcome :) and thanks for your time.