Geometry Nodes modifier with dependent outputs use modified value #95084

Closed
opened 2022-01-20 14:13:19 +01:00 by Lukas Tönne · 12 comments
Member

System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 456.71

Blender Version
Broken: version: 3.1.0 Alpha, branch: master, commit date: 2022-01-20 00:21, hash: b47a1867e8
Worked: n/a

Short description of error
Geometry nodes modifier will use the output attribute result for attribute evaluations further down the stack, instead of the original value.

Exact steps for others to reproduce the error

  1. Open test file below
  2. The GN modifier has two outputs A and B, and one input.
  Input A reads from an attribute "Attribute" (declared in mesh data) which defaults to 0.
  One output also writes back to "Attribute"
  {F12812655}
  1. Nodes replace "Attribute" value with 0.5, and the second output adds 2.0 to "Attribute" value.
  {F12812659}

attribute_output_dependencies.blend
Observed: B output value is 2.5, it uses the modified value of "Attribute" 0.5 instead of the original value of 0.0.
Expected: B should be using the original input of "Attribute", so output should be A==0.5, B==2.0.
The behavior also depends on ordering: If output B is moved to the top it gets evaluated before A and uses the original value as expected (this can be used a workaround if outputs can be sorted by dependency). The result of the modifier should not depend on the order of output attributes.

**System Information** Operating system: Windows-10-10.0.19044-SP0 64 Bits Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 456.71 **Blender Version** Broken: version: 3.1.0 Alpha, branch: master, commit date: 2022-01-20 00:21, hash: `b47a1867e8` Worked: n/a **Short description of error** Geometry nodes modifier will use the output attribute result for attribute evaluations further down the stack, instead of the original value. **Exact steps for others to reproduce the error** 1. Open test file below 2. The GN modifier has two outputs A and B, and one input. ``` Input A reads from an attribute "Attribute" (declared in mesh data) which defaults to 0. One output also writes back to "Attribute" {F12812655} ``` 3. Nodes replace "Attribute" value with 0.5, and the second output adds 2.0 to "Attribute" value. ``` {F12812659} ``` [attribute_output_dependencies.blend](https://archive.blender.org/developer/F12812651/attribute_output_dependencies.blend) **Observed:** B output value is 2.5, it uses the *modified* value of "Attribute" 0.5 instead of the original value of 0.0. **Expected:** B should be using the original input of "Attribute", so output should be A==0.5, B==2.0. The behavior also depends on ordering: If output B is moved to the top it gets evaluated before A and uses the original value as expected (this can be used a workaround if outputs can be sorted by dependency). The result of the modifier should not depend on the order of output attributes.
Author
Member

Added subscriber: @LukasTonne

Added subscriber: @LukasTonne
Author
Member

I realized there is still some of ambiguity here even if input attributes are cached somehow and all output paths use the same input values. For example: multiple outputs can write to the same mesh attributes, so that would also be order dependent. But at least then it would be consistent inside the node tree, where i would expect values to not depend on the order of outputs.

I realized there is still some of ambiguity here even if input attributes are cached somehow and all output paths use the same input values. For example: multiple outputs can write to the same mesh attributes, so that would also be order dependent. But at least then it would be consistent inside the node tree, where i would expect values to not depend on the order of outputs.
Member

Added subscribers: @HooglyBoogly, @JacquesLucke, @lichtwerk

Added subscribers: @HooglyBoogly, @JacquesLucke, @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Hm, interesting, can confirm the behavior.

@HooglyBoogly , @JacquesLucke : is this something you have a solution for?

Hm, interesting, can confirm the behavior. @HooglyBoogly , @JacquesLucke : is this something you have a solution for?
Member

Ah right, I wanted to look into this. Haven't looked into this specific bug in detail yet, but it's probably the same as #93715. Just that the files looks simpler, which is nice.

Ah right, I wanted to look into this. Haven't looked into this specific bug in detail yet, but it's probably the same as #93715. Just that the files looks simpler, which is nice.
Author
Member

I also have a suspicion that using the same mesh attribute for input and output can cause multiple modifier evaluations. Are attribute layers represented as individual depsgraph nodes?
Will try to make a test file to demonstrate. My use-case is a bit unconventional (iterative mesh manipulation over multiple frames), so i'm trying to boil it down to a simpler case that should be more obviously supported.

I also have a suspicion that using the same mesh attribute for input and output can cause multiple modifier evaluations. Are attribute layers represented as individual depsgraph nodes? Will try to make a test file to demonstrate. My use-case is a bit unconventional (iterative mesh manipulation over multiple frames), so i'm trying to boil it down to a simpler case that should be more obviously supported.
Member

Are attribute layers represented as individual depsgraph nodes?

No. The entire modifier stack evaluation is a single depsgraph node currently.

I also have a suspicion that using the same mesh attribute for input and output can cause multiple modifier evaluations.

Not sure how that could happen. Maybe a call to CustomData_duplicate_referenced_layer is missing somewhere.

> Are attribute layers represented as individual depsgraph nodes? No. The entire modifier stack evaluation is a single depsgraph node currently. > I also have a suspicion that using the same mesh attribute for input and output can cause multiple modifier evaluations. Not sure how that could happen. Maybe a call to `CustomData_duplicate_referenced_layer` is missing somewhere.
Author
Member

I also have a suspicion that using the same mesh attribute for input and output can cause multiple modifier evaluations.

My mistake after all: I am copying the depsgraph result mesh and replace the object mesh data with python to implement a kind of iterative process. I was doing this copy in a post-step handler, which means that the viewport will always display the result of the next frame, effectively skipping ahead one iteration. I need to tweak this process a bit to get the result i was expecting and show the output of the last step instead of the next one.
Sorry for the noise.

> I also have a suspicion that using the same mesh attribute for input and output can cause multiple modifier evaluations. > My mistake after all: I am copying the depsgraph result mesh and replace the object mesh data with python to implement a kind of iterative process. I was doing this copy in a post-step handler, which means that the viewport will always display the result of the next frame, effectively skipping ahead one iteration. I need to tweak this process a bit to get the result i was expecting and show the output of the last step instead of the next one. Sorry for the noise.
Author
Member

I can also confirm that capturing input attributes at the start of the node tree as suggested in #93715 helps avoid the issue.

I can also confirm that capturing input attributes at the start of the node tree as suggested in #93715 helps avoid the issue.
Jacques Lucke self-assigned this 2022-02-01 13:43:15 +01:00

This issue was referenced by a985f558a6

This issue was referenced by a985f558a6eb16cd6f00b550712b86923ab33fd3
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Sign in to join this conversation.
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 project
No Assignees
4 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#95084
No description provided.