Data Access (

This module is used for all Blender/Python access.

Access to Blender’s internal data

import bpy

# print all objects
for obj in

# print all scene names in a list

# remove mesh Cube
if "Cube" in
    mesh =["Cube"]
    print("removing mesh", mesh)

# write images into a file next to the blend
import os
with open(os.path.splitext([0] + ".txt", 'w') as fs:
    for image in
        fs.write("%s %d x %d\n" % (image.filepath, image.size[0], image.size[1]))