Nodes Object field still contains object after actual object is deleted #81712

Closed
opened 2020-10-14 20:15:46 +02:00 by Ivan Perevala · 13 comments

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce GTX 1050 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 456.55

Blender Version
Broken: version: 2.90.0, branch: master, commit date: 2020-08-31 11:26, hash: 0330d1af29
Worked: (newest version of Blender that worked as expected)

Short description of error
nodes_bug.png

Exact steps for others to reproduce the error

  • Exact steps needed to reproduce the issue:
    • Open default *.blend file or file bellow (in this case go to step 4)
    • Add any shading node which contains pointer to Object (for example, "Texture Coordinates" node)
    • Delete object you just selected
    • Check outliner object list and list of objects in node Object field. In node field object is still alive.

nodes_bug.blend

**System Information** Operating system: Windows-10-10.0.18362-SP0 64 Bits Graphics card: GeForce GTX 1050 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 456.55 **Blender Version** Broken: version: 2.90.0, branch: master, commit date: 2020-08-31 11:26, hash: `0330d1af29` Worked: (newest version of Blender that worked as expected) **Short description of error** ![nodes_bug.png](https://archive.blender.org/developer/F8990872/nodes_bug.png) **Exact steps for others to reproduce the error** * Exact steps needed to reproduce the issue: - Open default *.blend file or file bellow (in this case go to step 4) - Add any shading node which contains pointer to Object (for example, "Texture Coordinates" node) - Delete object you just selected - Check outliner object list and list of objects in node `Object` field. In node field object is still alive. [nodes_bug.blend](https://archive.blender.org/developer/F8990887/nodes_bug.blend)
Author

Added subscriber: @ivpe

Added subscriber: @ivpe
Author

Update: just to play with: after exact steps open blend file view mode in outliner and select deleted object. Than press NUM "." in the viewport and become confused much more.

Update: just to play with: after exact steps open blend file view mode in outliner and select deleted object. Than press NUM "." in the viewport and become confused much more.

Added subscribers: @Sergey, @mano-wii

Added subscribers: @Sergey, @mano-wii

Thanks for the report,

I can confirm and I agree that it is strange, but as that is a 'POINTER' property, this behavior is kind of expected :
What happens is that 'POINTER' properties add a reference to the object. They work almost like a Fake User.
So the object is not really deleted, it remains saved in the file until this reference is removed.

Perhaps this property could be of type 'STRING', so this problem would be solved since only the name would matter.

This feature was introduced in df07a25d
@Sergey, would changing the type of this property to 'STRING' be a good change?

Thanks for the report, I can confirm and I agree that it is strange, but as that is a `'POINTER'` property, this behavior is kind of expected :\ What happens is that `'POINTER'` properties add a reference to the object. They work almost like a `Fake User`. So the object is not really deleted, it remains saved in the file until this reference is removed. Perhaps this property could be of type `'STRING'`, so this problem would be solved since only the name would matter. This feature was introduced in df07a25d @Sergey, would changing the type of this property to `'STRING'` be a good change?
Author

@mano-wii thank you for quick answer! Actually, I think this bug may be much more deeper. I found it while trying to solve issues with my own project (#81662 ) while searching for BKE_libblock_unlink call stack. There Object* pointers behave in the same way as here, keeping deleted object pointer. And I think that same behaviour may be in much more other places. So I hope for more deeper solution than replacing pointer to name/also if I will have a bit more time, I will do it by myself (but currently all I can do - just report an issue;))

@mano-wii thank you for quick answer! Actually, I think this bug may be much more deeper. I found it while trying to solve issues with my own project ([#81662 ](https://developer.blender.org/T81662)) while searching for `BKE_libblock_unlink` call stack. There `Object*` pointers behave in the same way as here, keeping deleted object pointer. And I think that same behaviour may be in much more other places. So I hope for more deeper solution than replacing pointer to name/also if I will have a bit more time, I will do it by myself (but currently all I can do - just report an issue;))
Member

Added subscribers: @mont29, @lichtwerk

Added subscribers: @mont29, @lichtwerk
Member

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

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

@mano-wii: dont think changing this to a string would be good (breaks on renaming)

The deleted object will be removed from all scenes, collections, constraints usage on other objects, modifiers usage on other objects, ... more... but not materials on other objects.
Constraints and modifiers happens more or less automatically because these dont increase usercount - which means that when the object is deleted, it reaches zero users -- and will be gone completely.
I am a bit surprised that usage inside materials increases usercount, whereas usage inside constraints and modifiers doesnt.
If the usercount does not decrease for the material usage, the object does not reach zero users and thus will not be gone completely but kept instead.

This is probably a (design) question that @mont29 can answer best [but will confirm the behaviour for now -- even though this is probably by design]

Users can be checked with this snippet btw:

bpy.data.user_map(subset=(D.objects['Camera'], ))
@mano-wii: dont think changing this to a string would be good (breaks on renaming) The deleted object will be removed from all scenes, collections, constraints usage on other objects, modifiers usage on other objects, ... more... but not materials on other objects. Constraints and modifiers happens more or less automatically because these dont increase usercount - which means that when the object is deleted, it reaches zero users -- and will be gone completely. I am a bit surprised that usage inside materials increases usercount, whereas usage inside constraints and modifiers doesnt. If the usercount does not decrease for the material usage, the object does not reach zero users and thus will not be gone completely but kept instead. This is probably a (design) question that @mont29 can answer best [but will confirm the behaviour for now -- even though this is probably by design] Users can be checked with this snippet btw: ``` bpy.data.user_map(subset=(D.objects['Camera'], )) ```

Changed status from 'Confirmed' to: 'Archived'

Changed status from 'Confirmed' to: 'Archived'
Bastien Montagne self-assigned this 2020-10-15 11:16:32 +02:00

There is no bug here, if you want to fully nuke an object use shift-X (Delete Global) option.

There is no bug here, if you want to fully nuke an object use `shift-X` (Delete Global) option.
Member

In #81712#1034613, @mont29 wrote:
if you want to fully nuke an object use shift-X (Delete Global) option.

After all this time, I still wasnt aware of this one! Thx for the heads up!

> In #81712#1034613, @mont29 wrote: > if you want to fully nuke an object use `shift-X` (Delete Global) option. After all this time, I still wasnt aware of this one! Thx for the heads up!
Author

In #81712#1034613, @mont29 wrote:
There is no bug here, if you want to fully nuke an object use shift-X (Delete Global) option.

Yes, thats works!) I looked at documentation and (it was only just my own opinion) maybe it should be documented here?
https://docs.blender.org/manual/en/dev/scene_layout/object/editing/delete.html

> In #81712#1034613, @mont29 wrote: > There is no bug here, if you want to fully nuke an object use `shift-X` (Delete Global) option. Yes, thats works!) I looked at documentation and (it was only just my own opinion) maybe it should be documented here? https://docs.blender.org/manual/en/dev/scene_layout/object/editing/delete.html

In #81712#1034648, @ivpe wrote:

In #81712#1034613, @mont29 wrote:
There is no bug here, if you want to fully nuke an object use shift-X (Delete Global) option.

Yes, thats works!) I looked at documentation and (it was only just my own opinion) maybe it should be documented here?
https://docs.blender.org/manual/en/dev/scene_layout/object/editing/delete.html

Good point, done, thanks

> In #81712#1034648, @ivpe wrote: >> In #81712#1034613, @mont29 wrote: >> There is no bug here, if you want to fully nuke an object use `shift-X` (Delete Global) option. > > Yes, thats works!) I looked at documentation and (it was only just my own opinion) maybe it should be documented here? > https://docs.blender.org/manual/en/dev/scene_layout/object/editing/delete.html Good point, done, thanks
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#81712
No description provided.