Visual glitches when undo after reload multiple images by script (in Material Preview) #76989
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
7 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#76989
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: Windows 10 1909
Graphics card: Radeon RX 570
Blender Version
Broken: 2.90.0 Alpha, branch: arcpatch-D7884, commit date: 2020-06-15 14:16, hash:
81fcf23d7c
Worked: Probably never, 2.82 and earlier will crash, but that may be different bug.
Short description of error
So I'm currently making an add-on to support
Substance
, it will generate texture based on inputs and save them to disk, it will also generate material and assign texture generated before.However on Version 2.82a with Material Preview mode after update a property, the add-on generate the texture, and auto reload the images, the press
ctrl+z
, normally it would undo the property, but it either crashs directly withEXCEPTION_ACCESS_VIOLATION
, or ends up with a weird 3d preview. (below it's the normal one)The weird thing is that it doesn't crash(2.82) if I run blender with
blender_debug_log.cmd
Exact steps for others to reproduce the error
#76989.blend
Added subscriber: @xVanTuring
Forget to say, it seems to behavior a little normal on 2.83 beta. it does not crash, but weird preview might occur. (Hope the information is enough)
Added subscriber: @iss
Changed status from 'Needs Triage' to: 'Needs User Info'
The description of this report is quite vague.
Can you prepare a simple script in .blend file that you can run and undo that would cause crash? Goal is to minimize time it takes to confirm bug as well as for developer to debug and fix the issue.
Hey,I made a simple project now. so here I uploaded 2 file, the test.zip contains the test images in 1K reso. After unzip it, you might want to update the image texture node in material, and variable
image_dir
in script, it just reload the image from disk. After you run the script, simply check toToggle Option
, then redo/undo (just play around), it should crash. I also got a video with 3 times crashing. 2020-05-26 04-46-23.mkvtest.zip
dev13.blend
Changed status from 'Needs User Info' to: 'Needs Developer To Reproduce'
Blender 2.82a crash randomly when undo after reload multiple images by script (in Material Preview)to Visual glitches when undo after reload multiple images by script (in Material Preview)Changed status from 'Needs Developer To Reproduce' to: 'Confirmed'
Added subscribers: @mont29, @fclem
Better file with relative paths and textures in one zip.
#76989.zip
The issue comes from the UNDO system that seems to shuffle the Image Textures. (the data does not correspond to the original data but they seem intact)
This affects GPUTexture but also the imbuf since it affects the UVImage editor (which does not use GPUTextures).
This also comes with a memory leak with GPUTextures not freed. I could not locate where/why this happens.
@mont29 I'll leave it to you.
Cannot really reproduce this, besides a few memleaks that happen once in a while... Will double check how we deal with runtime gputexture thing, but besides that I cannot do much here unless I can reproduce it.
Added subscriber: @brecht
OK, so spent some more time investigating things and trying to understand what happens, with little success since I cannot even reliably reproduce any issue. But I think we might face one or both of following issues while trying to re-use runtime caches:
Not sure how #1 could happen, since both cache freeing and re-generation on-demand from draw code should happen in main thread, i.e. in a consistent order?
2 Is also quiet difficult to follow, but since issue happen after repetitive cache freeing (triggered by the
reload()
RNA code): different caches being re-allocated at the same memory address as another one from a previous undo step.But before losing more time on that wild goose chase, I'd like to hear from @brecht about that radical solution: since with new undo we re-use fully unchanged datablocks, can't we simply get fully rid of those
imamap
,movieclipmap
, etc. ? Yes, it means that in some cases we'd regenerate the caches when it would not be needed, but I would not expect many changes to image of movieclip IDs to not require a cache reload anyway? And it would seriously simply code in readfile.c. Because right now we end up with some kind of double layer of remapping, makes things really hard to follow...We can't get rid of
imamap
and similar. This is not only a cache, texture painted images and render results must be preserved.Then am moving this to known issues, as this is for sure going to be a huge pain to fully understand and fix, and might very well require a complete redesign of how we preserve those caches (as a reminder, we had to add the session uuid thing ti IDs to precisely address that pointer collision issue...).
This issue was referenced by
8e0f8bb3e1
Changed status from 'Confirmed' to: 'Resolved'