Combined Bake uses the wrong target image when there are multiple materials with image textures.
Closed, InvalidPublic


System Information
macOS 10.12.3 NVIDIA GeForce GT 755M 1024 MB

Blender Version
Broken: 2.78b 2017-02-03 16:54 hash 9cb21a1
Worked: ?

Short description of error
Blender does not seem to find the correct target image for a bake if there are multiple materials with image textures.

Exact steps for others to reproduce the error
A mesh with several materials assigned, one per face.
Each material has an image texture.
An additional blank bake target image
Each material also has a second, unconnected image texture for that target bake, and that image texture is selected in each material.

Going to the render tab and clicking "Bake" (a combined bake) produces a circular dependency error from one of the image textures to the object, and the image texture in question is overwritten by the bake, even though each material has a second image texture for the bake, and that second target image texture is selected in each material.



I dug a little deeper, although the target images appeared to be the only thing selected in each material, when I went through each material and deselected everything with 'a' then selected the target, it works now.

So I think there may still be a bug in what blender is showing as selected within a material, but it's not quite the bug I reported.

Dalai Felinto (dfelinto) claimed this task.

The problem is that the active node of the materials is not the "Bake" image texture. You can see that if you look at the "properties" panel in the nodetree and see which node is shown there.

What I believe happened is that you were not "click" selecting the bake not but using a different selection method (e.g., border select). Which in turn doesn't change the active node, just the selection.

I'll close now. If you manage to reproduce this from scratch while using click select to pick the active node, feel free to re-report it (though as a nodetree bug, not as cycles bake).

Thanks for the report.