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:
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”
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.
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..
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:
- In Object Mode, select an object that is not a mesh.
- 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)
- Enter Edit Mode
- Use Select Box X-Ray to try box selecting components of the mesh
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.
Great job debugging this Chris!
Steps to Reproduce:
- Move your viewport inside of a mesh
- Attempt to Box Select X-Ray a vertex from inside the mesh
Error: Traceback (most recent call last): File "C:\Portable\blender-2.82a-windows64\2.82\scripts\addons\space_view3d_select_box_xray_1_4\__init__.py", line 187, in modal self.finish(context, event) File "C:\Portable\blender-2.82a-windows64\2.82\scripts\addons\space_view3d_select_box_xray_1_4\__init__.py", line 201, in finish self.select_elems_in_rectangle(context, mode=self.mode, only_inner_edges=self.only_inner_edges, only_face_centers=self.only_face_centers, xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax) File "C:\Portable\blender-2.82a-windows64\2.82\scripts\addons\space_view3d_select_box_xray_1_4\__init__.py", line 299, in select_elems_in_rectangle if co_inside_rectangle(region, rv3d, co): File "C:\Portable\blender-2.82a-windows64\2.82\scripts\addons\space_view3d_select_box_xray_1_4\__init__.py", line 221, in co_inside_rectangle return xmin <= co.x <= xmax and ymin <= co.y <= ymax AttributeError: 'NoneType' object has no attribute 'x' location: <unknown location>:-1
Also happens when you’re “inside” a concave part of a mesh:
Sorry to bother, but I have a question.
I saw from early on in the thread that you started posting two separate versions of the addon, a 1.4.x and a 1.3.x version, but I never saw an explanation or the reason as to why two versions?
Could you enlighten me please? What version should I download? Thanks!!!
Here’s the explanation by him
tl;dr - use gumroad version
I added those versions upon request. They have options to select all edges and faces in the selection box, not just face centers and edges that are completely inside. But I didn’t have time to test them. Therefore, if you don’t need those features, use the version on the gumroad. Eventually, I add these features to gumroad version too, I just want to eliminate all bugs first and improve performance.
There are two versions, because they use different methods, I tried to find out which one works better and have fewer bugs.
Thanks a lot!
Thank you for the bugreports! I think I fixed it all
Select Box X-Ray 2.0 beta.zip (41.9 KB)
Select Box X-Ray 2.0.1 beta.zip (41.8 KB)
Fix for face selection not flushed properly in edge mode (e.g selecting/deselecting edges didn’t change face selection)