Unnecessary evaluation of object referenced in Geometry Nodes? #105098

Closed
opened 2023-02-22 21:41:51 +01:00 by Gabriel Moro · 7 comments

System Information
Operating system: Windows-10-10.0.22621-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 4090/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 528.24

Blender Version
Broken: version: 3.4.1, branch: blender-v3.4-release, commit date: 2022-12-19 17:00, hash: rB55485cb379f7
Worked: (newest version of Blender that worked as expected)

Short description of error
I'm moving a very simple object on the viewport and it lags a lot just because it's being referenced on Geometry Nodes. But I'm not making changes to the origin or anything that would alter the Geometry Nodes in any way. So this feels like it's a bug.

Exact steps for others to reproduce the error

  • Move the object Plane in this file
  • compare to moving when the referenced Geo Nodes object is hidden.

GNodes_dependency_graph.blend

**System Information** Operating system: Windows-10-10.0.22621-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 4090/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 528.24 **Blender Version** Broken: version: 3.4.1, branch: blender-v3.4-release, commit date: 2022-12-19 17:00, hash: `rB55485cb379f7` Worked: (newest version of Blender that worked as expected) **Short description of error** I'm moving a very simple object on the viewport and it lags a lot just because it's being referenced on Geometry Nodes. But I'm not making changes to the origin or anything that would alter the Geometry Nodes in any way. So this feels like it's a bug. **Exact steps for others to reproduce the error** - Move the object `Plane` in this file - compare to moving when the referenced Geo Nodes object is hidden. [GNodes_dependency_graph.blend](/attachments/ee07fcca-8e02-491e-bfe1-17f9b33002ee)
Gabriel Moro added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-02-22 21:41:52 +01:00

Would like to add something. When I try to open the .blend file provided by @GabrielMoro, blender crashes. But when I open it manually from my compiled version of blender, it works.

Would like to add something. When I try to open the .blend file provided by @GabrielMoro, blender crashes. But when I open it manually from my compiled version of blender, it works.

I'm new to open source development, any advice on how I can start fixing up this issue?

I'm new to open source development, any advice on how I can start fixing up this issue?

I don't think this is related to your report (since in it you say that the Whole Program lags, in which the object with geometry nodes is updated, if you move the object without geometry nodes?): an unused date block that is entered in the modifier panel , but not used by hosts, triggers updates. But this is more of an extreme example.

I don't think this is related to your report (since in it you say that the Whole Program lags, in which the object with geometry nodes is updated, if you move the object without geometry nodes?): an unused date block that is entered in the modifier panel , but not used by hosts, triggers updates. But this is more of an extreme example.
Iliya Katushenock added the
Interest
Geometry Nodes
label 2023-02-27 16:22:59 +01:00

Hey @Piyush-Aniruddha-Udhao for starters, it would be nice to understand what is not working at all.

Hey @Piyush-Aniruddha-Udhao for starters, it would be nice to understand what is not working at all.

I could simplify the file a lot more.
Basically, if a modifier references an object, the dependency with transform is included even if it is not used.

It seems to be a limitation.

I could simplify the file a lot more. Basically, if a modifier references an object, the dependency with transform is included even if it is not used. It seems to be a limitation.
Germano Cavalcante added
Status
Needs Info from Developers
and removed
Status
Confirmed
labels 2023-02-27 16:50:28 +01:00

I'll tell you right away. There's a bunch of stuff in here.

  1. If an object is entered into the modifier input panel (and preferably if this input is used in nodes), the modifier is completely updated on any hit. This is important, and here it (in the first example) immediately confused me.
    Explanation: Calculation of modifier dependencies, and the evaluation of result of the modifier's operation are 2 different callbacks. This means that without dirt, we cannot use the result of the geometry calculation as data for building dependencies. If the position statistics is used to switch the data block entered into the object info, then without the geometry data, we will not build the dependencies correctly. This is my task about this (most likely, some edits will be needed): #102881
  2. Static processing all ids in node inputs (writed manually) now comes down to: collect all the ids in an array, then add the dependency on all. Dependencies of object-ids: always transformation. Optional: geometry or collection.
    It looks closer. The original file would not have changed. But the example be @mano-wii would work without too many updates. I think this can be changed by moving the add dependency function to a callback (Well, or just make 2 lists to separate dependencies on geometry and transformation). But it's better to ask @JacquesLucke
*I'll tell you right away. There's a bunch of stuff in here.* 1. If an object is entered into the modifier input panel (and preferably if this input is used in nodes), the modifier is completely updated on any hit. This is important, and here it (in the first example) immediately confused me. Explanation: Calculation of modifier dependencies, and the evaluation of result of the modifier's operation are 2 different callbacks. This means that without dirt, we cannot use the result of the geometry calculation as data for building dependencies. If the position statistics is used to switch the data block entered into the object info, then without the geometry data, we will not build the dependencies correctly. This is my task about this (most likely, some edits will be needed): https://projects.blender.org/blender/blender/issues/102881 2. Static processing all ids in node inputs (writed manually) now comes down to: collect all the ids in an array, then add the dependency on all. Dependencies of object-ids: always transformation. Optional: geometry or collection. It looks closer. The original file would not have changed. But the example be @mano-wii would work without too many updates. I think this can be changed by moving the add dependency function to a callback (Well, or just make 2 lists to separate dependencies on geometry and transformation). But it's better to ask @JacquesLucke

I see that I simply did not take into account all the factors. Based on test branch: #106434

  1. If the node exists, we always take its dependencies.
  2. If there is a node socket, we always take its dependencies.

Because we can't know if a socket or node is being used without calculating the entire graph.
As a result, we depend on both the geometry and the position of the object. This is how we expect the socket output position to be used, so we update the modifier for that.
At the moment, as I pointed out in a previous comment, this is an implementation limitation, in other words, not a bug.

I see that I simply did not take into account all the factors. Based on test branch: https://projects.blender.org/blender/blender/pulls/106434 1. If the node exists, we always take its dependencies. 2. If there is a node socket, we always take its dependencies. Because we can't know if a socket or node is being used without calculating the entire graph. As a result, we depend on both the geometry and the position of the object. This is how we expect the socket output position to be used, so we update the modifier for that. At the moment, as I pointed out in a previous comment, this is an implementation limitation, in other words, not a bug.
Blender Bot added
Status
Archived
and removed
Status
Needs Info from Developers
labels 2023-04-01 18:38:56 +02:00
Iliya Katushenock added
Type
Known Issue
and removed
Type
Report
labels 2023-04-01 18:39:04 +02:00
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#105098
No description provided.