Cycles destroys an existing texture image while baking to a new image #106146
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#106146
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 11
Graphics card: rtx 2070
Blender Version
Broken:
51bc44420b
Short description of error
Blender seems to destroy or empty an existing texture in a multi material setup while baking to a new image.
Exact steps for others to reproduce the error
load the attached file
select the BAKE material
select the BAKE image node
Render Props -> Bake ( it is already setup)
Pay attention to the viewport to see that one of the textures turn black, and the BAKE texture is still black
You can try variations as in putting the BAKE node in other materials however the result seems to be the same failed bake.
System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 531.18
Blender Version
Broken: version: 3.6.0 Alpha, branch: main, commit date: 2023-03-24 22:22, hash:
51bc44420b89
Worked: None as far as I know.
I can confirm that this bug shows up on my computer as well.
The model has multiple materials assigned to it (assigned to different faces). It seems that cycles is not understanding that the target bake image is the selected image in the active material. Instead, cycles is also baking to the SOURCE images
The issue is fixed by copy pasting the target image (BAKE) into all materials and making sure that image node is the active node in each material.
I get this issue on Blender 3.2 so it seems to be an old bug that hasn't been discovered yet.
Cycles destroys and existing texture image while baking to a new imageto Cycles destroys an existing texture image while baking to a new image@DanielBystedt thanks for testing it out. I actually hit this bug long time ago but I kept going around it and using object to object bake to get what I need. I just ran out of patience this time and I felt like this needed real attention. Like you pointed out, Cycles does not seem to understand the multi material structure properly and its internal assumptions about what is what when it comes to the target bake node breaks down.
It is interesting that it destroys one of the source images in the source materials. That is peculiar because no source images are selected in those materials, and it does not seem to destroy all, only one of the images is cleared out during bake.
Stopping by here and asking myself: "there are situations where you want to bake to multiple images in multiple materials, no?" I think if we restrict baking to just the active image in the active material, we loose the ability to quickly do this?
The code clearly goes over all materials and gets the respective active image from that.
Now, how can we exclude a particular image from being baked to? How can it not be the active image? As you already noticed, there needs to be another image that was made active, you cannot just deselect the node and expect it to not be active anymore.
This is truly an issue, this is also true for syncing between the node editor and the image editor.
One way to improve this situation is to make "changing the active image canvas in the node editor" an explicit obvious action, see proposal in #103636. This way, it would be more clear which image is baked to (and hopefully we can have a way to not have any active image -- will ask about this again in #103636).
Do you think this would solve the issue here?