Developer Forum

X-Ray selection experiments build

[BUILD] Select Through 3.31

The aim is of this build is to preserve default blender behaviour while offering a high degree of customization and flexibility for mesh selection. It is mostly the same as select through 3.2 but presented differently, and with 2 new / fleshed out features. Each feature has its own header button that can be hidden. There are 3 main features (Custom Mesh Selection, Ignore Backface, and X-Ray alternatives) with some extra miscellaneous things that I do for myself.

Ignore Backface Selection
Verts, edges, and faces that are not facing the viewport will not be selected with box, lasso, and circle select. This is based on normals of each element. There’s some options for different ways of determining what verts/edges are facing the viewport.

‘Verts of Face’ will select verts that are part of a face that has normals that point toward the viewport. This is what I will be using because I just want selection to act more like I am expecting, instead of grabbing occluded geometry

But if you care about being more technically correct for some reason, you can use ‘Vert’ instead. It will look at the normal of each vert individually rather that the face(s) it is part of. This works faster, but will result in some of the border verts not being selected because their normals are just a little outside of what is wanted

‘Edges of Face’ is the same deal

‘Edge’ doing the same thing as ‘Vert’ where you don’t get some of the border edges

Besides these options, you can decide to keep the box, lasso, and circle select tools the same, or some combination of 2 of them, or have them all different from each other. Any of the tools can be disabled entirely, either by turning them off, or not having any of the vert/edge/face options enabled. Any combination of verts, edges, and faces can be enabled and disabled as well.

You can adjust how close the alignment between the viewport and the vert/edge/face needs to be. Having at 0 should be enough on paper, but it is not, it will catch stray occluded mesh elements. I had thought 0.1 was good, but it still catches the occasional stray, so I have the default backface threshold set to 0.15. Setting it to 1.00 will mean it needs to be perfectly aligned with the viewport. There is an interesting aspect of this regarding quad view. Quad view should show you the exact top, front, and right side of a mesh, but even with a cube it will not think it aligned until you set your backface threshold to 0.99 or lower. But if you just align your viewport using the numpad keys (num1 for front, etc) there is no such limitation, threshold at 1.00 and pressing num1 for front view will select these mesh elements as expected. This is all assuming a cube or similar flat surface aligned with front/top/right.

You can flip which direction it will filter out. I can’t think of a reason for this but it is there if needed. The button tells you what it is currently set to do, “Selecting Forwards” means it will not select occluded mesh elements that are facing backward. This is assuming you don’t have flipped normals and are not inside your mesh. I guess if you were inside your mesh looking outward this could be useful somehow.

A convenience feature, you can see and control which tools will use ignore backface selection from the dropdown, without needing to switch to the tool beforehand.

Another convenience feature. You can decide whether to use ignore backface selection in Near select, X-Ray select, or Both. If you also use ‘Select Through’ or ‘Auto X-Ray’ these are considered X-Ray.

Custom Mesh Selection
I’ve added the ability to do all of the selection styles for all of the tools in any shading mode.
Face options
Touch means that any face that is hit by the selection area (box, lasso, or circle) will get selected. It is what Blender does in near select, but not in X-Ray. There is one small exception to this, and that is intersect selection in X-Ray. It has some weird bug that I haven’t figured out or gotten help with, so as a fallback, you get enclosed selection if you do an intersect. What’s an enclosed select?

Enclose means that only the faces that are fully inside of the selection area will be selected.

Center means that you will select a face if the selection area hits the face’s center point, which can be seen if you turn on facedots. It’s what Blender does this in X-Ray, but not in near select.

Default means you get what Blender does already, touch in near and center in X-Ray. This will also happen if you leave touch, enclose, and center face selection disabled.

Edge options:
Touch and Enclose mean the same thing as what happens with faces, as seen above, just with edges

Default edge selection will happen if touch and enclose edge selection are disabled. With box and lasso it means that you will do an enclosed edge select, BUT if the selection area doesn’t fully enclose any edges, it will then attempt a touch edge select. With circle select there is no difference between default and touch. I had implemented a hybrid style of edge selection for circle but it really doesn’t make much sense so I scrapped it.

Tools lets you see and control which tools will use custom mesh selection from the dropdown, without needing to switch to the tool beforehand.

Tool synchronization exists for each feature and acts independently. Meaning, Ignore Backface synchronization has no effect on whether Select Through, or any of the others, are synchronized. For Select Through and Auto X-Ray all it does it keep the on/off status the same for whichever combination of the 3 tools you wish. For Custom Mesh and Ignore Backface it keeps the settings below them synchronized (Face, Edge, and/or Vert selection options). In every feature, the synchronizations are all on by default, meaning it acts like one button for all 3 selection tools, with the option of individual control should you want that.

Keymap control is an optional control method for Select Through and Custom Mesh Select. When enabled it will use the keymap entry instead of the header button. Keymap off = nothing from the keymap matters. Keymap on = nothing from the header button matters. The keymap offers more flexibility for how you assign it to a shortcut, but has no ability to toggle, or visual feedback if that is desired.

X-Ray Alternatives
There are 2 ways of using X-Ray differently.

Select Through will give you the selection of X-Ray without changing the visuals. Tool synchronization and keymap control are available.

Automatic X-Ray will turn X-Ray on for you, and back off again when finished. Tool synchronization is available.

Hiding the header buttons
You can hide any of the new header buttons, and the regular X-Ray button. I also added an alternate header that combines the xray and viewport shading buttons. 1 button can very easilly show you the same information as these 5 buttons do. If you do not want to switch between shading modes with pie menu, or a keyboard shortcut, you can still click on them like they were in your header, they are inside the popover at the top just in case you miss them and want to give them a click for old times sake.

Miscellaneous stuff:
Facedots can be turned off in X-Ray shading. Their visibility has no effect on selection, meaning you can still use face center select with them off. You probably want these on in X-Ray to have a reliable way of single clicking on faces, but you now have the option to turn them off when needed.

Header highlight will change how much the active header will brighten, or disable it at 0 which is what I do

I use a different edit crosshair for my mouse cursor. The regualr one blocks what I want to click on so I made it more open. I’ve tried different things over time, this is what I am using most recently and will probably keep it for a while.

You can adjust the single click select radius if you turn this feature on. Bigger or smaller than you’re used to, affects vert, edge, and face.

Added benefit of using this is that I’ve made face select consistent with edge and vert. With faces, you have to put the cursor all the way on top of them, this is not the case with verts and edges where you have a lot of play with how close you need to be. I like this amount of slack / leeway / play that you get, it is to be expected. But I always found it to be way too much, especially if you ever want to click in empty space to deselect. Default value of 75 will preserve the blender selection radius you are used to, but you can make it more or less now.

Adjustable zoom speed and frame select distance. Tooltip for zoom says ‘dolly’ which is probably wrong, I’ll fix that next build if I remember.

These shortcuts you’ll have to add manually if interested.

Some python shortcuts derived from this:
It is pretty neat, you can tweak based on which gizmo is showing. Also has a more convenient way of switching between move, scale, and rotate.

Another python shortcut to toggle between box and lasso, instead of going through circle and tweak as well.

Repeat tool is like repeat last except it just invokes the last operation rather than executing it

Topic split off from Decoupling x-ray and limit selection to visible.

A lot has been made out of this when we’d all be just fine with a closed source Blender. But it aint like that so here’s a new custom build.

This one is a little different because it also has the other stuff I add. I figured why not, it’s all optional. It saves me a little time as well, don’t have to go through and clean out every non-select through feature from my personal build, or apply the same select through fixes twice.


Looks interesting.

Not sure about Show/Hide functionality and prefix, usually it is Show/Show Hide/Hide functionality with no prefix, when highlighing means “show”.

Do you have linux builds?

It is general problem of an industry standards implementation - it wasn’t run by people fluent in industry standard software solutions with experience of moving from ISS to Blender, only by people who are a bit familiar with them.
As a result blender has got an imitation of ISS even without solving famous ISS issues, like avoiding cycling between selection modes you mentioned there, and at the cost of heavy unnecessary damage.
(the same thing happens when linux tries to imitate windows interface without understanding the ideas behind it)

For example, the display of facedots in solid mode was broken and remained useless for a year.
As a result of such kind of damage of different functionality our company was completely bulldozered from blender.

I appreciate you looking into issues before offering solutions.

That’s funny, the two buttons do the same thing and are right next to each other, but I didn’t think about how they work opposite from each other. I was looking at it from what is in normal blender, and trying to be more specific about what is different in this build so it was more clear what would happen. But that makes no sense, setting on should = button visible and just say what button it affects.

Just a windows build but the DIFF should work the same if you want to make one. The link has the diff itself with the icon, alt cursor, and a readme. Doing a make icons might be different in linux if there’s no inkscape for linux, but if that’s the case it should be really similar. That or just change the diff a little to use a different icon. There’s like 1 or 2 things keeping me in windows for now, but that may easilly change.

We were close to an acceptable solution but unfortunately it once again turned into a button adding competition :frowning:

There’s two different things being done here by me. This custom build is not intended for real blender. This more complex build is for me, and anyone who wants to use it. The other one, that is simpler, is what we are waiting for some further response on. I just explained how and why I did what I did when I sent that diff off for review. Go read my posts from 10 or 11 days ago if you really didn’t know or just forgot.

Feel free to ask around for more input from the devs if you want, but I think we’re meant to wait for people to have less important things to do and get back to us. I wouldn’t exactly hold my breath though, it is something that was already rejected for what I would call philosophical reasons. Which is understandable, and not a big deal. Otherwise I guess you could discuss, or implement, what could be done to align the concepts of select through with how real blender does things.

Or just use this select through (and other stuff) build, and see what weird or wrong stuff you can find with it.

Tested win version (on my work).
I would like to provide some feedback in case if it is interesting.

  1. Facedots displayed in wire/xray when they are off, but solid mode facedots are on.

So it is not “xray facedots” checkbox, what can be recognized as “display xray facedots”.
It better be named as “select faces by area” checkbox with inverted functionality, since it control only selection type, with no visual impact.

  1. “select faces by area” checkbox should be represented in select through custom setup as well, so you can control selection style by switching SThrough button, the same way it works with with “safety edges” which enforces “All edges” checkbox.

  1. In tweak mode AutoXray and Sthrough buttons are unaccessible, but functionality works if they was turned on in other mode.
  2. Autoxray jammes if selection border has no area.

Hope it was interesting. What do you think about that?


Always interested in feedback and bugs, thanks

  1. X-Ray facedots is named that way to make it shorter but it’s shortness is outweighed by being confusing. Not sure what to do about it but I had a couple different ideas.

At the moment I put it under the “Drag Select” heading to imply that it means “drag select by xray facedots” and gave it a tooltip. But it has the issue where it is easilly mistaken for toggling facedot visibility.

One solution is like you say, just call it “select face area” or similar. Now that there is also an “enclosed faces” option there’s a problem with this being two checkboxes and one has to have priority over the other. Already have this problem with “xray facedots” having priority over “enclosed face”, but at least it is sortof isolated in a specific context of needing to be in xray with facedots visible. A “face area” and “enclosed face” checkbox both existing and being on is a little worse since they both work in either mode regardless of facedot visibility.

To fix that I thought I’d make an operator for each one that will just toggle the other one off when needed, but I can’t put an operator in tool settings. It formats it all weird by putting the operator in that left side area where the headings are, and in the toolsettings panel (not the viewport one) it isn’t even clickable.

So I am thinking I will have a look at some of the other properties like the viewport shading buttons (wire solid material render) and emulating how that works. I could also expand this into some further properties. Have a “solid face” and “xray face” text label that looks like the “tool synchronization” label but with a gear next to it. If you click on the gear it expands and you can choose between area/enclosed in solid, and area/enclosed/facedot in xray.

  1. The feedback I got from having the ability to select through by facedot was negative, but I don’t see any reason not to have the option. It makes it more clear what will happen as well.

  2. Besides hiding header buttons I didn’t see any other functionality that would occur outside of box/lasso/circle select. So I put the button visibility stuff inside the viewport->view menu beneath “alternate header”. Is there anything you’ve noticed as far as autoxray, select through, enclosed faces, xray facedot select, or all edges select with tweak?

  3. Fixed this. Finally did it right by having autoxray happen only in gesture_ops instead of also inside view3d_select. This led me to actually checking that additional exit case where the seleciton box isn’t valid. Also cleaned it up by sending a handful of copy-pasted stuff that was spread out among box/lasso/circle into one thing

  1. I am not sure that enclosed faces require attention at this step, since implementing directional selection differentiation mechanics can fix this problem in a better way.
    At the moment it looks like an attempt to add manual selection differentiation mechanics, but in not centralized (dissolved across build) way.

  2. In my opinion adding such an option to select through controls will help to customize select through behaviour in a more flexible way. Select through is usually used with area selection (because occlude geometry covers facedots), while non-select through with manual/auto xray switching mechanics provide facedots acessibility and can be used with facedots selection. I think it is logical to have the ability to force area selection for select through mode.

  3. I think that AX and ST buttons should be active and work in tweak mode the same way they are active in other modes, because you have access to box circle and lasso selections in that mode via hotkeys.
    (Btw, the point of using hotkeys is immediate access, which allow you to quickly alternate them carving complex selections without selection modes switching or cycling - in BCBBC way, where LMB is for selecting and MMB is for deselecting. Such a mechanics also allow to not interrupt your attention from a model)
    This way, I dont see any differentiations between tweak mode and other (box circle lasso) modes that are needed to be hardcoded.

  4. Okay) By the way, I forgot to test that python copypasted stuff, maybe next time.

Thank you for attention.

  1. I am interested in directional control but for now I prefer a property toggle. Even if the (anti)clockwise thing gets figured out by somebody, I’d want a toggle as an option to avoid needing to draw my selection areas a certain way. Enclosed face is the only thing that is fully functional besides. Facedots not available in near select, and face area breaks in through/xray when doing intersect selection mode, with enclosed face being done as a fallback.

  2. It works this way already, where select facedots only cares about 3 things: Are you in xray? Are facedots visible in xray? Is xray facedots toolsetting enabled? AX as implemented will satisfy the being in xray, just for clarity’s sake. But yeah, I will just add the ability to do facedot select in ST mode. It might be useful for some reason but I don’t forsee what right now. It would be the same as safety edge where you could “turn the safety off” so to speak and do something that isn’t exactly expected, but potentially wanted for some reason.

  3. I did it this way to show what isn’t available in circle and also tidy things up in the toolsettings when these options aren’t applicable. Didn’t think about the direct keymap stuff, so I’ll probably just add tweak to the list of things it shows up for. I will say that calling BLC directly isn’t fully realized (header buttons won’t reliably reflect the ST or AX status if they are checking a non-select or non-select-fallback tool that is calling them) but supported because it will work fine despite potentially inaccurate header feedback.

  4. I was just talking about how autoxray is implemented. Gesture_ops calls xray to turn it on/off as needed but it isn’t just a single line you have to set up pointers and other stuff like this:

wmOperatorType *ot = WM_operatortype_find("VIEW3D_OT_toggle_xray", true);
PointerRNA ptr;
WM_operator_properties_create_ptr(&ptr, ot);
WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, &ptr, NULL);

So having that copy-pasted 6 times wasn’t the right way to do it, but going back and checking stuff got me to do it better.

As far as python, the gizmo tweak stuff seems alright. Box-lasso toggle I made works ok for what I want it for which is just edit mode. Works fine for uv edit as well, just don’t assign to something like image editor where it will warn you that it doesn’t know what a box or lasso select is. Might work on a filter to eliminate that.

  1. I will just add the ability to do facedot select in ST mode

Hm, wait, thats weird…
From my experience during testing build, ST does not force face area selection, and respects “X ray facedots” checkbox, so there is already the ability to do facedot selection in ST mode if this checkbox is on. Isnt it?
Or am I missing someting?

  1. I will try to explain the issue without making it even more confusing.
    In short, there is no way to
  • make ST mode always use area selection in both Xray and Solid modes, according to classic ST behaviour
  • and make noST mode use facedots selection in Xray, and area selection in Solid, according to Blender defaults behaviour

so switching ST button you always have to switch Xray facedot checkbox as well to achieve such a differentiation, in case if user want to keep Blender default behaviour extended by classic ST mechanics.

If there will be ability to force face area selection for ST (simultaneously, both in Xray and Solid modes), such a differentiation can be achieved, and it will be possible to switch between (and indicate) those modes via single button.
Hope it sounds more clear.

I get what you are saying, and it works that way already, it’s just a little unclear what select through means. ST only happens if you are not in xray to begin with, and that’s the way it has always been. I get the confusion, based on how the 3.1 build had xray “modes” to designate which of the 3 things (default xray, auto xray, or select through header button/keymap) would make use of the space where the default xray header button is. Now in 3.2 the header situation is similar, but different. You can get the same ability to hide buttons you don’t need, but it isn’t all or nothing. It is however you want it where you could have 1, 2, or all 3 of the xray, AX, and ST buttons up there.

If you want ST to use face area all you need to do is not turn on “enclosed face”.
If you want nonST to use facedots you just have keep xray facedots visible, go into xray shading, and leave “xray facedots” enabled.
This is also the default behaviour.

I am going to alter this slightly though in an update that I will put up in about a week. Going give things a little more time to be discovered and posted here if there’s anything else people find.

It will be more of a clear and absolute choice which mesh elements will be used, instead of having to understand that enclosed faces only happen in xray if “xray facedots” is off. Also I just thought about it, I am going to get rid of the “safe edge/face” idea and just give ST its own mesh element section

Aw, so it is supposed that ST influence only Solid mode? That explains a lot.
So it looks like I am missing Xray mode support for ST then, to obtain complete classic ST mechanics…
(In software where ST mechanics is presented, it influence both solid and wire/xray modes, allowing selecting faces in both modes by area)

No, it is just something that is still being confused. Fixing that right now. Kio’s build made it where you had to have ST on to get face area select in x-ray. I have removed this requirement since very early on, if not right away. Same goes for x-ray facedot visibility, if ST was on, xray facedots would disappear. I made both of those things “decoupled” from ST.

You can select by face area in x-ray however you wish. AX, ST, both, or neither. That is why that tool setting “x-ray facedots” exists. Turn it off, you get face area select unless “enclosed faces” is on. That is the only thing that influences face selection other than ST forcing non-facedots when in solid shading, or xray facedots not being visible, or simply not being in xray.

Right now it is not obvious without reading the tooltips, but here is how it works:
If Select X-ray facedots ON, X-ray Facedots VISIBLE, Xray Shading ON - only way to get facedot selection

Then, reagardless of near/through select it checks if “enclosed face” is on, and will do either face area or fully enclosed faces. The one exception to this is face area is broken in through/xray if doing intersect selection and the workaround for making it at least do something requires a swap in/out of edges mode, which means the end result will only be fully enclosed faces.

Going to make this much more clear though, almost done and will show a screenshot later or tomorrow.


Thanks for making a build for 3.2, now I can use it for my daily work.

Also I found a bug - using auto x-ray on a curve objects turns on x-ray shading permanently instead of just while making a selection.

Should have this fixed now, checking it out led to finding this bug
It isn’t something that would be noticed unless you are in a debug build, but pretty neat.

Preview build for 3.21. Its a Lite build of RC, will upload the real thing once release probably. I’d appreciate one more check over things if anybody wants to do it.
[PREVIEW BUILD] 321RC Lite Sthru

Autoxray issues should be cleared up, and changed the way mesh element options are presented. Not as straightforward as 3 checkboxes, but it shouldn’t require as much guessing to figure out what to expect.

Planning on putting these options in a popover next to the vert/edge/face button. I had it all finished and setup inside of toolsettings but theres an issue with that for reasons I don’t understand. The viewport TS works fine, but the side panel one doesn’t work. You can make it show up in there fine, but it has no affect on selection. It has to be defined somewhat differently in python to show up, which may have something to do with it. Either way it isn’t there, but I left it in the viewport TS panel just to show what it could work like. Not much difference whether it is in TS or the popover next to the VEF buttons, so feel free to convince me to keep it in the viewport TS. Being in viewport means there’s no rightclick->reset to default, because for whatever reason that isn’t possible.

So, how does it work? It can be as simple as this:

Or as complex as this:

Near Face will change how near faces are selected by box and lasso. Meaning not in X-Ray, and not Select Through, that’s it. This also means circle will never use this because it only has options for “center” or “touch”

“Touch” means the same thing as what has been reffered to as “area” but I changed the wording so it is the same for face and edge (edges are 1-dimensional and don’t have area). It’s also about as simple as it could be described, touch face or edge with the selection area, and it will select the face or edge. Face “area” is less intuitive.

Enclose means you only select faces that are fully inside the selection area.

X-Ray face is the same as near, but for X-Ray shading. It has a “Center” option, which means select any faces whose center is inside the selection area. It does not care if facedots are visible or not. This goes the same for Select Through. I decided to leave it in your hands what the selection will do. If you want to select by invisible facedots, go for it. If you want to have facedot visibility act as your selection toggle, you can set up a python maco to keep them synced up. Shouldn’t be an issue for you guys though, I don’t think anybody who wants to turn facedots off will want to be selecting by them in any context.

Edge works for edges at all times, with and without X-Ray. “Enclose” is the default way blender does it, meaning adaptive, where it will give you only enclosed edges, or if you don’t fully enclose any edges it will give you any edges you touch with the selection area. “Touch” will give you any edges you touch with the selection area.

By default, “Select Through Filter” will be on. This means you can set a separate filter for select through while maintaining X-Ray Face/Edge. If you turn this off, it will just use X-Ray Face and Edge.

“Circle” and “Circle Select Through FIlter” are both off by default, but are there if you want them. It is like the select through filter but for circle. You can have one or both of them, they are separate things. Circle select options are very limited, face only, and you can select by either Touch or Center in X-Ray and/or Select Through. Otherwise it will use either X-Ray (Enclose will fallback to Touch) or Select Through (Enclose will fallback to Touch) depending on what is applicable.

If you are in X-Ray shading, and have Select Through on, both the filter and have it on (header button is lit up) you will get the Select Through filter behaviour despite select through not actually happening (xray is on there’s nothing in the way to select through anymore).

That is a lot of explanation for something that is meant to be simple to understand, but I wanted to make it as simple or complex as is reasonable. All of that while also maintaining default behaviour of both vanilla blender and select through as it was originally designed. Otherwise you’d be forced to use something more complex than you want, maybe you don’t care if select through or circle has it’s own filter. Or you’d have to deal with whatever decision I make for you regarding what I think you might want, maybe you want circle to use face center and box/lasso to use enclosed faces.


It’s amazing to see everyone in this thread trying hard to solve that issue, everyone that spends his/her free time on improving Blender should be applauded!

But to me, this looks like a nightmare, sorry.
This looks like the most complex solution to a pretty simple problem and would require way too much effort for users to figure out.


Lord have mercy… maybe this is the best way, but it certainly frightens me a bit ! I’d rather have a single way of dealing with this stuff, hardcoded but thought-through all the way, as uncomplicated as it is right now in vanilla, only better


@ManuelGrad @Hadriscus What do you have in mind/ how would you change it? If it’s so simple, then you should be able to make a suggestion ey. :smiley:

But, I think it’s not that difficult. If you want more options, you would have to enable them manually anyways and you’d know what you are looking for. Otherwise, they’d be the same as the short options menu. Most people would leave these at their defaults anyways.


Are these stored in preferences ? I wonder if that’s not source of problems for pipeline (sharing of blend files in the same department) if these are defined in the scene. They should be user-level preferences, not tool settings, right ?

1 Like