- ✕This summary was generated using AI based on multiple online sources. To view the original source information, use the "Learn more" links.
Blender’s Python API (bpy) allows you to create, modify, and automate almost anything you can do in the UI — including generating objects, animations, and custom tools. You can run scripts directly inside Blender or from the command line.
Setting Up
Open Blender and switch to the Scripting workspace.
In the Text Editor, create a new script or open an existing .py file.
You can also use the Python Console for quick testing with auto-completion.
Creating Objects via Python
Here’s an example that generates a cube and applies transformations:
import bpy# Delete all existing objectsbpy.ops.object.select_all(action='SELECT')bpy.ops.object.delete(use_global=False)# Add a cubebpy.ops.mesh.primitive_cube_add(size=2, location=(0, 0, 0))cube = bpy.context.active_objectcube.name = "MyCube"# Move and scale the cubecube.location.z = 1cube.scale = (1.5, 1.5, 1.5)# Add a materialmat = bpy.data.materials.new(name="MyMaterial")mat.diffuse_color = (0.2, 0.6, 0.8, 1) # RGBAcube.data.materials.append(mat)Copied!✕Copy Quickstart - Blender Python API
Learn how to use the Blender Python API to edit data, create user interface, run tools, and access custom properties. This document covers the basics of data access, creation, removal, and context.
Blender Python API Guide for 3D Automation - PyTutorial
Jan 30, 2026 · Learn how to use the Blender Python API to automate 3D modeling, animation, and rendering tasks with practical Python scripting examples.
Using Python in Blender: For Beginners – Talstra Net
May 7, 2024 · Learn how to use Python to automate and customize your 3D projects in Blender. This tutorial covers the basics of Blender's Python API, creating and …
Blender & Python Scripting – Step-by-Step Guide | Coursera
In this course, you will learn Blender scripting with Python. You'll start by learning the basics of Python programming, setting up Blender, and understanding the Blender …
Tutorial - Python Scripting in Blender 3D - Peq42
Mar 2, 2025 · By following this tutorial, you should be able to start scripting in Blender with Python fairly easily. Remember that practice is key to becoming …
Mastering the Blender Python API: A Comprehensive Guide
Apr 2, 2025 · Whether you're a 3D artist looking to streamline repetitive workflows or a developer interested in creating new Blender add-ons, understanding the Blender Python API is essential.
Blender Python simple basics - YouTube
Beginner Blender Python Tutorial: Assigning materials to faces of a mesh (Part 1) 7K views
Learn Blender Python - Canopy Games
Familiarize yourself with Blender’s interface and core functionality. Understand the basics of Python scripting within Blender. Learn to write simple but powerful …
A Beginner's Guide to Blender Python Scripting
A Beginner's Guide to Blender Python Scripting Are you new to scripting and eager to create your own Blender add-on? In this tutorial, we will walk you through the basics of setting up your scripting …
Add-on Tutorial - Blender 5.1 Manual
This tutorial is designed to help technical artists or developers learn to extend Blender. An understanding of the basics of Python is expected for those working …
- People also ask