← 返回
开发者工具 中文

Blender Bpy

Blender Python scripting via bpy API. Use for scene automation, procedural modeling, batch rendering, and object manipulation.
使用 bpy API 进行 Blender Python 脚本编程,实现场景自动化、程序化建模、批量渲染和物体操作。
flayzz
开发者工具 clawhub v1.0.0 1 版本 99911 Key: 无需
★ 0
Stars
📥 1,123
下载
💾 124
安装
1
版本
#latest

概述

Blender Python Automation (bpy)

Prerequisites

  • Blender must be installed and accessible from the CLI (blender --version).
  • Scripts run via: blender --background --python
  • For interactive use: connect via Blender's built-in Python console or the REST server addon.

Common Snippets

Create an object

import bpy
bpy.ops.mesh.primitive_cube_add(location=(0, 0, 0))
obj = bpy.context.object
obj.name = "MyCube"

Batch render all frames

import bpy
scene = bpy.context.scene
scene.render.filepath = "//renders/frame_"
bpy.ops.render.render(animation=True)

Apply a material by name

import bpy
mat = bpy.data.materials.get("MyMaterial")
if mat is None:
    mat = bpy.data.materials.new(name="MyMaterial")
obj = bpy.context.object
if obj.data.materials:
    obj.data.materials[0] = mat
else:
    obj.data.materials.append(mat)

Tips

  • Always use --background when running headless (no UI).
  • Use bpy.data (global access) vs bpy.context (active selection) correctly.
  • For long renders, consider Cron jobs in OpenClaw so main chat isn't blocked.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 12:36 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 666 📥 323,769
content-creation

Blender Mcp

flayzz
基于MCP的Blender高级桥接,支持场景查询、物体创建、材质应用及实时运行自定义BPY代码。
★ 2 📥 1,608
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 920 📥 185,720