Tests: Update bake tests for new selection requirements

Ref #137389

Pull Request: https://projects.blender.org/blender/blender/pulls/145502
This commit is contained in:
Brecht Van Lommel
2025-09-01 12:40:49 +02:00
committed by Brecht Van Lommel
parent f80083491a
commit 62eac6da17
2 changed files with 9 additions and 1 deletions

View File

@@ -566,7 +566,8 @@ static bool bake_object_check(const Scene *scene,
if (mat != nullptr) {
BKE_reportf(reports,
RPT_INFO,
"No active and selected image texture node found in material \"%s\" (%d) for object \"%s\"",
"No active and selected image texture node found in material \"%s\" (%d) "
"for object \"%s\"",
mat->id.name + 2,
i,
ob->id.name + 2);

View File

@@ -10,6 +10,13 @@ def bake(context):
cscene = scene.cycles
image = bpy.data.images["bake_result"]
# Make sure active texture node is selected as well, new requirement in 5.0.
for material in bpy.data.materials:
nodetree = material.node_tree
if nodetree:
for node in nodetree.nodes:
node.select = node.show_texture
if scene.render.bake.target == 'VERTEX_COLORS':
# Bake to the vertex group first, then bake to a image
#