Fix #116183: Mirror sometimes chooses the wrong vertex #116202
No reviewers
Labels
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#116202
Loading…
Reference in New Issue
No description provided.
Delete Branch "mano-wii/blender:fix_116183"
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?
The non-topology option of
EDBM_verts_mirror_cache_begin_ex
only usesthe vertices position to determine whether it is a mirror. However,
some vertices may have the same position. In these cases, another value
can be used to compare.
This commit proposes using the normal and connected edges of a vertex
to determine the best vertex in a group of vertices with the same
position.
Issue
Test file: bugReport.blend
This is interesting but I think it could be approached differently since this is adding involved logic to support a fairly uncommon use case. Currently mirror just doesn't support exactly overlapping vertices, so #116183 isn't a bug. I checked the user manual and this could be made more explicit.
There are some things to consider:
Even if this is supported in edit-mode, it wont be supported in weight-paint mirroring, so if we support this it should eventually be supported there too.
There would be rare cases where there are many vertices with the range, while unlikely it means each lookup could potentially allocate a large array, which is then inspected using expensive operations.
I'd expect the common case to be slower on high poly meshes because BLI_kdtree_3d_range_search is more expensive and allocates an array (even for a single item).
Having said all this - the functionality would be nice to support.
Suggestions:
2nd pass for un-assigned vertices
When some vertices don't have mirrored vertices (and aren't axis-aligned),
perform a second pass.
This method has the advantage that there is practically no overhead unless there are vertices without matches (only detecting when there are vertices that have no match).
Avoiding performance regressions for users with high-poly, symmetrical meshes.
Add dimensions to the KD-tree
A way to avoid gathering vertices within a range, then performing a search on those vertices could be to add additional dimensions to the KD tree: e.g. the normal / combined-edge-location could be added and the current logic of performing a nearest lookup can be kept.
The extra dimensions would need to be scaled down so the location would be dominant.
The advantage with this is it will have predictable performance & can be more easily implemented for Mesh data (not just BMesh).
A possible disadvantage is unwanted bias from the extra dimensions that could result in issues choosing between very near vertices, although this issue exists with any method that favors other attributes over nearest location.
It will also be slower, even in situations where it's not needed.
For this reason it could be optional, although I'm also not that keen on adding more options.
Checkout
From your project repository, check out a new branch and test the changes.