Sub topic 2
Moving, Rotating, and Scaling with G, R, and S
This chapter assumes Blender with the default keymap, basic viewport navigation, and the X, Y, and Z axes. Blender sends keys to the area under the mouse pointer, so hover over the 3D viewport before you press a key.
Core transform keys
Select an object, then press one key:
- G moves the object (grab).
- R rotates it.
- S scales it.
Move the mouse to change the value, then left-click to confirm. Press Esc or right-click to cancel and restore the original state.
Constraining a transform to an axis or plane
After you press G, R, or S, press X, Y, or Z to limit the transform to that axis. Press the same axis key a second time to use the object's local axes instead of the global axes. To constrain to a plane, press Shift plus an axis key to exclude that axis. For example, Shift+Z after G moves the object only in the X and Y directions.
Typing exact values
Typed numbers give exact results. Press G, then X, type 2, and press Enter. The object moves 2 units along X. To rotate 45 degrees around Z, press R, Z, type 45, and press Enter. Blender reads typed rotation values in degrees. Press Backspace to correct a typed value.
import bpy
import math
obj = bpy.context.active_object
obj.location.x += 2.0
obj.rotation_euler.z += math.radians(45)
obj.scale *= 2.0Using the gizmos and toolbar tools
Blender draws transform gizmos on the selected object: arrows for moving, rings for rotating, and boxes for scaling. Drag an arrow to constrain the move to that axis, or drag the center to move freely. The toolbar on the left holds the same tools. In the default keymap, the toolbar tools use W, E, and R, which are different from the G, R, and S transform keys. You can show or hide gizmos from the viewport header.
Exercise
Select a cube at location (0, 0, 0). Which keys and typed values move it exactly 3 units along the Y axis?
Show answer
Press G, then Y, type 3, and press Enter. The cube moves to (0, 3, 0).
Exercise
After pressing G, you press Shift+X. Which directions can the object move?
Show answer
Only the Y and Z directions. Shift+X excludes the X axis, so the move is constrained to the YZ plane.