Giới Thiệu (Introduction)

Python is an interpreted, interactive, object-oriented programming language. It incorporates modules, exceptions, dynamic typing, very high-level dynamic data types, and classes. Python combines remarkable power with very clear syntax.

Python scripts are a versatile way to extend Blender functionality. Most areas of Blender can be scripted, including animation, rendering, import and export, object creation and automating repetitive tasks.

To interact with Blender, scripts can make use of the tightly integrated API.

Thông Tin Chung (General Information)

Links that are useful while writing scripts:

  • Python.org -- Thông Tin Chung về Python.

  • Blender Python API -- Official API documentation. Use this for referencing while writing scripts.

  • API Introduction -- A short introduction to get you started with the API. Contains examples.

Links that deal with distributing your scripts:

  • Sharing scripts -- Information on how to share your scripts and get them included in the official Blender distribution.

  • Creating Add-ons -- Add-ons are used to encapsulate and distribute scripts.

  • Add-ons project -- Project to maintain a central repository of extensions to Blender.

Khởi Đầu (Getting Started)

Những kết nối trong Bản Hướng Dẫn Sử Dụng (Manual links)

The following links take you from the basics to the more advanced concepts of Python scripting for Blender.

Liên kết ngoài (External links)

Here are external links containing a lot of good information to start learning how to write scripts for Blender:

Nới Rộng Chức Năng của Blender (Extending Blender)

Trình Bổ Sung (Add-ons)

Add-ons are scripts that enable Blender to gain extra functionality; they can be enabled from the Preferences.

Outside of the Blender executable, there are hundreds of add-ons written by many people:

  • Officially supported add-ons are bundled with Blender.

  • Other Testing add-ons are included in development builds of Blender but not official releases. Many of them work reliably and are very useful but are not yet ensured to be stable for release.

Xem thêm

See Trình Bổ Sung (Add-ons) for documentation on add-ons included with Blender.

Tập Lệnh (Scripts)

Apart from add-ons, there are several other types of scripts that extend Blender's functionality:

Mô-Đun (Modules)

Utility libraries for import into other scripts.

Sắp Đặt Sẵn (Presets)

Settings for Blender's tools and key configurations.

Khởi Động (Startup)

These files are imported when starting Blender. They define most of Blender's UI, as well as some additional core operators.

Tập Lệnh Tùy Chỉnh (Custom Scripts)

In contrast to add-ons, they are typically intended for one-time execution via the Text Editor.

Lưu các Tập Lệnh của riêng mình (Saving your own Scripts)

Địa Điểm Tập Tin (File Location)

All scripts are loaded from the scripts folder of the local, system and user paths.

You can setup an additional search path for scripts in Đường Dẫn Tập Tin (File Paths) Preferences ‣ File Paths.

Cài Đặt (Installation)

Add-ons are conveniently installed through Blender in the Preferences. Click the Install... button and select the .py or .zip file.

To manually install scripts or add-ons, place them in the addons, modules, presets, or startup directory according to their type. See the description above.

You can also run scripts by loading them in the Text Editor.