image has numerous users when only 1 material actually is using it #42523
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#42523
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?
Window 8.1
Blender Version
Broken: 2.72b
9e963ae
I have an addon that adds siding and you can add materials to that siding with it. Some of the types of siding it adds a image texture to and if you generate the material multiple times and check how many users the image has it says a high number, when really only one material is using it. My code works by adding in an extra material and then using that material to replace the one on the object and then deleting the temporary one. So I don't know if it is just not updating that the material is deleted and not using that image anymore? Here is my code:
JARCH_siding.zip
Steps:
The part of code that adds the materials starts at line 1727
Changed status to: 'Open'
Added subscriber: @BlendingJake
Changed status from 'Open' to: 'Archived'
Materials never get deleted from the database when you create them unless you close blender - if you search for them in the material search field you will find them. To make sure your image does not have any users you have to basically remove all references of the image from the temporary material. But again creating so many materials looks like a bad idea, you might want to consider caching them.
This looks like working as intended and patch is more than 2000 lines and -sorry to say- written like a wall of text so it's quite hard to figure out what is happening. It would be good to have a few steps with a blend file where image leaking can be demonstrated.
Closing until a real leak can be shown.
@Psy-Fi
The thing is though that the material is being deleted. If you check bpy.data.materials the material is not there. Did you just run the code and see the issue? I understand that it is hard to read threw other peoples code and it is hard to simplify this down, as when you restart Blender the issue is gone, but to my understanding it shouldn't be holding onto it since the material is no longer listed.
Changed status from 'Archived' to: 'Open'
Reopening, confirmed. Materials seem to be deleted also
Added subscriber: @Psy-Fi
Thanks @Psy-Fi, I do hope to update my code, but this did seem to be a bug.
Added subscriber: @ideasman42
@ideasman42 I see this is caused by
916a58f4e
I don't have valgrind here to check for details but enabling with address sanitizer seems fine. Also if this is problematic on quit might be worth NULLing out the pointers first on exit or so?
Added subscriber: @Sergey
Well, user counters are only guaranteed to be correct after loading the file. Deleting datablocks might cause dangling users for until next save/reload. Making it so user counter is always correct is rather a huge topic and wouldn't really consider this is a bug.
Unless there are more issues here @Psy-Fi?
Changed status from 'Open' to: 'Archived'
No, that should be it.