Select-through for Box Select using keymap editor

I’ve been experimenting with keymaps and found a way to combine select-through and box select into one button in vanilla blender. Good option for those who are stuck at work without ability to install custom builds:

Setup:

  1. Go into into 3D View → 3D View (Global) category of keymap and scroll down until you find B - Box Select and disable it (not actually necessary if you plan to use other hotkey, but order matters for this):

image

image

  1. Scroll to bottom of category and add these keymap entries:

Key: B
Key_mode: "Press"
Identifier: wm.context_set_boolean
Context: space_data.shading.show_xray
Value: "True"

This forces you into x ray mode while key is held down. Amount of x ray transparency is controlled in viewport shading settings, no change here so set it to 1.0 manually.

Key: B
Key_mode: "Click Drag"
Identifier: view3d.select_box
Uncheck: "Wait for Input"

While holding B you now can left click drag to set selection.

Key: B
Key_mode: "Release"
Identifier: wm.context_set_boolean
Context: space_data.shading.show_xray
Value: "False"

This forces you out of x ray mode on B key release.

Demo:

If you want alternative, more “aggressive” version that forces you into wireframe shading mode instead x ray of current mode it looks like this:

Aggressive method

Key: B
Key_mode: "Press"
Identifier: wm.context_set_enum
Context: space_data.shading.type
Value: WIREFRAME
Key: B
Key_mode: "Click Drag"
Identifier: view3d.select_box
Uncheck: "Wait for Input"
Key: B
Key_mode: "Release"
Identifier: wm.context_set_enum
Context: space_data.shading.type
Value: SOLID

Demo:

1 Like

Interesting workflow I think I will have to give it a go.
Thanks for sharing the details so crealy.