cli-anything-blender
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecli-anything-blender
cli-anything-blender
A stateful command-line interface for 3D scene editing, following the same patterns as the GIMP CLI harness. Uses a JSON scene description format with bpy script generation for actual Blender rendering.
一款遵循GIMP CLI框架模式的、用于3D场景编辑的有状态命令行界面。它采用JSON场景描述格式,并通过生成bpy脚本实现Blender的实际渲染。
Installation
安装
This CLI is installed as part of the cli-anything-blender package:
bash
pip install cli-anything-blenderPrerequisites:
- Python 3.10+
- blender (>= 4.2) must be installed on your system
该CLI作为cli-anything-blender包的一部分进行安装:
bash
pip install cli-anything-blender前提条件:
- Python 3.10及以上版本
- 系统中必须安装Blender(版本≥4.2)
Usage
使用方法
Basic Commands
基础命令
bash
undefinedbash
undefinedShow help
显示帮助信息
cli-anything-blender --help
cli-anything-blender --help
Start interactive REPL mode
启动交互式REPL模式
cli-anything-blender
cli-anything-blender
Create a new project
创建新项目
cli-anything-blender project new -o project.json
cli-anything-blender project new -o project.json
Run with JSON output (for agent consumption)
以JSON格式输出(供Agent使用)
cli-anything-blender --json project info -p project.json
undefinedcli-anything-blender --json project info -p project.json
undefinedREPL Mode
REPL模式
When invoked without a subcommand, the CLI enters an interactive REPL session:
bash
cli-anything-blender当不指定子命令调用时,CLI会进入交互式REPL会话:
bash
cli-anything-blenderEnter commands interactively with tab-completion and history
以交互式方式输入命令,支持标签补全和历史记录
undefinedundefinedCommand Groups
命令组
Scene
场景
Scene management commands.
| Command | Description |
|---|---|
| Create a new scene |
| Open an existing scene |
| Save the current scene |
| Show scene information |
| List available scene profiles |
| Print raw scene JSON |
场景管理命令。
| 命令 | 描述 |
|---|---|
| 创建新场景 |
| 打开现有场景 |
| 保存当前场景 |
| 显示场景信息 |
| 列出可用的场景配置文件 |
| 打印原始场景JSON数据 |
Object Group
对象组
3D object management commands.
| Command | Description |
|---|---|
| Add a 3D primitive object |
| Remove an object by index |
| Duplicate an object |
| Transform an object (translate, rotate, scale) |
| Set an object property (name, visible, location, rotation, scale, parent) |
| List all objects |
| Get detailed info about an object |
3D对象管理命令。
| 命令 | 描述 |
|---|---|
| 添加3D基础几何体对象 |
| 通过索引删除对象 |
| 复制对象 |
| 变换对象(平移、旋转、缩放) |
| 设置对象属性(名称、可见性、位置、旋转、缩放、父对象) |
| 列出所有对象 |
| 获取对象的详细信息 |
Material
材质
Material management commands.
| Command | Description |
|---|---|
| Create a new material |
| Assign a material to an object |
| Set a material property (color, metallic, roughness, specular, alpha, etc.) |
| List all materials |
| Get detailed info about a material |
材质管理命令。
| 命令 | 描述 |
|---|---|
| 创建新材质 |
| 为对象分配材质 |
| 设置材质属性(颜色、金属度、粗糙度、高光、透明度等) |
| 列出所有材质 |
| 获取材质的详细信息 |
Modifier Group
修改器组
Modifier management commands.
| Command | Description |
|---|---|
| List all available modifiers |
| Show details about a modifier |
| Add a modifier to an object |
| Remove a modifier by index |
| Set a modifier parameter |
| List modifiers on an object |
修改器管理命令。
| 命令 | 描述 |
|---|---|
| 列出所有可用的修改器 |
| 显示修改器的详细信息 |
| 为对象添加修改器 |
| 通过索引删除修改器 |
| 设置修改器参数 |
| 列出对象上的所有修改器 |
Camera
相机
Camera management commands.
| Command | Description |
|---|---|
| Add a camera to the scene |
| Set a camera property |
| Set the active camera |
| List all cameras |
相机管理命令。
| 命令 | 描述 |
|---|---|
| 向场景中添加相机 |
| 设置相机属性 |
| 设置激活相机 |
| 列出所有相机 |
Light
灯光
Light management commands.
| Command | Description |
|---|---|
| Add a light to the scene |
| Set a light property |
| List all lights |
灯光管理命令。
| 命令 | 描述 |
|---|---|
| 向场景中添加灯光 |
| 设置灯光属性 |
| 列出所有灯光 |
Animation
动画
Animation and keyframe commands.
| Command | Description |
|---|---|
| Set a keyframe on an object |
| Remove a keyframe from an object |
| Set the animation frame range |
| Set the animation FPS |
| List keyframes for an object |
动画与关键帧命令。
| 命令 | 描述 |
|---|---|
| 为对象设置关键帧 |
| 从对象中删除关键帧 |
| 设置动画帧范围 |
| 设置动画帧率(FPS) |
| 列出对象的所有关键帧 |
Render Group
渲染组
Render settings and output commands.
| Command | Description |
|---|---|
| Configure render settings |
| Show current render settings |
| List available render presets |
| Render the scene (generates bpy script) |
| Generate bpy script without rendering |
渲染设置与输出命令。
| 命令 | 描述 |
|---|---|
| 配置渲染设置 |
| 显示当前渲染设置 |
| 列出可用的渲染预设 |
| 渲染场景(生成bpy脚本) |
| 生成bpy脚本但不执行渲染 |
Session
会话
Session management commands.
| Command | Description |
|---|---|
| Show session status |
| Undo the last operation |
| Redo the last undone operation |
| Show undo history |
会话管理命令。
| 命令 | 描述 |
|---|---|
| 显示会话状态 |
| 撤销上一步操作 |
| 重做上一步撤销的操作 |
| 显示撤销历史记录 |
Examples
示例
Create a New Project
创建新项目
Create a new blender project file.
bash
cli-anything-blender project new -o myproject.json创建新的Blender项目文件。
bash
cli-anything-blender project new -o myproject.jsonOr with JSON output for programmatic use
或以JSON格式输出供程序化调用
cli-anything-blender --json project new -o myproject.json
undefinedcli-anything-blender --json project new -o myproject.json
undefinedInteractive REPL Session
交互式REPL会话
Start an interactive session with undo/redo support.
bash
cli-anything-blender启动支持撤销/重做的交互式会话。
bash
cli-anything-blenderEnter commands interactively
交互式输入命令
Use 'help' to see available commands
使用'help'查看可用命令
Use 'undo' and 'redo' for history navigation
使用'undo'和'redo'进行历史记录导航
undefinedundefinedState Management
状态管理
The CLI maintains session state with:
- Undo/Redo: Up to 50 levels of history
- Project persistence: Save/load project state as JSON
- Session tracking: Track modifications and changes
该CLI通过以下方式维护会话状态:
- 撤销/重做:最多支持50级历史记录
- 项目持久化:以JSON格式保存/加载项目状态
- 会话跟踪:跟踪所有修改与变更
Output Formats
输出格式
All commands support dual output modes:
- Human-readable (default): Tables, colors, formatted text
- Machine-readable (flag): Structured JSON for agent consumption
--json
bash
undefined所有命令支持两种输出模式:
- 人类可读格式(默认):表格、彩色文本、格式化内容
- 机器可读格式(参数):结构化JSON格式,供Agent使用
--json
bash
undefinedHuman output
人类可读格式输出
cli-anything-blender project info -p project.json
cli-anything-blender project info -p project.json
JSON output for agents
供Agent使用的JSON格式输出
cli-anything-blender --json project info -p project.json
undefinedcli-anything-blender --json project info -p project.json
undefinedFor AI Agents
面向AI Agent的使用说明
When using this CLI programmatically:
- Always use flag for parseable output
--json - Check return codes - 0 for success, non-zero for errors
- Parse stderr for error messages on failure
- MANDATORY: Use absolute paths for all file operations (rendering, project files). Relative paths are prone to failure in background execution.
- Verify outputs exist after export operations
当以程序化方式使用该CLI时:
- 始终使用参数以获得可解析的输出
--json - 检查返回码——0表示成功,非0表示出错
- 解析stderr以获取失败时的错误信息
- 强制要求:所有文件操作(渲染、项目文件)使用绝对路径。相对路径在后台执行时容易失败。
- 导出操作后验证输出是否存在
More Information
更多信息
- Full documentation: See README.md in the package
- Test coverage: See TEST.md in the package
- Methodology: See HARNESS.md in the cli-anything-plugin
- 完整文档:查看包中的README.md
- 测试覆盖率:查看包中的TEST.md
- 实现方法:查看cli-anything-plugin中的HARNESS.md
Version
版本
1.0.0
1.0.0