UI: View-Facing Mesh Select Option #109357

Open
Lukas Sneyd wants to merge 12 commits from lcas/blender:vfs into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
First-time contributor

Optional selection behavior based on viewport facing angle.


Blender selects unseen mesh. If you can see some of the verts of an edge or face, they're potentially selectable regardless of their visibility. If it isn't truly random which unseen edges and faces this applies to, it may as well be. The 3 drag selection tools select the same wrong things, but if the viewport camera is moved or rotated, this will usually mean that different unseen edges and faces are now selectable. Watch 4:17 of this youtube video about my custom build #109150 to see what I mean.

Viewport-Facing Select is in Toolsettings. It works in near select, X-Ray, or both. When you drag select with box/circle/lasso, it compares mesh normals to the viewport. If they aren't facing each other within the threshold, they won't be selected. Has a range from +/- 0.999999. Greater or equal to 0 means you will only select mesh with normals that are pointed in the direction you have it set to, usually this would be towards the viewport but it can be reversed if you want. The higher you set the threshold, the more the mesh needs to be facing in that direction. A value of 1 should mean the viewport and mesh are aligned, but was only working from the front perspective (numpad 1) and from nowhere else regardless of ortho. Max threshold of 0.999999 is functionally the same as having it at 1 except it works from any angle. Negative values can select unseen mesh.

image

All Verts setting saves performance without compromise, because Blender doesn't select unseen verts. They're dimensionless, and since there's only one position for them to be drawn in, they shouldn't be in the selection bitmap unless they're visible.

Front Verts will select verts based on their normals,. Some of the verts at the edge of a mesh are excluded. Verts of Front Face will fix that, it selects verts if they're part of a face with a viewport facing normal. There's also rear facing counterparts to these, they do the opposite where they'll select stuff pointed away from the viewport. Not sure if they're useful but it's easy to include.

The settings for edges work the same as verts. Using edge normals will exclude things you probably want to select, and Edges of Front Face will correct that. Same goes for face settings, except Front Faces are what give accurate selection. Faces of Front Vert will select faces that have at least one vert with a viewport facing normal. This means it can select unseen faces, which is what I'm trying to avoid, but maybe it's useful for something.

Sometimes you will be able to see a face even though it has a rear-facing normal, and VFS won't select it. Usually this is because you are dealing with two triangles that have no business sharing the same quad, but that's going to happen from time to time, and you'll need a way to select them. Besides turning this feature off temporarily, triangulating or otherwise fixing the mesh, single-clicking, or rotating the camera, you can drop the VFS threshold into the negative. How negative you go depends on what you're willing to live with, and it gets worse the lower you go. I keep it at zero, because at least I have a chance of noticing things I didn't select. Hard to keep track of random selections that you can't see. It's not perfect, but it's predicable, and should work with most geometry.

Optional selection behavior based on viewport facing angle. --- Blender selects unseen mesh. If you can see some of the verts of an edge or face, they're potentially selectable regardless of their visibility. If it isn't truly random which unseen edges and faces this applies to, it may as well be. The 3 drag selection tools select the same wrong things, but if the viewport camera is moved or rotated, this will usually mean that different unseen edges and faces are now selectable. Watch 4:17 of this [youtube video](https://www.youtube.com/watch?v=HVrFCOa7RO8&t=257s) about my [custom build](https://blenderartists.org/t/blender-with-better-selection-and-more/1471220) #109150 to see what I mean. Viewport-Facing Select is in Toolsettings. It works in near select, X-Ray, or both. When you drag select with box/circle/lasso, it compares mesh normals to the viewport. If they aren't facing each other within the threshold, they won't be selected. Has a range from +/- 0.999999. Greater or equal to 0 means you will only select mesh with normals that are pointed in the direction you have it set to, usually this would be towards the viewport but it can be reversed if you want. The higher you set the threshold, the more the mesh needs to be facing in that direction. A value of 1 should mean the viewport and mesh are aligned, but was only working from the front perspective (numpad 1) and from nowhere else regardless of ortho. Max threshold of 0.999999 is functionally the same as having it at 1 except it works from any angle. Negative values can select unseen mesh. ![image](/attachments/f5a7f77c-084b-4be0-baeb-5beaf4c71017) All Verts setting saves performance without compromise, because Blender doesn't select unseen verts. They're dimensionless, and since there's only one position for them to be drawn in, they shouldn't be in the selection bitmap unless they're visible. Front Verts will select verts based on their normals,. Some of the verts at the edge of a mesh are excluded. Verts of Front Face will fix that, it selects verts if they're part of a face with a viewport facing normal. There's also rear facing counterparts to these, they do the opposite where they'll select stuff pointed away from the viewport. Not sure if they're useful but it's easy to include. The settings for edges work the same as verts. Using edge normals will exclude things you probably want to select, and Edges of Front Face will correct that. Same goes for face settings, except Front Faces are what give accurate selection. Faces of Front Vert will select faces that have at least one vert with a viewport facing normal. This means it can select unseen faces, which is what I'm trying to avoid, but maybe it's useful for something. Sometimes you will be able to see a face even though it has a rear-facing normal, and VFS won't select it. Usually this is because you are dealing with two triangles that have no business sharing the same quad, but that's going to happen from time to time, and you'll need a way to select them. Besides turning this feature off temporarily, triangulating or otherwise fixing the mesh, single-clicking, or rotating the camera, you can drop the VFS threshold into the negative. How negative you go depends on what you're willing to live with, and it gets worse the lower you go. I keep it at zero, because at least I have a chance of noticing things I didn't select. Hard to keep track of random selections that you can't see. It's not perfect, but it's predicable, and should work with most geometry.
Lukas Sneyd added 1 commit 2023-06-26 08:02:16 +02:00
Lukas Sneyd added 1 commit 2023-07-05 13:03:41 +02:00
Lukas Sneyd added 1 commit 2023-07-05 13:04:17 +02:00
Lukas Sneyd added 1 commit 2023-07-05 13:15:12 +02:00
Lukas Sneyd added 1 commit 2023-07-06 14:16:11 +02:00
Lukas Sneyd added 1 commit 2023-07-07 05:39:03 +02:00
Lukas Sneyd added 1 commit 2023-07-15 23:44:46 +02:00
Lukas Sneyd changed title from WIP: Viewport Facing Mesh Select to Viewport Facing Mesh Select 2023-07-15 23:48:35 +02:00
Author
First-time contributor

I was told to tag you guys. I don't know what I'm supposed to do, but I will try this. Thanks for your time
@ideasman42 @harley

I was told to tag you guys. I don't know what I'm supposed to do, but I will try this. Thanks for your time @ideasman42 @harley
Harley Acheson changed title from Viewport Facing Mesh Select to UI: View-Facing Mesh Select Option 2023-07-17 22:54:09 +02:00
Harley Acheson added this to the User Interface project 2023-07-17 23:00:10 +02:00
Lukas Sneyd added 1 commit 2023-07-23 18:23:24 +02:00
Lukas Sneyd added 1 commit 2023-08-01 10:12:12 +02:00
Lukas Sneyd added 1 commit 2023-08-06 08:58:14 +02:00
Lukas Sneyd added 1 commit 2023-08-13 10:03:44 +02:00
Lukas Sneyd added 1 commit 2023-08-21 06:32:39 +02:00
This pull request has changes conflicting with the target branch.
  • source/blender/blenloader/intern/versioning_defaults.cc
  • source/blender/editors/space_view3d/view3d_select.cc
  • source/blender/makesdna/DNA_scene_types.h

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u vfs:lcas-vfs
git checkout lcas-vfs
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#109357
No description provided.