X-Ray Selection Tools

Yes! Thanks. :grinning: I can confirm selecting multiple components in multiple objects works now in edit mode.

It’s almost perfect in edit mode, but I noticed that it doesn’t leave x-ray mode when mouse click is released. I have to move my cursor for x-ray mode to be gone. This is just a small ui/ux thing, so not such a big deal. At first, I thought selection was just laggy. I think this could be the source of lag that people mentioned. Can anyone else confirm this small bug (in both versions)?

I don’t notice much of a speed difference in either version, however.

The first set of hotkeys in your screenshot it’s hotkeys for mesh mode tool in the toolbar, the second one - for object mode tool in the toolbar (so if the tool is selected that hotkeys will be used). Object mode and mesh mode tools are different. If you type default “Box Select” in the keymap filter there would be even larger number of duplicates.

Third one set and fourth (Object and Mesh) I added for convenience. They are for mapping tool to a hotkey, so you can execute it without needed to activate it in the toolbar. For example most of the times I have the cursor tool active, so I mapped box select on rmb. By default, they are disabled, but you can enable and change them in the addon preferences, without having to search for them in the keymap. And they will be removed if you decide to uninstall the addon

2 Likes

I can’t reproduce it. Let’s wait until someone else confirms it. If you experienced this with the 1.3 version try adding context.region.tag_redraw() to 203 line, like this, maybe it will help

        if any(self.init_mod_states):
            for mod, state in self.init_mod_states:
                mod.show_in_editmode = state
        context.region.tag_redraw()
1 Like

That didn’t work for version 1.3. However, after some more testing this isn’t an easily reproducible bug for 1.4. I’m not sure if I can reproduce it on 1.4 again. Maybe the constant switching back and forth between versions did something. :smile: It’s probably something on my end. I’m using 2.82a snap version of Blender on Ubuntu. Anyway, like you said, it’s better to wait for someone else to confirm it before working on anything. Object mode is more important.

Nice add-on. I haven’t tested it yet. I actually got help from a fellow forum member to pull off this exact functionality by using Pie Menu Editor add-on.

Nice to see it in add-on form!! :slight_smile:

Just want to say thanks for the add-on. I’m going to try to set it to middle-mouse, and then my workflow will be soooo much smoother! Thank you!

Just look at the response…this add-on should be added into the CORE of Blender and should have been the default.
Just like box select will select objects behind/covered up in object mode.
This is the expected behavior anyway from other 3D packages.

2 Likes

I have another suggestion for edit mode. In solid view, edge selection still functions inconsistently the same way in X-ray mode where it won’t select edges partially within the box. It would be nice to make solid view selection conform to the way X-ray select works: select any edges partially in the box.

Can you show an example?

Normal solid view selection in edit mode:

Before:

After release of mouse button:

There are 3 edges that are partially within the box that aren’t selected in solid view mode.

Do you start the selection with a shortcut or from the toolbar tool?

I tried both and this is all Blender’s default edge selection behavior when not using your add-on tool.

There is a checkbox in the keymaps and in the tool settings.
Uncheck “Only inner edges”

1 Like

I think we’re misunderstanding each other a bit. This isn’t about your tool’s functionality. I’m talking about Blender’s select tool because sometimes people would want to disable select through and only work in solid view mode. Your add-on only selects through, so that means I will have switch to Blender’s default select tool to avoid selecting through. I guess the feature I’m suggesting would be out of the scope of your add-on’s name “box select X-RAY”. I was just thinking you might as well add similar functionality when one doesn’t want to select through.

I think that the different edge selection in the solid view can’t be done. At least I don’t know any simple way of finding occluded mesh elements (like finding edges that aren’t visible in the view). As I found out, people create custom blender builds for that

But I can add a checkbox to disable just select through, sure:
Select Box X-Ray 1.3.5 alpha.zip (50.1 KB)

Ah thanks. Yes, I’m also aware of the custom build. Anyway, you’ve done great work. Keep it up. :+1:

1.3.5 alpha

Minor typo on line 134, an extra “t” on the word “Through”:
name = "Select Throught",

Bad typo on line 150, missing an “s” in “context.selected_objects”:
for ob in context.selected_object:
(this typo also exists in version 1.3.4 on line 144)

Something is a bit funky with 1.3.5.

  • Changing the Shift command to Difference only reliably functions in Vertex selection mode. In Edge and Face mode it appears to always use “Set” instead of Difference. Messing around with the settings sometimes seems to make it work in Face mode but never in Edge mode. (In 1.3.4 the same problem seems to exist with Edge mode but Face mode reliably works every time.)
  • “Only Inner Edges” and “Only Face Centers” also don’t appear to work all the time, changing the prefs in the keymap doesn’t have an effect sometimes. (Neither of these appear to affect 1.3.4.)

I actually don’t know how to make heads or tails of everything that’s going on in 1.3.5 because sometimes parts work and sometimes they don’t.

The above issues don’t seem to be a problem in 1.4.3 Alpha at all.

One problem that affects both 1.4.3 and 1.3.5:

  • The keymap prefs are not saved when restarting Blender. They revert to default. Ah, I see this is a Blender bug..

1 Like

Oops, found a bug in 1.4.3. There needs to be a test in def edge_intersect_rectangle to only operate on meshes.

Steps to Reproduce:

  1. In Object Mode, select an object that is not a mesh.
  2. Extend your selection to include a mesh (Shift+click, not a box selection)(in other words, make sure the mesh is the last thing you select so it’s the active object)
  3. Enter Edit Mode
  4. Use Select Box X-Ray to try box selecting components of the mesh

Observed Result: TypeError: expected 'Mesh' type found 'PointLight' instead triggers at line 281(?).

        for ob in context.selected_objects:
            me = ob.data
            bm = bmesh.from_edit_mesh(me)

Blender allows you to have any object type in context.selected_objects while in Edit Mode as long as the Active object is the correct type to enter Edit Mode.

I added a check like the following code block and it fixed the bmesh error message but that wasn’t good enough because I had some bizarre selection issues afterward (I guess it was still trying to get/use coords from non-mesh “ob” elsewhere in the code for the rectangle intersection in some way).

        for ob in context.selected_objects:
            if ob.type == "MESH":
                me = ob.data
                bm = bmesh.from_edit_mesh(me)

So I changed the code again and this seems to completely fix the issue and have correct selection by filtering out anything that isn’t a mesh; without having to change anything about “ob” elsewhere in the code (even the indents can stay as-is):

        meshes = [obj for obj in context.selected_objects if obj.type == "MESH"]
        for ob in meshes:
            me = ob.data
            bm = bmesh.from_edit_mesh(me)

I’ve not tested 1.3.x for the same issue as I’ve decided to stick with 1.4.x.

4 Likes

Great job debugging this Chris!

2 Likes