Fix #125646: Resolve edge-slide performance regression #128016
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#128016
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ideasman42/blender:pr-125646-fix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Partially revert 0 which replaced BMBVHTree with SnapObjectContext.
While SnapObjectContext is a comprehensive method of performing
ray-casts, the purpose of edge-slide visibility checks is mainly to
exclude back-facing edges from the direction calculation,
when the selected edge only has some of it's faces front-facing.
SnapObjectContext 3x ray-casts where each call would traverse into
node-groups, constructing & freeing dupli-lists which could make
Blender hang while sliding edges.
Resolve be restoring simpler self-occlusion check.
NOTE: even if
SnapObjectContext
could be optimized for this case, I don't think it's useful for the entire scene to be taken into account when calculating edge-slide direction.In fact, using the
SnapObjectContext
to test occlusion is slower, mainly because it iterates over all objects in the scene, creating linked lists and additional BVH trees for objects in the way.However, I would prefer to avoid using BMeshes in this code, as the edge slide code is now generic and works with UVs, and may later support other types of objects like Curves and Lattices. Currently,
sv->td->extra
is not always aBMVert
.Also, using
BM_ITER_ELEM(e, &iter_other, v, BM_EDGES_OF_VERT)
to test occlusion of all unselected edges connected to a vertex seems a bit excessive, since only one or two edges are chosen to slide. Themval_dir
andloop_dir
calculated at the end may not be the most ideal.As far as I can check, this code is only called once during the operation. Even with "navigate while transform," it is not called again.
As an alternative solution, I would prefer to create a new
eSnapTargetOP
, something likeSCE_SNAP_TARGET_ONLY_EDITED
orSCE_SNAP_TARGET_ONLY_ACTIVE
, to avoid iterating over all objects in the scene.94af2579b8
to754c3d513d
cf9b0f54ce
to26b55430ad
@mano-wii updated the patch to make the mesh check explicit and restored some of updates lost when reverting.
Checking further and old code has an advantage over use of the new snapping logic - which is that an edge never occludes itself - because the BMBVH ray-cast excludes faces connected to the edge.
I managed to find cases where the current snap logic incorrectly detects edges as occluded although they required using large scaled meshes.
Since the old logic has been in Blender for a long time, I think we could apply the patch for 4.2 LTS.
Then develop a different method separately.
@ -290,1 +230,3 @@
}
BMIter iter_other;
BMEdge *e;
BMVert *v = static_cast<BMVert *>(sv->td->extra);
Does this work if we use Edge Slide on a UV?
I've since split the BMesh part out, so UV's are handled in a separate loop.
@ -314,0 +249,4 @@
/* Screen-space coords. */
float2 sco_a, sco_b;
sld->project(sv, sco_a, sco_b);
We are re-projecting and re-testing the same sliding coordinates for each linked edge.
The
is_visible
logic should be moved to a function in order to break the loop at the first visible edge and only test once.12e5989d9c
to5eab0a7eb1
@ -304,1 +243,3 @@
sld->curr_sv_index = i;
if (BM_elem_flag_test(e, BM_ELEM_SELECT)) {
continue;
}
There is no need to retest the same vertex several times.
This should be moved to a function like this:
Fix #125646: Resolve edge-slide performance regression when snappingto Fix #125646: Resolve edge-slide performance regression