Cloning materials with too smart ShaderNodeCustomGroup breaks user counters of both source and target nodes #72317
Labels
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#72317
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Linux-5.0.0-37-generic-x86_64-with-debian-buster-sid 64 Bits
Graphics card: GeForce GT 730/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 418.56
Blender Version
Broken: version: 2.82 (sub 4), branch: master, commit date: 2019-12-08 18:49, hash:
761111efb8
Worked: (optional)
Short description of error
Some of my shader nodes need to have separate node trees for each their copies.
It seems quite legal to do like this:
When the material is cloned (via
ops.material.new
), it makes the original tree.users == 0, and new tree.users == 2Source node becomes zombie and dies after reloading or orphan cleaning.
Target node becomes undead and cannot die because of zero users.
Exact steps for others to reproduce the error
blender --factory-startup --background --python test_op_mat_clone.py
test_op_mat_clone.py
Added subscriber: @qwiglydee
This comment was removed by @qwiglydee
Copying materials with custom nodes messes up users counters and may produce bogus orphaned and overused treesto Copying materials (or single-usering node groups) with custom nodes messes up users counters and may produce bogus orphaned and overused treesThis comment was removed by @qwiglydee
Added subscriber: @BYOB
Copying materials (or single-usering node groups) with custom nodes messes up users counters and may produce bogus orphaned and overused treesto Cloning materials with too smart ShaderNodeCustomGroup breaks user counters of both source and target nodesAdded subscriber: @JacquesLucke
Changed status from 'Needs Triage' to: 'Needs User Info'
Please redo your tests and properly store a reference to a node tree in a node as described in https://developer.blender.org/T72579#839420.
Added subscriber: @dfelinto
Changed status from 'Needs User Info' to: 'Archived'
No activity for more than a week. As per the tracker policy we assume the issue is gone and can be closed.
Thanks again for the report. If the problem persists please open a new report with the required information.
What is the policy, @dfelinto ?
Additional information is provided in referenced tasks.
The bug exists and it breakes and will break some shader add-ons.
Investigation is conducted, root cause of this and many other existing and potential bugs is discovered, fix is submitted, along with autotests.
What is a (more) proper way to help making blender better?
Do you have some kind of "fsck off, patches are not welcome" policy?
Added subscriber: @rjg
Changed status from 'Archived' to: 'Needs Triage'
@qwiglydee this is done more or less automatically for all open tickets that have the status
Needs Information from User
after a week without any activity. This is documented in the Triaging Playbook - No reply after a week . I guess this was unintentionally closed without checking the patches/progress and certainly your contributions are welcome.I'll reopen the task.
Oh. Ok.
Then I'll put retated information here to avoid any non-automated confusion.
According to my debugging, the bug occurs because python method
Node::copy
is called fromBKE_node_copy_ex
, while refcounter of nested nodetree is in inconsistent state, and reinitializingnode_tree
inside the method breakes it even further.The counters are corrected later in code of
BKE_id_copy_ex
, in the call ofBKE_library_foreach_ID_link
, after all material data is completely copied.Proposed fix D6484 moves the call to supposedly more appropriate place.
A test for this case is in D6420.
Added subscriber: @lichtwerk
Changed status from 'Needs Triage' to: 'Confirmed'
Can confirm.