Sub topic 3
Object Mode: working with whole objects
This chapter assumes you can open the default scene, move around the 3D Viewport, and select objects with the mouse. It covers what Object Mode changes, what it leaves alone, and how selection, transforms, and scripting behave in it. Edit Mode, mode switching, and workspaces get their own chapters.
What Object Mode is for
Object Mode is the default interaction mode. Every click, drag, and shortcut in it acts on whole objects. It never acts on the vertices, edges, or faces inside them.
Blender splits a scene item into two layers:
- The object is a container that holds placement and behavior: location, rotation, scale, parent, modifiers, constraints, visibility, and which collection it belongs to.
- The object data is the thing the container points to. For a mesh object, this is the mesh with its vertices, edges, and faces. Other object types point to a curve, a light, a camera, and so on.
Object Mode edits the container. Edit Mode edits the data. If you keep that division in mind, most of Blender's behavior becomes predictable.
flowchart LRBecause the diagram needs the required fence form, here is the correct one:
Selected versus active
Object Mode distinguishes two states that beginners often mix up.
- Selected objects are highlighted in orange. You can have any number of them.
- The active object is the one selected object shown in a lighter, yellowish outline. There is at most one.
The distinction matters because many operations read from the active object. The Properties editor shows the active object's modifiers, materials, and data. Parenting makes the active object the parent of the other selected objects. Entering Edit Mode starts from the active object.
Clicking an object selects it and makes it active. Shift-clicking adds to the selection, and the last object you Shift-click becomes active. Shift-clicking the active object again deselects it. After that, there may be no active object even though other objects are still selected.
A selected object can also be inactive and an active object can be unselected. Clicking in empty space deselects everything but usually keeps the active object. This is why the Properties editor can keep showing an object that looks unselected.
| State | Appearance | How many | Used for |
|---|---|---|---|
| Selected | Orange outline | Zero or more | Targets of transform, delete, duplicate |
| Active | Yellow-orange outline | Zero or one | Properties editor, parent target, Edit Mode entry |
| Unselected | No outline | Any | Not affected by operators |
Common Object Mode operations
These work on every selected object unless noted.
- Transform:
Gmoves,Rrotates,Sscales. AddX,Y, orZto constrain to an axis, and type a number for an exact value. - Add:
Shift+Aopens the Add menu. A new object is placed at the 3D cursor and becomes active. - Delete:
XorDelete. - Duplicate:
Shift+Dcopies the object and its mesh data, and starts a move.Alt+Dmakes a linked duplicate, which shares the same mesh data. Editing the mesh of one linked copy changes all of them. - Parent: select children first, then the intended parent last so it is active, then press
Ctrl+P. - Hide:
Hhides selected objects,Alt+Hreveals them. Hidden objects cannot be selected. - Join:
Ctrl+Jmerges the selected meshes into the active one.
The mode menu in the top-left of the 3D Viewport header shows the current mode. Tab toggles between Object Mode and Edit Mode, which the next chapters examine.
Transforms and the origin
Each object stores a location, rotation, and scale. The Properties editor shows them on the Object tab, and the viewport sidebar (N) shows them in the Item tab. These values describe where the object's origin sits in the world and how the object is turned and sized around it.
The origin is the small dot shown for each selected object. Rotating or scaling happens around a pivot, which by default is the median point of the selection. The pivot is chosen in the header and can be the origin of each object, the 3D cursor, or the active element.
Two details cause confusion:
- A moved object's mesh coordinates do not change. The vertices are stored relative to the origin, so moving the object only changes
location. The mesh data stays untouched. - Scale is a multiplier on the object, not a change to the mesh. A cube scaled to
(1, 1, 2)still has vertices at the original positions. Tools that depend on real dimensions, such as bevels, can then behave unevenly. Applying the scale (Ctrl+A) bakes it into the mesh. A later chapter treats applying transforms in detail.
Rotation uses Euler angles by default and the viewport sidebar shows degrees. Python stores them in radians, which matters in the scripts below.
Reading the Object Mode state with Python
Blender exposes the selected and active state through the view layer. The following script prints each selected object's name, type, mode, and location. It stays within what the API guarantees.
import bpy
view_layer = bpy.context.view_layer
active = view_layer.objects.active
print("Active:", active.name if active else None)
for obj in bpy.context.selected_objects:
print(obj.name, obj.type, obj.mode, tuple(obj.location))bpy.context.selected_objects only lists visible, selectable objects in the current view layer, which matches what you see in the viewport. When you run the script from the Text Editor, the context is the 3D Viewport's window, so the result is the same as the UI shows.
Changing selection and transforms with Python
Setting properties directly is more reliable than calling operators, because direct changes do not depend on the viewport context or on the current mode.
import math
import bpy
obj = bpy.context.active_object
if obj is not None:
obj.location.x += 1.0
obj.rotation_euler.z = math.radians(45.0)
obj.scale = (1.0, 1.0, 2.0)
print(obj.name, tuple(obj.location), tuple(obj.scale))To change which objects are selected, use the selection methods and the view layer. The bpy.ops.object.select_all operator needs a context where objects can be listed, and it works from the 3D Viewport or the Text Editor.
import bpy
name = "Cube"
target = bpy.data.objects.get(name)
if target is not None:
bpy.ops.object.select_all(action='DESELECT')
target.select_set(True)
bpy.context.view_layer.objects.active = target
print(target.select_get(), bpy.context.view_layer.objects.active.name)Note that select_set and select_get belong to the object but depend on the view layer. An object that is not in the current view layer, or is hidden, cannot be selected successfully.
Edge cases and common errors
- Operators that refuse to run. Many
bpy.ops.object.*operators have apollcheck. PressingXon an empty selection does nothing, and scripts getRuntimeError: Operator bpy.ops.object... poll() failed, context is incorrect. Check that an active object exists and that you are in Object Mode before you call an operator. - Locked transforms. The padlock icons next to location, rotation, and scale lock individual axes against interactive edits. Locks affect the tools, but a script writing
obj.location.xignores them. - Delta transforms. The Delta Transform panel adds an extra offset on top of the normal values. An object can sit away from
(0, 0, 0)even though its location reads zero. Check it when an object seems to be in the wrong place. - Parent inheritance. A child's displayed location is relative to its parent. If you parent after moving objects,
Ctrl+Pnormally keeps the child where it was by storing a parent inverse matrix. The numbers in the child can still look odd. - Linked duplicates. After
Alt+D, edits made to the mesh of one object appear on the other. If you wanted an independent copy, useShift+Dor make the data single-user from the Data tab. - Non-mesh objects. Cameras, lights, and empties also work in Object Mode and have transforms. They have no Edit Mode for mesh geometry, so
Tabbehaves differently for them.
Summary of the working model
Object Mode works on containers. Selection decides which containers an operation targets, and the active object decides which one the interface and some operators treat as the primary. Transforms change the container's placement, so the mesh data inside stays as it was. When you need to change the shape of a mesh, you leave Object Mode, which the next chapters explain.
Exercise
You select a Cube, then Shift-click a Sphere, then Shift-click the Cube again. Which objects are selected and which one is active? Then explain what pressing Ctrl+P does in that state.
Show answer
Shift-clicking an already selected object that is not active makes it active, so both the Cube and the Sphere remain selected and the Cube is active. Shift-clicking the active object again would deselect it. Pressing Ctrl+P opens the Parent menu and makes the active object, the Cube, the parent of the other selected object, the Sphere.
Exercise
A script sets obj.rotation_euler.z = 90 and the object spins far more than a quarter turn. What is wrong, and what is the fix?
Show answer
Python stores rotation in radians, not degrees, so 90 means about 14.3 turns. Use obj.rotation_euler.z = math.radians(90) after importing math.