Page MenuHome

Baking with Cycles using a custom cage always returns "No valid cage object"
Closed, ResolvedPublic

Description

System Information
Operating system: Win10 64
Graphics card: Quadro M5000

Blender Version
Broken: 2.80, 606223f6a61, blender2.8, 2018-12-07
Worked: 2.79b

Short description of error
Baking normals from a high resolution mesh to a low poly mesh using a custom cage always results in a "No valid cage object" error and nothing is baked. Same for baking diffuse texture.
I've been trying to do it from a scanned high resolution mesh that I can't provide, but I'm attaching a simple test scene that reproduces the issue.

Exact steps for others to reproduce the error


In the provided scene it should be as simple as pressing the Bake button at the bottom of the render tab as everything should be already selected.

The steps I followed are:
-Import high poly mesh (I created one for the test scene).
-Create low poly target object.
-Duplicate low poly mesh and fatten it to create a cage.
-Assign new Cycles material to low poly object.
-In the Image editor create new Image.
-In the Node editor create new Image Texture and assign the previously created Image to it.
-In the Bake section of the render options, select Normals from the dropdown menu and tick Selected to Active and Cage options.
-Set the cage object.
-Select the source mesh, then select the target mesh.
-Make sure the image texture node is selected in the Node editor.
-Press the Bake button and you should receive the error.

Details

Type
Bug

Event Timeline

Sebastian Parborg (zeddb) triaged this task as Confirmed priority.Fri, Dec 7, 10:40 AM

Don't know if it is you or Dalai I should assign this to @Brecht Van Lommel (brecht).

Super confirmed, and the issue is a bit more strange in fact. I made an example that works in 2.79[*]:

In 2.79 it works fine, and you can even bake Combined. In 2.80, however:

  1. The "cage" property shows red, and in fact it bakes as if it there was no cage.
  2. Once you set a cage, it indeed says no object.
  • - Tip for the task author, if the reported bug works in 2.79, it helps to have a file saved in 2.79 instead of 2.80 that works in both versions so we can quickly compare.

Investigation update: bpy.context.scene.render.bake.cage_object is correct (e.g., "MyCage"), however when you clear it and reassign to the cage object you get leading spaces (e.g., " MyCage").

Dalai Felinto (dfelinto) closed this task as Resolved.Fri, Dec 7, 1:46 PM

The original report is now fixed. Baking in 2.8 is still a bit strange/different when comparing to 2.7. That is a different issue than the reported one though.