Fix #120761: Handle vert to face flushing in vert_hide_update #121678
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
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#121678
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Sean-Kim/blender:fix-120761-option-2"
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?
This PR changes the
vert_hide_update
function to flush visibility from the selected vertices to their corresponding faces on the node level instead of on the mesh level. This ensures that in certain cases where vertices exist along the border of a nodes are selected that all corresponding faces are updated and their PBVH nodes are tagged for updating appropriately.Additionally, this provides a roughly 15ms improvement over the current implementation operating on a subdivided sphere of 32 million vertices when selecting a relatively small portion of the mesh. (50ms -> 35ms).
Spawned from a discussion on #120798
Looks great, thanks!
@ -200,0 +204,4 @@
const Span<bool> hide_vert,
MutableSpan<bool> hide_face)
{
for (const int face_idx : node_faces.index_range()) {
How about this?
This avoids the distinction between
face
andface_idx
and writes the assignment more concisely.Actually, we need the
index_range()
here because this is following the samescatter
/gather
pattern that's used in the other callbacks likecalc_hide
-node_faces
andhide_face
are expected to be the same length:@ -200,0 +259,4 @@
}
/* Updates all of a mesh's edge visibility based on vertex visibility. */
static void flush_edge_changes(Mesh &mesh, Span<bool> hide_vert)
How about calling the existing
edge_hide_from_vert
in some way instead of implementing the same thing here?Whoops, yeah that's definitely a better option. Will do.
@ -339,0 +339,4 @@
/**
* Calculate edge visibility based on vertex visibility, hides an edge when either of its
* vertices are hidden. */
void edge_hide_from_vert(const Span<int2> edges,
const Span<int2> edges
->Span<int2> edges
Also add the
mesh_
prefix since this is only in theblender::bke
namespaceThanks, looks good, pending two little changes.
@ -200,0 +259,4 @@
bke::SpanAttributeWriter<bool> hide_edge = attributes.lookup_or_add_for_write_only_span<bool>(
".hide_edge", bke::AttrDomain::Edge);
Span<int2> edges = mesh.edges();
bke::edge_hide_from_vert(edges, hide_vert, hide_edge.span);
Fine to just put
mesh.edges()
in the call here IMO, without the separate variable.@blender-bot build