Geometry Nodes: Point instance node provides deleted objects #89735

Closed
opened 2021-07-08 14:50:00 +02:00 by user1 · 12 comments

System Information
Operating system: Linux-5.4.0-77-generic-x86_64-with-glibc2.27 64 Bits
Graphics card: GeForce GT 630/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 390.143

Blender Version
Broken: version: 3.0.0 Alpha, branch: arcpatch-D11813, commit date: 2021-07-07 09:31, hash: 8d222aa20d
Worked: (newest version of Blender that worked as expected)

Short description of error
After deleting a Suzanne object, the nodetree of another object still is able to call Suzanne.
Bildschirmfoto zu 2021-07-08 14-42-18.png
untitled.blend

**System Information** Operating system: Linux-5.4.0-77-generic-x86_64-with-glibc2.27 64 Bits Graphics card: GeForce GT 630/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 390.143 **Blender Version** Broken: version: 3.0.0 Alpha, branch: arcpatch-[D11813](https://archive.blender.org/developer/D11813), commit date: 2021-07-07 09:31, hash: `8d222aa20d` Worked: (newest version of Blender that worked as expected) **Short description of error** After deleting a Suzanne object, the nodetree of another object still is able to call Suzanne. ![Bildschirmfoto zu 2021-07-08 14-42-18.png](https://archive.blender.org/developer/F10217119/Bildschirmfoto_zu_2021-07-08_14-42-18.png) [untitled.blend](https://archive.blender.org/developer/F10217121/untitled.blend)
Author

Added subscriber: @user1

Added subscriber: @user1

Added subscriber: @chemicalcrux

Added subscriber: @chemicalcrux

I believe this is intended, albeit surprising: deleting the object just unlinks it from the scene. It still exists, just without any users.

If you purge unused datablocks (check the File menu), the objects should go away.

I believe this is intended, albeit surprising: deleting the object just unlinks it from the scene. It still exists, just without any users. If you purge unused datablocks (check the File menu), the objects should go away.

Added subscriber: @iss

Added subscriber: @iss

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

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

@chemicalcrux In this case, object will have user (nodes) and so it won't be marked as orphaned.

Not sure if this is intended really, because this changes behavior of what happens when object is deleted and it is used in some modifier for example:

  • if object is also used by geo nodes, it will still influence modifiers
  • if object is not used in geo nodes, it won't influence modifiers anymore.
@chemicalcrux In this case, object will have user (nodes) and so it won't be marked as orphaned. Not sure if this is intended really, because this changes behavior of what happens when object is deleted and it is used in some modifier for example: - if object is also used by geo nodes, it will still influence modifiers - if object is not used in geo nodes, it won't influence modifiers anymore.
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

I'm not sure about what behavior I'd expect tbh.

This bug is partially solved by the following diff. For some use cases it makes sense if the object would not be deleted though and when it is owned by the node group (e.g. when a node group asset "contains" an object).

diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc
index e9608457896..ccb130f8704 100644
--- a/source/blender/blenkernel/intern/node.cc
+++ b/source/blender/blenkernel/intern/node.cc
@@ -282,7 +282,7 @@ static void library_foreach_node_socket(LibraryForeachIDData *data, bNodeSocket
   switch ((eNodeSocketDatatype)sock->type) {
     case SOCK_OBJECT: {
       bNodeSocketValueObject *default_value = (bNodeSocketValueObject *)sock->default_value;
-      BKE_LIB_FOREACHID_PROCESS(data, default_value->value, IDWALK_CB_USER);
+      BKE_LIB_FOREACHID_PROCESS(data, default_value->value, IDWALK_CB_NOP);
       break;
     }
     case SOCK_IMAGE: {
@@ -293,7 +293,7 @@ static void library_foreach_node_socket(LibraryForeachIDData *data, bNodeSocket
     case SOCK_COLLECTION: {
       bNodeSocketValueCollection *default_value = (bNodeSocketValueCollection *)
                                                       sock->default_value;
-      BKE_LIB_FOREACHID_PROCESS(data, default_value->value, IDWALK_CB_USER);
+      BKE_LIB_FOREACHID_PROCESS(data, default_value->value, IDWALK_CB_NOP);
       break;
     }
     case SOCK_TEXTURE: {
diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc
index 5fa11ffdd10..516226c35ad 100644
--- a/source/blender/modifiers/intern/MOD_nodes.cc
+++ b/source/blender/modifiers/intern/MOD_nodes.cc
@@ -254,7 +254,7 @@ static void foreachIDLink(ModifierData *md, Object *ob, IDWalkFunc walk, void *u
       [](IDProperty *id_prop, void *user_data) {
         ForeachSettingData *settings = (ForeachSettingData *)user_data;
         settings->walk(
-            settings->userData, settings->ob, (ID **)&id_prop->data.pointer, IDWALK_CB_USER);
+            settings->userData, settings->ob, (ID **)&id_prop->data.pointer, IDWALK_CB_NOP);
       },
       &settings);
 }

Note, this only partially solves the issue, because the manual user counting for object/collection sockets would still have to be updated.

I'm not sure about what behavior I'd expect tbh. This bug is partially solved by the following diff. For some use cases it makes sense if the object would not be deleted though and when it is owned by the node group (e.g. when a node group asset "contains" an object). ``` diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc index e9608457896..ccb130f8704 100644 --- a/source/blender/blenkernel/intern/node.cc +++ b/source/blender/blenkernel/intern/node.cc @@ -282,7 +282,7 @@ static void library_foreach_node_socket(LibraryForeachIDData *data, bNodeSocket switch ((eNodeSocketDatatype)sock->type) { case SOCK_OBJECT: { bNodeSocketValueObject *default_value = (bNodeSocketValueObject *)sock->default_value; - BKE_LIB_FOREACHID_PROCESS(data, default_value->value, IDWALK_CB_USER); + BKE_LIB_FOREACHID_PROCESS(data, default_value->value, IDWALK_CB_NOP); break; } case SOCK_IMAGE: { @@ -293,7 +293,7 @@ static void library_foreach_node_socket(LibraryForeachIDData *data, bNodeSocket case SOCK_COLLECTION: { bNodeSocketValueCollection *default_value = (bNodeSocketValueCollection *) sock->default_value; - BKE_LIB_FOREACHID_PROCESS(data, default_value->value, IDWALK_CB_USER); + BKE_LIB_FOREACHID_PROCESS(data, default_value->value, IDWALK_CB_NOP); break; } case SOCK_TEXTURE: { diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc index 5fa11ffdd10..516226c35ad 100644 --- a/source/blender/modifiers/intern/MOD_nodes.cc +++ b/source/blender/modifiers/intern/MOD_nodes.cc @@ -254,7 +254,7 @@ static void foreachIDLink(ModifierData *md, Object *ob, IDWalkFunc walk, void *u [](IDProperty *id_prop, void *user_data) { ForeachSettingData *settings = (ForeachSettingData *)user_data; settings->walk( - settings->userData, settings->ob, (ID **)&id_prop->data.pointer, IDWALK_CB_USER); + settings->userData, settings->ob, (ID **)&id_prop->data.pointer, IDWALK_CB_NOP); }, &settings); } ``` Note, this only partially solves the issue, because the manual user counting for object/collection sockets would still have to be updated.
Member

Added subscriber: @HooglyBoogly

Added subscriber: @HooglyBoogly
Member

I also wouldn't necessarily call this a bug, since a node group owning an object seems like a valid situation. So personally I'd close this report-- we can change the behavior later on if we decide that's better.

I also wouldn't necessarily call this a bug, since a node group owning an object seems like a valid situation. So personally I'd close this report-- we can change the behavior later on if we decide that's better.
Member

Changed status from 'Confirmed' to: 'Archived'

Changed status from 'Confirmed' to: 'Archived'
Member

Since the expected behavior isn't obvious, I'm going to close this report. Maybe this behavior can be reconsidered as part of the fake user discussions (can't find the task right now though).

Since the expected behavior isn't obvious, I'm going to close this report. Maybe this behavior can be reconsidered as part of the fake user discussions (can't find the task right now though).
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
5 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#89735
No description provided.