Mesh: Remove unnecessary edge draw flag #104417
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
FBX
Interest
Freestyle
Interest
Geometry Nodes
Interest
glTF
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 & 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
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & 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#104417
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "HooglyBoogly/blender:refactor-mesh-edge-draw-flag-remove"
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?
As described in #95966, replace the
ME_EDGEDRAW
flag with a bit vectorin mesh runtime data. Currently the the flag is only ever set to false for the
"optimal display" feature of the subdivision surface modifier. When creating
an "original" mesh in the main data-base, the flag is always supposed to be true.
The bit vector is now created by the modifier only as necessary, and is cleared
for topology-changing operations. This fixes incorrect interpolation of the flag
as noted in #104376. Generally it isn't possible to interpolate it through
topology-changing operations.
After this, only the seam status needs to be removed from edges before we
can replace them with the generic
int2
type (or something similar) andreduce memory usage by 1/3.
Related:
10131a6f62
145839aa42
In the future
BM_ELEM_DRAW
could be removed as well. Currentlyit is used and aliased by other defines in some non-obvious ways though.
Works well, my only concern is that none of these assignments are re-using existing memory where flags have existing values, where
edge.flag = ME_EDGEDRAW;
should be replaced byedge.flag = 0;
however as far as I can see this is not the case.Good point, I'll look through the patch to make sure it's okay in that respect. For newly allocated meshes, edges are allocated with
CD_SET_DEFAULT
, which means the flag is already zeroed and doesn't have to be manually zeroed (this affects the primitive nodes, for example).Just some code-readability tweaks.
@ -122,3 +122,3 @@
BLI_edgehashIterator_setValue(ehi, POINTER_FROM_UINT(e_index));
medge->flag = ME_EDGEDRAW;
medge->flag = 0;
Just pattern checking. In other places you remove the assignment of flag, but here it is explicitly unset.
Yes, here I'm not totally sure that the new edges are initialized so it should be cleared to be sure.
@ -125,3 +125,3 @@
const char hflag = e->head.hflag;
return ((hflag & BM_ELEM_SEAM) ? ME_SEAM : 0) | ((hflag & BM_ELEM_DRAW) ? ME_EDGEDRAW : 0);
return ((hflag & BM_ELEM_SEAM) ? ME_SEAM : 0);
Outer level of () can be removed.