Page MenuHome

Baking API: remove non-working baking to external image, also cleanup misleading error messages
Confirmed, NormalPublic

Description

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce RTX 3090/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.89

Blender Version
Broken: version: 2.92.0, branch: master, commit date: 2021-02-24 16:25, hash: rB02948a2cab44
Worked: (newest version of Blender that worked as expected)

Short description of error
When baking for example an AO map, on a mesh, with no materials. You'll get an error stating you can bake to an external file [which was never implemented fully]
So that means the API would need to be cleaned up [non-working external save_mode removed, warning-/error messages adjusted]

Exact steps for others to reproduce the error
Load new file,
go to bake tab
select ambient occlusion
Hit bake.
Notice error, It suggests to save to an external file. But there is no option to select an external file.

Related Objects

Event Timeline

Philipp Oeser (lichtwerk) changed the task status from Needs Triage to Needs Information from User.Mar 16 2021, 1:29 PM

Notice error, It suggests to save to an external file. But there is no option to select an external file

Cannot reproduce. I am getting the (expected)

No active image found in material "Material" (0) for object "Cube"

Please try to explain in more detail how your setup is (posting your example .blend file might help here)

Additionally having a model with multiple materials, apparently requires you to add an unconnected image node to all materials before allowing to bake.
This is a pretty confusing setup. And could likely be streamlined

This is indeed not ideal, but I assume this is already covered by T68925: Baking workflow revamp?

! In T86608#1130544, @Philipp Oeser (lichtwerk) wrote:
Please try to explain in more detail how your setup is (posting your example .blend file might help here)


go to bake tab, and hit bake. The error suggesting to save to an external file should appear.

This is indeed not ideal, but I assume this is already covered by T68925: Baking workflow revamp?

Ah it appears so. Let's focus on the initial issue i spotted

Philipp Oeser (lichtwerk) changed the task status from Needs Information from User to Needs Information from Developers.Mar 16 2021, 4:31 PM

Ah, get it now.
That message is indeed a bit misleading (I think), it is intended (originally) to work with baking to external files (for the py-API I suppose), see
https://docs.blender.org/api/master/bpy.ops.object.html#bpy.ops.object.bake

However, this looks like it has never been fully implemented? Doing something like

bpy.ops.object.bake(filepath="/tmp/bake.png", save_mode='EXTERNAL')

will indeed give that warning.

We have a comment here, stating:

/* XXX hack to force saving to always be internal. Whether (and how) to support
 * external saving will be addressed later */
if (bkr->save_mode == R_BAKE_SAVE_EXTERNAL) {
  bkr->save_mode = R_BAKE_SAVE_INTERNAL;
}

Would kindly ask @Dalai Felinto (dfelinto) to share the current state of this.

It was indeed never supported if I remember well. The fix in this case is to correct the warning only.

Dalai Felinto (dfelinto) changed the task status from Needs Information from Developers to Needs Triage.Mar 16 2021, 4:37 PM
Philipp Oeser (lichtwerk) changed the task status from Needs Triage to Confirmed.Mar 16 2021, 4:40 PM

OK, so that means the API would need to be cleaned up [non-working external save_mode removed, warning-/error messages adjusted]

Philipp Oeser (lichtwerk) renamed this task from baking image, no option to bake to external file, despite warning message suggesting it. to Baking API: remove non-working baking to external image, also cleanup misleading error messages.Mar 16 2021, 4:44 PM
Philipp Oeser (lichtwerk) updated the task description. (Show Details)