Fix: Geometry Nodes: Create instance attribute of the right type #110146

Merged
Hans Goudey merged 8 commits from mod_moder/blender:tmp_fix_instances_crash into blender-v4.0-release 2023-10-14 10:54:41 +02:00

attributes_to_propagate is map of all attributes to propagate from different
components. For attribute propagation three different components is taken.
Each one can have named attribute with specific type. Currenct implementation
of propagation: Try to make implicit share attribute. Or create/copy.
This dosn't takes into account attributes_to_propagate' data type info.
So, this cause crash for case, there multiple component have same name attribute
with different type.
Fix: Try to make implicit share attribute with correct type. Or create, copy typed version.

`attributes_to_propagate` is map of all attributes to propagate from different components. For attribute propagation three different components is taken. Each one can have named attribute with specific type. Currenct implementation of propagation: Try to make implicit share attribute. Or create/copy. This dosn't takes into account `attributes_to_propagate`' data type info. So, this cause crash for case, there multiple component have same name attribute with different type. Fix: Try to make implicit share attribute with correct type. Or create, copy typed version.
Iliya Katushenock added the
Interest
Geometry Nodes
label 2023-07-15 21:40:55 +02:00
Iliya Katushenock added 1 commit 2023-07-15 21:41:06 +02:00
Iliya Katushenock added this to the Nodes & Physics project 2023-07-15 21:41:10 +02:00
Iliya Katushenock requested review from Hans Goudey 2023-07-15 21:41:14 +02:00
Hans Goudey requested changes 2023-07-24 21:40:03 +02:00
Hans Goudey left a comment
Member

Hmm. Thanks for the fix. The existing src.varray.size() == dst_component.instances_num() check is supposed to account for this, but it misses that the result instances are resized every time.

I wonder if we should handle this differently actually, and just create bke::Instances for each component, then join them afterwards. I'm not sure if it's worth optimizing for the case where points are used from multiple source components. Best to check Jacques' opinion about that.

Hmm. Thanks for the fix. The existing `src.varray.size() == dst_component.instances_num()` check is supposed to account for this, but it misses that the result instances are resized every time. I wonder if we should handle this differently actually, and just create `bke::Instances` for each component, then join them afterwards. I'm not sure if it's worth optimizing for the case where points are used from multiple source components. Best to check Jacques' opinion about that.
@ -161,3 +162,4 @@
for (const auto item : attributes_to_propagate.items()) {
const AttributeIDRef &id = item.key;
const eCustomDataType data_type = item.value.data_type;
const bke::GAttributeReader src = src_attributes.lookup(id, ATTR_DOMAIN_POINT);
Member

I think this achieves the same thing, but more automatically:

    const bke::GAttributeReader src = src_attributes.lookup(
        id, ATTR_DOMAIN_POINT, item.value.data_type);
I think this achieves the same thing, but more automatically: ``` const bke::GAttributeReader src = src_attributes.lookup( id, ATTR_DOMAIN_POINT, item.value.data_type); ```
mod_moder marked this conversation as resolved
Iliya Katushenock changed title from Fix: Geometry Nodes: Create instance attribute of the right type to Fix: Geometry Nodes: Create instance attribute of the right type 2023-10-13 19:52:25 +02:00
mod_moder changed target branch from main to blender-v4.0-release 2023-10-13 19:52:59 +02:00
Author
Member

Hmm. Thanks for the fix. The existing src.varray.size() == dst_component.instances_num() check is supposed to account for this, but it misses that the result instances are resized every time.

I doubt it's related. The problem is the difference in the type of data in geometries when they are joined to instances domain.

> Hmm. Thanks for the fix. The existing src.varray.size() == dst_component.instances_num() check is supposed to account for this, but it misses that the result instances are resized every time. I doubt it's related. The problem is the difference in the type of data in geometries when they are joined to instances domain.
Iliya Katushenock added 3 commits 2023-10-13 19:59:20 +02:00
Iliya Katushenock added 1 commit 2023-10-13 20:00:07 +02:00
Iliya Katushenock requested review from Hans Goudey 2023-10-13 20:00:17 +02:00
Iliya Katushenock added 2 commits 2023-10-13 20:04:42 +02:00
Iliya Katushenock added this to the 4.0 milestone 2023-10-13 20:43:19 +02:00
Iliya Katushenock added 1 commit 2023-10-14 09:50:44 +02:00
buildbot/vexp-code-patch-coordinator Build done. Details
b4225aa005
progress
Member

@blender-bot build

@blender-bot build
Hans Goudey approved these changes 2023-10-14 10:15:49 +02:00
Hans Goudey left a comment
Member

Looks good to me, thanks. I'll commit this pending test results.

Looks good to me, thanks. I'll commit this pending test results.
Author
Member

The only one failed test is bf_asset_system_tests, currently this is failure on all build bots.

The only one failed test is `bf_asset_system_tests`, currently this is failure on all build bots.
Hans Goudey merged commit 690deeda18 into blender-v4.0-release 2023-10-14 10:54:41 +02:00
Iliya Katushenock deleted branch tmp_fix_instances_crash 2023-10-14 11:00:26 +02:00
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#110146
No description provided.