Sub topic 9
Selected to Active: choosing source and target objects
This chapter assumes you can work in the Shader Editor and the UV Editor. It also assumes you have a high-poly and a low-poly mesh with applied transforms and a clean UV layout, as set up in the earlier chapters. Here you will learn how Blender decides which object is the source of the detail and which is the target, and how to set that up without trial and error.
What Selected to Active does
A normal bake without Selected to Active captures the surface of one object and writes it into that same object's UV layout. That is useful for baking lighting, but it cannot transfer detail from a different mesh.
With Selected to Active enabled, Cycles uses two roles:
- Source objects are the selected objects that are not active. These are your high-poly meshes. Cycles shoots rays at them and records what it finds.
- Target object is the active object. This is your low-poly mesh. Its UV layout decides where each result lands in the image, and its material holds the image that receives the bake.
The roles come from selection state, not from names or the outliner order. Selected to Active has no concept of "high" and "low". It only looks at what is selected and which selected object is active.
Selecting in the right order
In the viewport, the order matters because the last object you select becomes active.
- Make sure you are in Object Mode.
- Click the high-poly object, or Shift-click several if the detail is split across parts.
- Shift-click the low-poly object last, so it becomes active. It shows a lighter outline than the other selected objects.
- In the Render Properties, open Bake and enable Selected to Active.
In the Outliner, Ctrl-click adds to the selection. Check the active object in the header of the Properties editor or by its brighter highlight in the Outliner before you bake.
Multiple source objects
You can select any number of high-poly objects. Cycles treats them together as one source surface. This suits assets sculpted in pieces, such as a body, a strap, and a buckle. All sources project onto the single target's UV layout, so the target must cover all that detail in one UV space.
Overlapping source pieces are a common problem. If two source objects occupy the same space, rays may hit either one, and the result can flicker or show duplicated detail. Remove hidden interior geometry from the sources, or separate the pieces.
What the target needs before baking
Selecting the right objects is necessary but not sufficient. The target also has to be ready to receive a result.
| Requirement | Why it matters |
|---|---|
| A material on the low-poly mesh | The bake writes into an image referenced by that material. |
| An Image Texture node in that material | This node holds the bake target image. |
| That Image Texture node set as active | Cycles writes to the active image node. Selecting the node in the Shader Editor makes it active. |
| A UV map without overlaps | Overlapping islands receive the same pixels, so details collide. |
| Visible and selectable objects | Hidden or unselectable objects are ignored as sources. |
If the target has several material slots, each material needs its own active Image Texture node. A material that lacks one produces an error about a missing active image, and the bake stops. Point all those nodes to the same image if you want one combined map.
The settings that depend on this setup
Once Selected to Active is on, the Bake panel shows extra options.
- Cage is off by default. With it off, Cycles pushes the target surface outward by Extrusion and shoots rays from there back toward the sources.
- Extrusion is the distance the target surface is pushed out along its normals to start rays.
- Max Ray Distance limits how far rays travel. A value of 0 means no limit.
The next chapter explains how to tune these values. For now, a small extrusion such as 0.02 and a max ray distance of 0 are a reasonable starting point for objects about one meter in size. Scale them to your asset.
Setting up the selection with Python
Scripting the selection removes the order-of-clicks problem. This script selects several sources, makes the target active, and checks the target before you bake. It does not run the bake itself.
import bpy
def prepare_selection(source_names, target_name):
if bpy.context.mode != 'OBJECT':
bpy.ops.object.mode_set(mode='OBJECT')
target = bpy.data.objects[target_name]
sources = [bpy.data.objects[n] for n in source_names]
bpy.ops.object.select_all(action='DESELECT')
for obj in sources:
if obj.hide_get() or obj.hide_viewport:
raise RuntimeError(f"{obj.name} is hidden and would be skipped")
obj.select_set(True)
target.select_set(True)
bpy.context.view_layer.objects.active = target
mat = target.active_material
if mat is None or not mat.use_nodes:
raise RuntimeError("Target needs a material that uses nodes")
active_node = mat.node_tree.nodes.active
if active_node is None or active_node.type != 'TEX_IMAGE':
raise RuntimeError("Make an Image Texture node active in the target material")
bpy.context.scene.render.bake.use_selected_to_active = True
return target, sources
prepare_selection(["Asset_high"], "Asset_low")Setting view_layer.objects.active is what makes the target active. Calling select_set(True) alone only selects the object.
Common errors
- The bake comes out blank or flat. The active object may be the high-poly mesh, so rays are projected onto the wrong UV layout. Reselect with the low-poly mesh last.
- An error about no active image. The target's Image Texture node exists but is not active. Click the node in the Shader Editor so it shows a white outline.
- Part of the detail is missing. The source object was hidden, excluded from the view layer, or not selected. Check the eye icon and the checkbox in the Outliner.
- The result changes between bakes. A modifier may be active on one of the objects. Selected to Active bakes from the evaluated mesh, which includes viewport-visible modifiers. Apply or disable modifiers that you do not want in the bake.
- The bake writes to the wrong image. More than one material slot is present, and the active slot's node is the one used. Check each slot.
Choosing between Selected to Active and a plain bake
Use Selected to Active when the detail lives in a different mesh from the one receiving the texture. This is the case for normal maps and ambient occlusion maps baked from a sculpt. Use a plain bake when the object is its own source, for example when baking lighting or a procedural texture into the object's own UVs.
Exercise
You selected your high-poly mesh and then your low-poly mesh, enabled Selected to Active, and baked. The result is blank, and the low-poly mesh shows no new detail. You find that the high-poly mesh was the active object. Which role did each object play, and what should you change?
Show answer
The high-poly mesh acted as the target, because the active object is always the target, and the low-poly mesh was treated as a source. Deselect everything, select the high-poly mesh, then Shift-click the low-poly mesh last so it becomes active. Confirm the low-poly material has an active Image Texture node, and bake again.