Decoupling x-ray and limit selection to visible

yessss custom build is done and the select through feature is working! So happy!

I was having problems compiling due to devs having deleted/renamed the edit_mesh_mode.c file in the most recent master commit, which I needed to modify with your patch’s contents. Thankfully doing this with an older commit, around the date you posted this, did the trick.

As for the patch itself, I would probably also include the new checkbox in the Move, Rotate & Scale tools, and not just in the Tweak tool, so that the user doesn’t have to go there to toggle the behaviour when he is using any of the other 3 tools or others (or decide another, individual place in which it affects all tools, like in a Preferences category, Viewport Overlays or Rawalanche’s suggestion).

Anyway, I am so happy this is now working. Thank you so much Benjamin, you’re the best!

Now if only we had keyboard shortcuts to grow selections along loop/rings…

3 Likes

Well that is a general usability problem with the toolsystem vs directly calling the operators. In this case calling boxselect modal while using the move as the active tool. From my perspective it doesnt make much sense to add selection related options to the transform tools - as they only do single element selections themselves as far as I know…

Anyway you can also setup a shortcut to toggle this property:
bpy.context.scene.tool_settings.mesh_select_through

1 Like

I’ve also created an account to add another voice to this issue. I’ve been using 3D modelling packages professionally for 10 years and I thought 2.8 was finally the time to switch to Blender. I knew there would be some differences I’d have to adjust to but this is one of those situations where I could not believe that there was no way to have unlimited selection. I was even more surprised to find that it used to be an option. Please restore this functionality.

1 Like

Hi there ! 10 years of using max, and now about 3 months into blender, this is one of the most annoying issues so far. Please fix that, it can’t be that hard

2 Likes

I would be so happy if this would be fixed.

1 Like

Any news on this? The amount of users complaining about this is exceptional, and the patch is sitting ignored for two months now: https://developer.blender.org/D6322

5 Likes

Well they just closed the patch. Fantastic. I found this topic earlier today and was going to make an account to comment in support of the need to split backface selection from x-ray mode but now this happened… this is so frustrating. The excuse given being that it could lead to “accidents.” Well tens of thousands of industry professionals in games and in Hollywood VFX use this type of face selection on a daily basis and you don’t hear them complaining that it’s problematic. Trust the user. They know their own geometry. They’re the ones who created it.

Standard selection behavior in other DCC apps is being shunned for an insane workaround. Setting x-ray opacity to 1.0 is not a real solution. It’s not even an acceptable crutch. This is a serious workflow impediment.

Limit Selection to Visible should either be a tool setting or a user preference.

(Also as a side note, Rawalanche, Maya has face dot selection. It hasn’t been the default face selection mode for a few years now but it’s still there in the settings to be enabled at any time. I’d actually like the ability to do face dots in Blender in any face selection mode, not just x-ray, but that’s just me.)

2 Likes

Well, it is a well-known workflow issue casuded by bad 2.8 desing process
(best comment on entire devtalk)

Contain a face center and this issue will go away.
Do you mean there is no way to turn off face centers in Wireframe/Xray? Then that could be an issue.

Alright, so, here’s the new design task:
https://developer.blender.org/T73479

Here’s the William’s comment under the new design task:

The main issue, is that this option conflicts with Blender’s current paradigm, which is ‘you select what you can see’.
With the linked patch, this conflict is there. If you disable Select Through, and then enable X-Ray, it does select through. Same with Wireframe view and other examples.
I don’t see a great solution to this without removing Blender’s core selection paradigm, or offering some sort of preference, or making the option feel broken, since if often won’t work as expected.

And here’s me, trying to explain William (for about the 3rd time) that the issue he is making it to be is not really an issue:

William is currently the biggest obstacle preventing this from ever happening. If someone else has the nerve to try to explain this to him, please try. I’ve tried several times and always failed. I am making this public because he did not even bother to respond to the conversation he himself started.

I’ve spent several hours trying to explain to him that the design would work in a such way that it would be impossible to get to a state where select through would conflict in Xray, and few days after he’s back at it saying the main issue is “select through conflicting with Xray”.

3 Likes

I would not say so at all. Vast majority of 2.8+ improvements have been great. But there are some core areas where blender is still painfully lacking, this being one of them. And this is so important because it costs many artists a lot of time on daily basis.

3 Likes

In this question I am also an obstacle)
Just don’t like bringing to Blender some obsolete concepts and things.
By the way, Limit selection to visible is equal to xray=1.0
So, it will be enough just to split xray settings for object mode and edit mode to get proper LSTV in 2.8x =)

Also facedots? They are needed for deep and precise wireframe selection (like loop selection) and polygonal structure recognition.

Blender’s selection logic is based on OpenGL visibility, so it’s not a trivial thing to change, technically.

I’d like to hear more about this technical aspect of the discussion. For example, why this OpenGL visibility limitation doesn’t affect x-ray mode (edit: nor does it affect object mode).

I had a gut feeling that the option wouldn’t be brought back because of a couple of dudes who can’t be wrong. Maybe if it becomes a meme it can be brought to reason why people are claiming for the feature to return in the first place.

1 Like

Made an account just to chime in and add a +1 to this. I’m a user attempting the move from Maya to Blender, and this is the most annoying thing. Also, face dots? The heckie is that, lemme select my faces normally pls.

3 Likes

Raycast selection is so important. XSI and MODO gets this right. In Blender its so clunky to have to toggle wireframe or Xray mode to select backfacing polygons/components.
See what the Modo 2 Blender keymap does in this regard. It uses a script to temporarily toggle Xray mode while you’re selecting with your mmb.
Williams assertion that other apps only have one method is not correct. In Modo you can either select what you see, or select backfacing polys. MMB selects backfacing and RMB selects what you can see.
XSI had this as well. And I’m pretty sure they are not the only ones. In fact the only other app which doesn’t have a raycast (backfacing polys) selection is LightWave and that program is on death row.

I am doing some blender again and still can’t believe this design decision. Maybe you can change this into a donation challenge. I would be willing to contribute. :slight_smile:

I would even be happy if the checkbox would burried deep down in the preferences so I can enable it once.

3 Likes

@kio Hey Ben, now that 2.82’s stable release is out, do you think you could redo the patch you did for this new version? I still use that custom build of Blender. Since then some files were moved around by the devs so applying your changes isn’t quite as easy as before. New plugin versions like BoxCutter are slowly leaving that old version behind.

Even if the Blender devs don’t implement this, it would be fantastic if you could re-apply your changes to this new stable build so that others can use it.

Same here! :slight_smile: It’s been essential for me as well.

I have a workaround that might help ease the pain of those who need this feature. (But I think this functionality should be part of blender, properly implemented.)
I wrote myself a small script some time ago, I guess it’s not much different than what’s included in the suggested add-ons.
It’s a macro that in the moment of box selection it triggers x-ray and hides the back wires. When the selection is finished x-ray is turned off. It doesn’t interfere with regular x-ray usage.

oskar_select_through_small
Limitations:

  • in the moment of box selection the face dots are used instead
  • occasionally when you click, drag and release very fast (usually when deselecting) it might not turn off the x-ray. It gets fixed on the next selection.

The same idea can be used for lasso selection.

I made a 2 min video showing how to install it and add it to your keymap.

Here is the script, just copy this to a new text file and save it as a python script.
(oskar_select_through.py for example)

# ##### BEGIN GPL LICENSE BLOCK #####
#
#  This program is free software; you can redistribute it and/or
#  modify it under the terms of the GNU General Public License
#  as published by the Free Software Foundation; either version 2
#  of the License, or (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software Foundation,
#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####


import bpy
from bpy.types import Operator, Macro

bl_info = {
    'name': 'Select Through',
    'description': 'Box select components in shaded mode that are not visible. Optional/default behavior in most 3D software.',
    'author': 'Oskar',
    'license': 'GPL',
    'version': (0, 1),
    'blender': (2, 80, 0),
    'category': 'Interface'
    }

class OSR_OT_xray_on(bpy.types.Operator):
    """Turn xray on"""
    bl_idname = "osr.xray_on"
    bl_label = "OSR: XRay On"
    
    
    # ==== CHANGE SETTINGS HERE ====
    
    # This controls the alpha of the shaded geometry, while box selecting.
    xray_alpha = 1
    
    # This controls the opacity of the wires that are behind (not visible in shaded mode). 
    # If you want to see a bit of the wires and components behind while selecting set it above 0 to max 1.
    backwire_opacity = 0
    # ==============================
    
    
    def execute(self, context):
        scene = bpy.context.scene
        # There seems to be a problem. Sometimes the macro is not executed properly when we click very fast. 
        # Instead of all classes in the macro, just the first one is executed.
        prop = scene.get("osr_select_through_macro_fail", None)
        
        # If xray_off did not fail
        if prop is None or prop == False:
            scene["osr_xray_last_state"] = context.space_data.shading.show_xray
            scene["osr_xray_last_alpha"] = context.space_data.shading.xray_alpha

        if scene["osr_xray_last_state"] == False:
            context.space_data.shading.show_xray = True
            context.space_data.shading.xray_alpha = self.xray_alpha
            context.space_data.overlay.backwire_opacity = self.backwire_opacity
        
        # We consider the macro failed unless xray_off is executed
        scene["osr_select_through_macro_fail"] = True
        
        return {'FINISHED'}
        
class OSR_OT_xray_off(bpy.types.Operator):
    """Turn x-ray off"""
    bl_idname = "osr.xray_off"
    bl_label = "OSR: XRay Off"
    
    def execute(self, context):
        
        scene = bpy.context.scene
        prop = scene.get("osr_select_through_macro_fail", None)
        
        if prop is not None:
            context.space_data.shading.show_xray = scene["osr_xray_last_state"]
            context.space_data.shading.xray_alpha = scene["osr_xray_last_alpha"]
        
        # Set the default backwire_opacity
        context.space_data.overlay.backwire_opacity = .5
        
        scene["osr_select_through_macro_fail"] = False
        return {'FINISHED'}


class OSR_OT_select_through_macro(Macro):    
    bl_idname = 'osr.select_through'
    bl_label = 'OSR: Select Through'
    bl_options = {'REGISTER', 'UNDO'}


classes = (
    OSR_OT_xray_on,
    OSR_OT_xray_off,
    OSR_OT_select_through_macro,
    )


def register():
    for c in classes:
        bpy.utils.register_class(c)
    
    OSR_OT_select_through_macro.define("OSR_OT_xray_on")
    OSR_OT_select_through_macro.define("VIEW3D_OT_select_box")
    OSR_OT_select_through_macro.define('OSR_OT_xray_off')
    

def unregister():
    for c in reversed(classes):
        bpy.utils.unregister_class(c)


if __name__ == "__main__":
    register()

    

Command for the keymap:

osr.select_through
8 Likes