Fix: Explicitly prevent capturing built-in attribute with bad mata data #110433

Open
Iliya Katushenock wants to merge 7 commits from mod_moder/blender:tmp_fix_rewrite_builtin_attr into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

Add metadata validation for built-in attributes to fix the crash.

New error message in modifier panel:
image

Add metadata validation for built-in attributes to fix the crash. New error message in modifier panel: ![image](/attachments/c9949c1e-11a7-4dbb-842b-9a2635d6e49c)
Iliya Katushenock added the
Interest
Geometry Nodes
label 2023-07-24 23:26:01 +02:00
Iliya Katushenock added 1 commit 2023-07-24 23:26:11 +02:00
Iliya Katushenock requested review from Hans Goudey 2023-07-24 23:26:17 +02:00
Iliya Katushenock added this to the Nodes & Physics project 2023-07-24 23:26:21 +02:00
Member

Do we have existing tests where a regression test could be added? This particular case would be fixed, but since most attributes don't have validators adding some code coverage there could help in future.

Do we have existing tests where a regression test could be added? This particular case would be fixed, but since most attributes don't have validators adding some code coverage there could help in future.
Lukas Tönne requested changes 2023-08-17 13:58:03 +02:00
@ -510,6 +510,12 @@ bool try_capture_field_on_geometry(GeometryComponent &component,
}
}
if (!attribute_matches) {
Member

Can use else {, we already check for attribute_matches above.

Can use `else {`, we already check for `attribute_matches` above.
mod_moder marked this conversation as resolved
@ -511,2 +511,4 @@
}
if (!attribute_matches) {
if (attributes.is_builtin(attribute_id)) {
Member

I feel like such a check should be performed on a lower level. Maybe always return a default (no-op) validator from lookup_validator when there is no metadata match. It feels like try_capture_field_on_geometry is the wrong place to do such sanity checks.

If added here, then it needs a comment for explanation. Why can builtin attributes only be captured with matching metadata?

I feel like such a check should be performed on a lower level. Maybe always return a default (no-op) validator from `lookup_validator` when there is no metadata match. It feels like `try_capture_field_on_geometry` is the wrong place to do such sanity checks. If added here, then it needs a comment for explanation. Why can builtin attributes only be captured with matching metadata?
mod_moder marked this conversation as resolved
Iliya Katushenock added 2 commits 2023-08-17 17:38:48 +02:00
Iliya Katushenock requested review from Lukas Tönne 2023-08-17 17:39:03 +02:00
Iliya Katushenock added 2 commits 2023-08-25 00:29:22 +02:00
Iliya Katushenock added 1 commit 2023-08-25 00:39:09 +02:00
Iliya Katushenock added 1 commit 2023-08-31 20:06:51 +02:00
This pull request has changes conflicting with the target branch.
  • source/blender/blenkernel/BKE_attribute.hh
  • source/blender/blenkernel/intern/geometry_component_curves.cc
  • source/blender/blenkernel/intern/geometry_component_mesh.cc
  • source/blender/blenkernel/intern/geometry_fields.cc
  • source/blender/editors/geometry/node_group_operator.cc
  • source/blender/modifiers/intern/MOD_nodes.cc
  • source/blender/nodes/NOD_geometry_nodes_execute.hh
  • source/blender/nodes/intern/geometry_nodes_execute.cc

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u tmp_fix_rewrite_builtin_attr:mod_moder-tmp_fix_rewrite_builtin_attr
git checkout mod_moder-tmp_fix_rewrite_builtin_attr
Sign in to join this conversation.
No reviewers
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 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#110433
No description provided.