Python tools in Blender

The Scripting layout

Blender has a handy “Scripting” layout ready for you, with

  • Info panel expanded to see what Python commands are being called when manipulating the interface
  • Text editor to write your scripts
  • Console to explore commands
  • And the panels we know from the “Default” layout: 3D View, Outliner and Properties

In the Menu, Help > Python API Reference will open a browser window pointing to the Blender Python API documentation. You want to keep this open at all time when scripting.

Accessing data

Some examples of how to navigate in Blender data from the console.

# With the default scene when starting Blender
for objects in
# Camera
# Cube
# Lamp
for object in
# <Vector (7.9362, -7.1326, 3.8174)>
# <Vector (0.0000, 0.0000, 0.0000)>
# <Vector (4.0762, 1.0055, 5.9039)>
for object in
# 7.93615198135376
# 0.0
# 4.076245307922363