Fix #120400: Remove cyclic dependency of pbvh type when building bmesh pbvh #120445

Merged
Hans Goudey merged 1 commits from Sean-Kim/blender:120400-dyntopo-crash into main 2024-04-10 02:57:44 +02:00
Member

This PR fixes a crash when enabling Dyntopo.

When the PBVH generation code for BMesh was changed in b3aca5b28f, a bug was introduced where dependent code to generate necessary layers for BMesh could no longer access the PBVH type, as it was not generated yet. As the type is known in the code at time of construction, I opted to add parameters specifying the PBVHType to necessary methods when accessing attributes.

Possible Alternate Solutions

  • Reverting the change to PBVH creation to first generate a empty object with just the type specific, then creating layers, then generating the rest of the object seemed to be a step backwards for the overall API
  • Moving the layer generation code inside the PBVH creation code or otherwise further untangling the BMesh PBVH generation code seemed like a more invasive change than this PR
This PR fixes a crash when enabling Dyntopo. When the PBVH generation code for BMesh was changed in b3aca5b28f, a bug was introduced where dependent code to generate necessary layers for BMesh could no longer access the PBVH type, as it was not generated yet. As the type is known in the code at time of construction, I opted to add parameters specifying the PBVHType to necessary methods when accessing attributes. ## Possible Alternate Solutions * Reverting the change to PBVH creation to first generate a empty object with just the type specific, then creating layers, then generating the rest of the object seemed to be a step backwards for the overall API * Moving the layer generation code inside the PBVH creation code or otherwise further untangling the BMesh PBVH generation code seemed like a more invasive change than this PR
Sean Kim added 1 commit 2024-04-10 00:09:06 +02:00
Fix #120400: Remove cyclic dependency of pbvh type when building bmesh pbvh
All checks were successful
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
4f06a87b8f
Sean Kim requested review from Hans Goudey 2024-04-10 00:10:12 +02:00
Hans Goudey approved these changes 2024-04-10 02:19:37 +02:00
Member

@blender-bot build

@blender-bot build
Member

Thanks! This seems like a reasonable approach. Removing the implicit requirement for a certain ordering of function calls is a good thing.

Thanks! This seems like a reasonable approach. Removing the implicit requirement for a certain ordering of function calls is a good thing.
Hans Goudey merged commit ea1cfdbf83 into main 2024-04-10 02:57:44 +02:00
Sean Kim deleted branch 120400-dyntopo-crash 2024-04-11 01:43:20 +02:00
Sign in to join this conversation.
No reviewers
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 & 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
2 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#120445
No description provided.