Page MenuHome

Baking an object's texture is effected by the 'Exclude' option for the first render layer in the Render Layers menu.
Closed, ResolvedPublic


System Information
Mac OS 10.10.1 - GTX580 - GTX560Ti

Blender Version
Broken: 2.72b 9e963ae
Worked: ?

Short description of error
Baking an object's texture is effected by the 'Exclude' option for the first render layer in the Render Layers menu. If the object being baked is on a layer that's being excluded, the resulting baked texture will be black.

Exact steps for others to reproduce the error

  • Unwrap default cube
  • Add material to cube
  • Create new image
  • Add image to cube material and have it selected in the node editor
  • Move the cube and light to layer 2
  • In the Render Layers menu, set 'Exclude' to 'on' for layer 2
  • Add another Render Layer, making sure that 2 is on for it.
  • Disable Render Layer 1
  • Select the cube
  • Click 'Bake'
  • The baking always takes the exclusion of Render Layer 1 into account when baking the texture.

I don't think the exclude options should have any effect on texture baking, let alone have an effect when the render layer has been disabled.

Here's a screencast of the bug:

Event Timeline

Julian Eisel (Severin) lowered the priority of this task from 90 to 30.Nov 24 2014, 5:48 PM

Hey @stephen thomas (stephenthomas0),
could you also append a .blend file, so we can easily reproduce the bug? This would help us to help you ;)

Sure, here you go:

Just hit bake and you should get a nice black texture (which should be red & blue). Turning off the 'Exclude' for layer 2 on Render Layer 1 will make it work again...

Mhh, I get a crash when pressing bake. I don't know the code base but maybe the issues have the same root.
@Dalai Felinto (dfelinto), got a failed kernel_assert. Error log:

/blender/intern/cycles/kernel/kernel_compat_cpu.h:51: T ccl::texture<T>::fetch(int) [with T = ccl::float4]: Assertion `index >= 0 && index < width' failed.
Julian Eisel (Severin) raised the priority of this task from 30 to Normal.Nov 24 2014, 6:21 PM

Yes, I got a crash when I tried to bake on the CPU, but GPU seems to work fine. Maybe the issues are related?

When I say "Seems to work fine", I mean that the bug I originally raised still happens, but Blender doesn't crash on the GPU when you try to bake.

@Julian Eisel (Severin) I believe this is a duplicate of T40709 (which is in our todo list).
Now the crash would be something new. I'll see if I get that as well.

The crash only happens when there are zero objects in a (to be rendered) layer. It is still a bug (related to the T40709) but not something you would run into in a real production.

I ran into it on a real production, it's how I found it...

@Dalai Felinto (dfelinto), any chance you have some time left to look deeper into this? I could also do, shouldn't be a big challenge code-wise...

Oh, and just to be clear, we're talking about the crash, the original bug report is a duplicate

Okay had another quick look, printing out index and width shows that width stays 0 while index is > 0.
Mind investigating this @Dalai Felinto (dfelinto)? (Or maybe @Sergey Sharybin (sergey) is interested?)

Dalai Felinto (dfelinto) changed the task status from Unknown Status to Resolved.Mar 2 2017, 10:13 AM

This was fixed by rBefe78d82 - it now prevents baking from happening in those cases.