Cycles bakes wrong material's property to texture. #70641

Closed
opened 2019-10-08 14:48:04 +02:00 by Balazs Oszvald · 5 comments

Operating system: Windows 10
Graphics card: NVidia GTX1060
Broken: 2.80 official but 2.81 Alpha (a856c5eccf) has the same issue

Cycles bakes wrong material's property to texture.

Take the default cube, assign a new material to any face (so that is has 2 materials, for example with different base color).
Create a texture node (the one to bake to) only in the second material's shader tree.
Now if you bake the diffuse color, it bakes the first material's color to the faces of the second material (other texture areas stay intact).

If you add extra materials it gets more weird as there are materials that are baked, others not and it swaps even more colors.
(Check the attached 2.80 .blend: hit bake to render blue and green colors to the places where yellow should appear. Copy the bake texture node to another material and bake again to have other strange result.)

If the bake texture node is added to each materials' shader tree, you get no issues (I expected this result with one simple bake texture added to any of the materials.)

It has the same issue if you select another material property (like roughness, etc.)

Seems like an indexing issue...

bake_issue.blend

Operating system: Windows 10 Graphics card: NVidia GTX1060 Broken: 2.80 official but 2.81 Alpha (a856c5eccffb) has the same issue Cycles bakes wrong material's property to texture. Take the default cube, assign a new material to any face (so that is has 2 materials, for example with different base color). Create a texture node (the one to bake to) only in the second material's shader tree. Now if you bake the diffuse color, it bakes the first material's color to the faces of the second material (other texture areas stay intact). If you add extra materials it gets more weird as there are materials that are baked, others not and it swaps even more colors. (Check the attached 2.80 .blend: hit bake to render blue and green colors to the places where yellow should appear. Copy the bake texture node to another material and bake again to have other strange result.) If the bake texture node is added to each materials' shader tree, you get no issues (I expected this result with one simple bake texture added to any of the materials.) It has the same issue if you select another material property (like roughness, etc.) Seems like an indexing issue... [bake_issue.blend](https://archive.blender.org/developer/F7796590/bake_issue.blend)
Author

Added subscriber: @BalazsOszvald

Added subscriber: @BalazsOszvald
Member

Added subscribers: @dfelinto, @lichtwerk

Added subscribers: @dfelinto, @lichtwerk
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Philipp Oeser self-assigned this 2019-10-09 09:58:58 +02:00
Member

While this might sound inconvenient, you need an active ImageTexture in every material, otherwise you end up with this "undefined" behavior.

Blender spits out this report (it quickly gets overwritten by other reports, so you can see it in the Info Editor)

No active image found in material slot (0) for object "Cube"
No active image found in material "Material" (1) for object "Cube"
No active image found in material "Material.001" (2) for object "Cube"

Like I said, this could be improved upon (there are also external Addons that can help here, look around on blenderartists.org for those), but would not consider this a bug atm.
https://wiki.blender.org/wiki/Reference/Not_a_bug

Will close this, but feel free to comment again if issues persist...
CC @dfelinto

While this might sound inconvenient, you need an active ImageTexture in **every** material, otherwise you end up with this "undefined" behavior. Blender spits out this report (it quickly gets overwritten by other reports, so you can see it in the Info Editor) ``` No active image found in material slot (0) for object "Cube" No active image found in material "Material" (1) for object "Cube" No active image found in material "Material.001" (2) for object "Cube" ``` Like I said, this could be improved upon (there are also external Addons that can help here, look around on blenderartists.org for those), but would not consider this a bug atm. https://wiki.blender.org/wiki/Reference/Not_a_bug Will close this, but feel free to comment again if issues persist... CC @dfelinto
Author

It is no problem if baking needs active textures in multiple materials (might be intended -> bake onlymaterials where the node is present), but still, if those are not there it should not bake other material's property?!

It is no problem if baking needs active textures in multiple materials (might be intended -> bake onlymaterials where the node is present), but still, if those are not there it should not bake other material's property?!
Sign in to join this conversation.
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
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#70641
No description provided.