Wrong user counter on curves with shared material #61660
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#61660
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, 64bit, Debian Buster
Graphics card: GTX 1080
Blender Version
Broken:
1c3a098cc8
Worked: blender2.7
Short description of error
Cycles causes wrong user counter on a curves which are sharing same material.
Probably harmless, but rather annoying and causes confusion.
Exact steps for others to reproduce the error
Open attached file, hit F12.
The issue is caused by the way how Cycles works with the objects: it gets evaluated object and requests Mesh created from it. This is done using
BKE_mesh_new_from_object()
. This function places created mesh tobmain
, which makes it expected to be properly user-counted.However, due to the nature of the input datablock this doesn't quite work: input datablocks are outside of the database and are not user-counted. They can not be reliably user-counted since they are coming from a dependency graph, which is a sub-set of bmain (which makes it wrong to simply copy user counts), and we can't easily deduct number of users from relations either (there might be extra nodes between ID which uses something and that used ID). So, since this can't be done reliably, dependency graph doesn't user-count anything.
Proposed solution is to not do user counting on ID which are outside of
bmain
as well: P914: User counter fixshared_curve_material.blend
Added subscriber: @Sergey
Added subscribers: @brecht, @mont29
Side note: this file also shows a leak of bounding box: P915: Boundbox leak :(
Like, an icing on the cake :)
Re usercount of IDs outside of a Main, main library.c code already expects outside-of-main IDs to not do any refcounting (with things like
BLI_assert((flag & LIB_ID_CREATE_NO_MAIN) == 0 || (flag & LIB_ID_CREATE_NO_USER_REFCOUNT) != 0);
e.g.).So I think that this handling should actually be done by library_query code itself (i.e. removing
IDWALK_CB_USER
/IDWALK_CB_USER_ONE
from callback flags when processed ID is tagged withLIB_TAG_NO_MAIN
?@mont29, i am not really sure what exact you mean by
should actually be done by library_query code itself
.Thing is, you can not do it in one single place: the situation is such that datablock from bmain is referencing datablocks which are outside of it.
It might also be easier to talk patches language ;)
This issue was referenced by
5d58b7f073
Changed status from 'Open' to: 'Resolved'