Sub topic 3
The Active Object Versus the Selection
Prerequisites and the working model
This chapter assumes that you can navigate the 3D viewport, understand the X, Y, and Z axes, and work in Object Mode. You should also know how to select an object with the default left-click keymap.
In Blender, the selection is the complete set of objects currently marked for action. The active object is one particular object inside that selection. Blender uses the active object when an operation needs one object as its main subject.
A selected object usually has an orange outline. The active object usually has a yellow outline and a brighter origin point. The exact colors can change with the theme, so use the Outliner and the viewport together when identifying it.
| State | Meaning | Common effect |
|---|---|---|
| Selected | Included in the current set of objects | G, R, and S affect it |
| Active | The main object among the selected objects | Properties and object-specific operations use it |
| Neither | Not part of the current selection | Most object operations ignore it |
Selecting several objects
Click an object to replace the current selection and make that object active. Shift-click adds an unselected object or removes a selected object. When you add an object with Shift-click, that object becomes active.
For example:
- Click the Cube. The Cube is selected and active.
- Shift-click the Camera. Both objects are selected, and the Camera becomes active.
- Shift-click the Camera again. The Camera is deselected. If the Cube remains selected, Blender makes the Cube active.
The active object is important even when several objects are selected. Open the Item panel with N and inspect the transform values. The displayed location, rotation, and scale belong to the active object. The Properties editor also commonly shows data for the active object.
Use A to select all objects in the current view layer. Use Alt-A to deselect all objects. In some Blender keymap configurations, Alt-A may play or stop animation, so use the Select menu if the shortcut does not behave as expected.
Why the distinction matters
G, R, and S normally transform every selected object. If the Cube and Camera are selected, moving them moves both. The active object does not limit that transformation.
Other operations need a single reference object. For example, Ctrl-J joins selected mesh objects into the active mesh object. The active object's name and object data become the basis for the result. Similarly, copying modifiers or constraints often uses the active object as the source.
When you intend to run an object-specific command, confirm the active object first. A common error is selecting the correct group but leaving the wrong object active. The command then uses the wrong mesh, material context, or transform values.
Python view of the active object
Blender exposes the active object through the current view layer. This script prints its name and shows all selected objects:
import bpy
active = bpy.context.view_layer.objects.active
selected = bpy.context.selected_objects
print("Active:", active.name if active else "None")
print("Selected:", [obj.name for obj in selected])The active object must also be selected in normal Object Mode use. You can set both states explicitly:
import bpy
bpy.ops.object.select_all(action='DESELECT')
obj = bpy.data.objects.get("Cube")
if obj is not None:
obj.select_set(True)
bpy.context.view_layer.objects.active = objExercise
The Cube and Sphere are selected, but the Sphere is active. What happens when you press G, and which object supplies the main context for an object-specific operation?
Show answer
G moves both the Cube and Sphere. The Sphere supplies the main context because it is active.