blenderwright 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. blenderwright-2.0.0/.github/FUNDING.yml +1 -0
  2. blenderwright-2.0.0/.github/workflows/ci.yml +75 -0
  3. blenderwright-2.0.0/.github/workflows/pylint.yml +24 -0
  4. blenderwright-2.0.0/.github/workflows/release.yml +71 -0
  5. blenderwright-2.0.0/.github/workflows/test-bpy51.yml +32 -0
  6. blenderwright-2.0.0/.gitignore +31 -0
  7. blenderwright-2.0.0/LICENSE +21 -0
  8. blenderwright-2.0.0/PKG-INFO +386 -0
  9. blenderwright-2.0.0/README.md +368 -0
  10. blenderwright-2.0.0/addon/__init__.py +129 -0
  11. blenderwright-2.0.0/addon/blender_manifest.toml +26 -0
  12. blenderwright-2.0.0/addon/dispatcher.py +49 -0
  13. blenderwright-2.0.0/addon/handlers/__init__.py +75 -0
  14. blenderwright-2.0.0/addon/handlers/animation.py +210 -0
  15. blenderwright-2.0.0/addon/handlers/armature.py +329 -0
  16. blenderwright-2.0.0/addon/handlers/booltool.py +146 -0
  17. blenderwright-2.0.0/addon/handlers/camera.py +348 -0
  18. blenderwright-2.0.0/addon/handlers/code_exec.py +101 -0
  19. blenderwright-2.0.0/addon/handlers/collections.py +176 -0
  20. blenderwright-2.0.0/addon/handlers/curves.py +342 -0
  21. blenderwright-2.0.0/addon/handlers/file_ops.py +204 -0
  22. blenderwright-2.0.0/addon/handlers/geometry_nodes.py +276 -0
  23. blenderwright-2.0.0/addon/handlers/gpencil.py +153 -0
  24. blenderwright-2.0.0/addon/handlers/lighting.py +311 -0
  25. blenderwright-2.0.0/addon/handlers/materials.py +712 -0
  26. blenderwright-2.0.0/addon/handlers/mesh_editing.py +338 -0
  27. blenderwright-2.0.0/addon/handlers/mesh_quality.py +159 -0
  28. blenderwright-2.0.0/addon/handlers/modeling.py +400 -0
  29. blenderwright-2.0.0/addon/handlers/objects.py +625 -0
  30. blenderwright-2.0.0/addon/handlers/physics.py +448 -0
  31. blenderwright-2.0.0/addon/handlers/print3d.py +177 -0
  32. blenderwright-2.0.0/addon/handlers/procedural.py +465 -0
  33. blenderwright-2.0.0/addon/handlers/raster.py +194 -0
  34. blenderwright-2.0.0/addon/handlers/rendering.py +167 -0
  35. blenderwright-2.0.0/addon/handlers/scene.py +199 -0
  36. blenderwright-2.0.0/addon/handlers/sculpting.py +336 -0
  37. blenderwright-2.0.0/addon/handlers/selection.py +221 -0
  38. blenderwright-2.0.0/addon/handlers/sweep.py +417 -0
  39. blenderwright-2.0.0/addon/handlers/transforms.py +195 -0
  40. blenderwright-2.0.0/addon/handlers/uv.py +181 -0
  41. blenderwright-2.0.0/addon/handlers/viewport.py +123 -0
  42. blenderwright-2.0.0/addon/render_guard.py +49 -0
  43. blenderwright-2.0.0/addon/server.py +221 -0
  44. blenderwright-2.0.0/addon/thread_safety.py +90 -0
  45. blenderwright-2.0.0/addon/ui_panel.py +78 -0
  46. blenderwright-2.0.0/blend-ai-v1.0.0.zip +0 -0
  47. blenderwright-2.0.0/build.ps1 +74 -0
  48. blenderwright-2.0.0/build.sh +48 -0
  49. blenderwright-2.0.0/docs/.nojekyll +0 -0
  50. blenderwright-2.0.0/docs/CNAME +1 -0
  51. blenderwright-2.0.0/docs/googled2f6c71abc2d6a7b.html +1 -0
  52. blenderwright-2.0.0/docs/index.html +1063 -0
  53. blenderwright-2.0.0/docs/robots.txt +3 -0
  54. blenderwright-2.0.0/docs/sitemap.xml +4 -0
  55. blenderwright-2.0.0/install-addon.sh +11 -0
  56. blenderwright-2.0.0/install_addon.py +612 -0
  57. blenderwright-2.0.0/launch_ollama.sh +10 -0
  58. blenderwright-2.0.0/pyproject.toml +57 -0
  59. blenderwright-2.0.0/saloon.png +0 -0
  60. blenderwright-2.0.0/screenshot.png +0 -0
  61. blenderwright-2.0.0/scripts/generate_tool_docs.py +440 -0
  62. blenderwright-2.0.0/shader-preview.png +0 -0
  63. blenderwright-2.0.0/src/blenderwright/__init__.py +3 -0
  64. blenderwright-2.0.0/src/blenderwright/__main__.py +5 -0
  65. blenderwright-2.0.0/src/blenderwright/aliases.py +86 -0
  66. blenderwright-2.0.0/src/blenderwright/connection.py +179 -0
  67. blenderwright-2.0.0/src/blenderwright/enum_hints.py +118 -0
  68. blenderwright-2.0.0/src/blenderwright/ollama_chat.py +651 -0
  69. blenderwright-2.0.0/src/blenderwright/prompts/__init__.py +1 -0
  70. blenderwright-2.0.0/src/blenderwright/prompts/workflows.py +330 -0
  71. blenderwright-2.0.0/src/blenderwright/resources/__init__.py +1 -0
  72. blenderwright-2.0.0/src/blenderwright/resources/scene_info.py +36 -0
  73. blenderwright-2.0.0/src/blenderwright/server.py +76 -0
  74. blenderwright-2.0.0/src/blenderwright/strict.py +34 -0
  75. blenderwright-2.0.0/src/blenderwright/tool_registry.py +156 -0
  76. blenderwright-2.0.0/src/blenderwright/tools/__init__.py +1 -0
  77. blenderwright-2.0.0/src/blenderwright/tools/animation.py +245 -0
  78. blenderwright-2.0.0/src/blenderwright/tools/armature.py +279 -0
  79. blenderwright-2.0.0/src/blenderwright/tools/booltool.py +116 -0
  80. blenderwright-2.0.0/src/blenderwright/tools/camera.py +222 -0
  81. blenderwright-2.0.0/src/blenderwright/tools/code_exec.py +31 -0
  82. blenderwright-2.0.0/src/blenderwright/tools/collections.py +123 -0
  83. blenderwright-2.0.0/src/blenderwright/tools/curves.py +339 -0
  84. blenderwright-2.0.0/src/blenderwright/tools/file_ops.py +153 -0
  85. blenderwright-2.0.0/src/blenderwright/tools/geometry_nodes.py +187 -0
  86. blenderwright-2.0.0/src/blenderwright/tools/gpencil.py +180 -0
  87. blenderwright-2.0.0/src/blenderwright/tools/lighting.py +239 -0
  88. blenderwright-2.0.0/src/blenderwright/tools/materials.py +1035 -0
  89. blenderwright-2.0.0/src/blenderwright/tools/mesh_editing.py +573 -0
  90. blenderwright-2.0.0/src/blenderwright/tools/mesh_quality.py +113 -0
  91. blenderwright-2.0.0/src/blenderwright/tools/modeling.py +455 -0
  92. blenderwright-2.0.0/src/blenderwright/tools/objects.py +508 -0
  93. blenderwright-2.0.0/src/blenderwright/tools/physics.py +318 -0
  94. blenderwright-2.0.0/src/blenderwright/tools/print3d.py +121 -0
  95. blenderwright-2.0.0/src/blenderwright/tools/rendering.py +205 -0
  96. blenderwright-2.0.0/src/blenderwright/tools/scene.py +204 -0
  97. blenderwright-2.0.0/src/blenderwright/tools/screenshot.py +52 -0
  98. blenderwright-2.0.0/src/blenderwright/tools/sculpting.py +234 -0
  99. blenderwright-2.0.0/src/blenderwright/tools/selection.py +238 -0
  100. blenderwright-2.0.0/src/blenderwright/tools/sweep.py +174 -0
  101. blenderwright-2.0.0/src/blenderwright/tools/transforms.py +185 -0
  102. blenderwright-2.0.0/src/blenderwright/tools/uv.py +133 -0
  103. blenderwright-2.0.0/src/blenderwright/tools/viewport.py +99 -0
  104. blenderwright-2.0.0/src/blenderwright/validators.py +217 -0
  105. blenderwright-2.0.0/tests/__init__.py +0 -0
  106. blenderwright-2.0.0/tests/conftest.py +25 -0
  107. blenderwright-2.0.0/tests/test_addon/__init__.py +0 -0
  108. blenderwright-2.0.0/tests/test_addon/conftest.py +11 -0
  109. blenderwright-2.0.0/tests/test_addon/test_dispatcher.py +122 -0
  110. blenderwright-2.0.0/tests/test_addon/test_handler_registration.py +69 -0
  111. blenderwright-2.0.0/tests/test_addon/test_handlers/__init__.py +0 -0
  112. blenderwright-2.0.0/tests/test_addon/test_handlers/test_camera_handler.py +298 -0
  113. blenderwright-2.0.0/tests/test_addon/test_handlers/test_code_exec_handler.py +189 -0
  114. blenderwright-2.0.0/tests/test_addon/test_handlers/test_gpencil_handler.py +205 -0
  115. blenderwright-2.0.0/tests/test_addon/test_handlers/test_materials_handler.py +483 -0
  116. blenderwright-2.0.0/tests/test_addon/test_handlers/test_mesh_quality_handler.py +439 -0
  117. blenderwright-2.0.0/tests/test_addon/test_handlers/test_modeling_handler.py +187 -0
  118. blenderwright-2.0.0/tests/test_addon/test_handlers/test_objects_handler.py +431 -0
  119. blenderwright-2.0.0/tests/test_addon/test_handlers/test_print3d_handler.py +259 -0
  120. blenderwright-2.0.0/tests/test_addon/test_handlers/test_procedural_handler.py +649 -0
  121. blenderwright-2.0.0/tests/test_addon/test_handlers/test_raster_handler.py +376 -0
  122. blenderwright-2.0.0/tests/test_addon/test_handlers/test_rendering_handler.py +145 -0
  123. blenderwright-2.0.0/tests/test_addon/test_handlers/test_scene_handler.py +110 -0
  124. blenderwright-2.0.0/tests/test_addon/test_handlers/test_sculpting_handler.py +171 -0
  125. blenderwright-2.0.0/tests/test_addon/test_handlers/test_selection_handler.py +90 -0
  126. blenderwright-2.0.0/tests/test_addon/test_handlers/test_sweep_handler.py +253 -0
  127. blenderwright-2.0.0/tests/test_addon/test_layer_consistency.py +193 -0
  128. blenderwright-2.0.0/tests/test_addon/test_module_cache_purge.py +157 -0
  129. blenderwright-2.0.0/tests/test_addon/test_render_guard.py +98 -0
  130. blenderwright-2.0.0/tests/test_addon/test_server.py +152 -0
  131. blenderwright-2.0.0/tests/test_addon/test_ui_panel.py +60 -0
  132. blenderwright-2.0.0/tests/test_command_registry.py +153 -0
  133. blenderwright-2.0.0/tests/test_connection.py +233 -0
  134. blenderwright-2.0.0/tests/test_enum_hints.py +80 -0
  135. blenderwright-2.0.0/tests/test_installer.py +754 -0
  136. blenderwright-2.0.0/tests/test_object_param_naming.py +174 -0
  137. blenderwright-2.0.0/tests/test_ollama_chat.py +1029 -0
  138. blenderwright-2.0.0/tests/test_project_metadata.py +329 -0
  139. blenderwright-2.0.0/tests/test_strict_parameters.py +161 -0
  140. blenderwright-2.0.0/tests/test_tools/__init__.py +0 -0
  141. blenderwright-2.0.0/tests/test_tools/conftest.py +14 -0
  142. blenderwright-2.0.0/tests/test_tools/test_animation.py +229 -0
  143. blenderwright-2.0.0/tests/test_tools/test_armature.py +294 -0
  144. blenderwright-2.0.0/tests/test_tools/test_auto_critique_prompt.py +44 -0
  145. blenderwright-2.0.0/tests/test_tools/test_booltool.py +136 -0
  146. blenderwright-2.0.0/tests/test_tools/test_camera.py +215 -0
  147. blenderwright-2.0.0/tests/test_tools/test_code_exec.py +55 -0
  148. blenderwright-2.0.0/tests/test_tools/test_collections.py +155 -0
  149. blenderwright-2.0.0/tests/test_tools/test_curves.py +433 -0
  150. blenderwright-2.0.0/tests/test_tools/test_eevee_light_path.py +82 -0
  151. blenderwright-2.0.0/tests/test_tools/test_extensions.py +127 -0
  152. blenderwright-2.0.0/tests/test_tools/test_file_ops.py +191 -0
  153. blenderwright-2.0.0/tests/test_tools/test_geometry_nodes.py +200 -0
  154. blenderwright-2.0.0/tests/test_tools/test_gpencil.py +235 -0
  155. blenderwright-2.0.0/tests/test_tools/test_issue_31_validation.py +165 -0
  156. blenderwright-2.0.0/tests/test_tools/test_lighting.py +353 -0
  157. blenderwright-2.0.0/tests/test_tools/test_materials.py +583 -0
  158. blenderwright-2.0.0/tests/test_tools/test_mesh_editing.py +486 -0
  159. blenderwright-2.0.0/tests/test_tools/test_mesh_quality.py +70 -0
  160. blenderwright-2.0.0/tests/test_tools/test_mesh_repair.py +123 -0
  161. blenderwright-2.0.0/tests/test_tools/test_modeling.py +478 -0
  162. blenderwright-2.0.0/tests/test_tools/test_new_nodes.py +23 -0
  163. blenderwright-2.0.0/tests/test_tools/test_objects.py +596 -0
  164. blenderwright-2.0.0/tests/test_tools/test_physics.py +371 -0
  165. blenderwright-2.0.0/tests/test_tools/test_point_camera_at.py +65 -0
  166. blenderwright-2.0.0/tests/test_tools/test_print3d.py +111 -0
  167. blenderwright-2.0.0/tests/test_tools/test_procedural.py +221 -0
  168. blenderwright-2.0.0/tests/test_tools/test_prompts.py +148 -0
  169. blenderwright-2.0.0/tests/test_tools/test_raster.py +96 -0
  170. blenderwright-2.0.0/tests/test_tools/test_rendering.py +255 -0
  171. blenderwright-2.0.0/tests/test_tools/test_scene.py +178 -0
  172. blenderwright-2.0.0/tests/test_tools/test_screenshot.py +94 -0
  173. blenderwright-2.0.0/tests/test_tools/test_sculpting.py +301 -0
  174. blenderwright-2.0.0/tests/test_tools/test_selection.py +150 -0
  175. blenderwright-2.0.0/tests/test_tools/test_selection_respected.py +146 -0
  176. blenderwright-2.0.0/tests/test_tools/test_shader_nodes.py +404 -0
  177. blenderwright-2.0.0/tests/test_tools/test_sweep.py +163 -0
  178. blenderwright-2.0.0/tests/test_tools/test_transforms.py +235 -0
  179. blenderwright-2.0.0/tests/test_tools/test_uv.py +179 -0
  180. blenderwright-2.0.0/tests/test_tools/test_uv_slim.py +23 -0
  181. blenderwright-2.0.0/tests/test_tools/test_viewport.py +139 -0
  182. blenderwright-2.0.0/tests/test_validators.py +478 -0
  183. blenderwright-2.0.0/uv.lock +1085 -0
@@ -0,0 +1 @@
1
+ github: jabberwock
@@ -0,0 +1,75 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ lint:
11
+ name: Lint (ruff)
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: actions/setup-python@v5
16
+ with:
17
+ python-version: "3.11"
18
+ - run: pip install ruff==0.15.7
19
+ - run: ruff check .
20
+
21
+ security:
22
+ name: Security (bandit + pip-audit)
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+ - uses: actions/setup-python@v5
27
+ with:
28
+ python-version: "3.11"
29
+ - run: pip install bandit pip-audit
30
+ - name: Upgrade build tooling
31
+ # The runner image ships its own setuptools/pip. pip-audit reports
32
+ # vulnerabilities in those even though this project does not depend
33
+ # on them (the build backend is hatchling), so keep them current
34
+ # rather than let runner drift fail the build.
35
+ run: pip install --upgrade pip setuptools wheel
36
+ - name: bandit
37
+ run: bandit -r src/ -ll # low severity threshold; skip install_addon.py (subprocess by design)
38
+ - name: Install project dependencies
39
+ run: pip install -e ".[dev]"
40
+ - name: pip-audit
41
+ # Audits the environment, which now contains this project's declared
42
+ # dependencies. The upgrade step above keeps the runner's own build
43
+ # tooling current so drift in the image does not fail the build.
44
+ run: pip-audit
45
+
46
+ tests:
47
+ name: Tests (${{ matrix.os }} / Python ${{ matrix.python-version }})
48
+ runs-on: ${{ matrix.os }}
49
+ strategy:
50
+ fail-fast: false
51
+ matrix:
52
+ os: [ubuntu-latest, macos-latest, windows-latest]
53
+ python-version: ["3.11", "3.13"]
54
+ steps:
55
+ - uses: actions/checkout@v4
56
+ - uses: actions/setup-python@v5
57
+ with:
58
+ python-version: ${{ matrix.python-version }}
59
+ - name: Install dependencies
60
+ run: pip install -e ".[dev]"
61
+ - name: Run tests
62
+ run: pytest tests/ -v --tb=short --ignore=tests/test_addon
63
+
64
+ coverage:
65
+ name: Tests + Coverage
66
+ runs-on: ubuntu-latest
67
+ steps:
68
+ - uses: actions/checkout@v4
69
+ - uses: actions/setup-python@v5
70
+ with:
71
+ python-version: "3.11"
72
+ - name: Install dependencies
73
+ run: pip install -e ".[dev]"
74
+ - name: Run tests with coverage
75
+ run: pytest tests/ --cov=src/blenderwright --cov-report=term-missing --ignore=tests/test_addon
@@ -0,0 +1,24 @@
1
+ name: Pylint
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ matrix:
10
+ python-version: ["3.10", "3.12", "3.13"]
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - name: Set up Python ${{ matrix.python-version }}
14
+ uses: actions/setup-python@v5
15
+ with:
16
+ python-version: ${{ matrix.python-version }}
17
+ - name: Install dependencies
18
+ run: |
19
+ python -m pip install --upgrade pip
20
+ pip install pylint
21
+ pip install -e .
22
+ - name: Lint MCP server
23
+ run: |
24
+ pylint src/blenderwright/ --disable=C,R,W0622 --fail-under=9.0
@@ -0,0 +1,71 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*.*.*"
7
+
8
+ permissions:
9
+ contents: write
10
+
11
+ jobs:
12
+ build-extension:
13
+ name: Build extension zip
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - name: Download Blender 4.2 LTS
19
+ run: |
20
+ curl -sSfL -o blender.tar.xz \
21
+ https://download.blender.org/release/Blender4.2/blender-4.2.0-linux-x64.tar.xz
22
+ mkdir -p blender
23
+ tar -xf blender.tar.xz -C blender --strip-components=1
24
+ echo "$PWD/blender" >> "$GITHUB_PATH"
25
+
26
+ - name: Validate manifest
27
+ run: blender --command extension validate addon/
28
+
29
+ - name: Build extension zip
30
+ run: |
31
+ mkdir -p dist
32
+ blender --command extension build --source-dir addon --output-dir dist
33
+ ls -la dist/
34
+
35
+ - name: Upload build artifact
36
+ uses: actions/upload-artifact@v4
37
+ with:
38
+ name: blenderwright-extension
39
+ path: dist/blenderwright-*.zip
40
+
41
+ - name: Create GitHub Release
42
+ uses: softprops/action-gh-release@v2
43
+ with:
44
+ files: dist/blenderwright-*.zip
45
+ generate_release_notes: true
46
+ draft: false
47
+ prerelease: false
48
+
49
+ publish-pypi:
50
+ name: Publish to PyPI
51
+ runs-on: ubuntu-latest
52
+ environment: pypi
53
+ permissions:
54
+ id-token: write
55
+ contents: read
56
+ steps:
57
+ - uses: actions/checkout@v4
58
+
59
+ - uses: astral-sh/setup-uv@v5
60
+
61
+ - name: Refuse to publish a version that does not match the tag
62
+ run: |
63
+ version="$(uv version --short)"
64
+ test "v${version}" = "${GITHUB_REF_NAME}" || {
65
+ echo "pyproject version ${version} does not match tag ${GITHUB_REF_NAME}"; exit 1; }
66
+
67
+ - name: Build sdist and wheel
68
+ run: uv build
69
+
70
+ - name: Publish
71
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,32 @@
1
+ name: Handler Tests (bpy 5.1)
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ handler-tests:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+
15
+ - name: Set up Python 3.13
16
+ uses: actions/setup-python@v5
17
+ with:
18
+ python-version: "3.13"
19
+
20
+ - name: Install dependencies
21
+ run: |
22
+ python -m pip install --upgrade pip
23
+ pip install bpy==5.1.0
24
+ pip install pytest pytest-cov
25
+
26
+ - name: Run handler tests
27
+ run: pytest tests/test_addon/test_handlers/ -v --tb=short
28
+
29
+ - name: Run full test suite
30
+ run: |
31
+ pip install -e ".[dev]"
32
+ pytest tests/ -v --tb=short
@@ -0,0 +1,31 @@
1
+ blenderwright-v*.zip
2
+ blenderwright_addon*.zip
3
+ .DS_Store
4
+ __pycache__/
5
+ *.py[cod]
6
+ *$py.class
7
+ *.so
8
+ dist/
9
+ build/
10
+ *.egg-info/
11
+ *.egg
12
+ .eggs/
13
+ .venv/
14
+ venv/
15
+ env/
16
+ .env
17
+ *.blend1
18
+ *.blend2
19
+ .pytest_cache/
20
+ .coverage
21
+ htmlcov/
22
+ .ruff_cache/
23
+ .mypy_cache/
24
+ .claude/
25
+ .python-version
26
+ CLAUDE.md
27
+ README.html
28
+
29
+ # Planning artifacts - do not reintroduce
30
+ .planning/
31
+ ollama-config.json
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 HoldMyBeer-gg
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,386 @@
1
+ Metadata-Version: 2.5
2
+ Name: blenderwright
3
+ Version: 2.0.0
4
+ Summary: The most intuitive and efficient MCP Server for Blender
5
+ License-Expression: MIT
6
+ License-File: LICENSE
7
+ Requires-Python: >=3.10
8
+ Requires-Dist: mcp<2,>=1.26.0
9
+ Requires-Dist: pydantic>=2.0
10
+ Provides-Extra: chat
11
+ Requires-Dist: ollama>=0.4; extra == 'chat'
12
+ Provides-Extra: dev
13
+ Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
14
+ Requires-Dist: pytest-cov>=4.0; extra == 'dev'
15
+ Requires-Dist: pytest>=7.0; extra == 'dev'
16
+ Requires-Dist: ruff<0.16,>=0.15; extra == 'dev'
17
+ Description-Content-Type: text/markdown
18
+
19
+ # blenderwright
20
+
21
+ <small>Formerly blend-ai. Same project, new name, nothing else changed.</small>
22
+
23
+ The most intuitive and efficient MCP Server for Blender. Control Blender entirely through AI assistants like Claude: create 3D models, set up scenes, animate, render, and more, all through natural language.
24
+
25
+ **blenderwright goes beyond tool exposure: it guides the LLM to produce professional 3D results** through expert prompts, proven workflows, visual feedback, and mesh quality analysis.
26
+
27
+ <small>A two-storey Western saloon from a single sentence: "create a Western style 2-story saloon, the outside is more important than any inside detail." Claude Code (Fable 5.1) built the false front, plank siding, balcony, batwing doors and street dressing, then relit it for dusk, all through blenderwright, in about twenty minutes with no manual modelling:</small>
28
+
29
+ ![blenderwright saloon built from one prompt](./saloon.png)
30
+
31
+ <small>This was created via Claude Code using the Haiku model and 20 random reference images. It took 5 minutes:</small>
32
+
33
+ ![blenderwright screenshot](./screenshot.png)
34
+
35
+ <small>Fifteen procedural materials, each built by a single `create_procedural_material` call. The selected ball's node graph below was generated entirely by that one call: coordinates, mapping, noise, height mask, colour ramp, and Principled BSDF, laid out and wired:</small>
36
+
37
+ ![blenderwright procedural shader preview](./shader-preview.png)
38
+
39
+ ## Key Features
40
+
41
+ - **[186 tools](https://blenderwright.holdmybeer.gg/)** across 27 modules covering every major Blender domain: modeling, mesh editing, materials, shader nodes, lighting, camera, animation, rendering, sculpting, UV mapping, physics, geometry nodes, rigging, curves, sweeps along a path, 3D-print checking, annotations, collections, file I/O, Bool Tool, viewport control, mesh quality analysis, and extension suggestions
42
+ - **12 expert prompts**: topology best practices, real-world scale references, lighting principles, studio setup, character basemesh workflow, PBR material guide, auto-critique feedback loop, and more
43
+ - **Visual feedback loop**: fast viewport screenshots via OpenGL render (~ms, not seconds) with auto-critique prompts that guide the LLM to check its own work
44
+ - **Mesh quality analysis**: structured reports covering non-manifold edges, loose vertices, zero-area faces, duplicate vertices, and wire edges
45
+ - **Extension suggestions**: proactively recommends Bool Tool, LoopTools, and Node Wrangler when a task would benefit from them (skips already-installed extensions)
46
+ - **Sandboxed code execution**: `execute_blender_code` blocks dangerous imports (`os`, `subprocess`, `socket`, etc.) and dangerous builtins (`exec`, `eval`, `open`) while allowing safe Blender operations
47
+ - **Render-aware**: automatically detects when Blender is rendering and queues commands. Recovers from stuck render guards via `load_post` handler and reset command
48
+ - **Blender 4.2+ compatible**: ships as a Blender Extension; tested against Blender 5.1 with EEVEE identifier, Annotation API, sculpt stroke_method, SLIM UV unwrap, Raycast shader node, and EEVEE light path intensity controls
49
+ - **Custom port**: configure the server port from the N-panel UI (default: 9876, range: 1024–65535)
50
+ - **Zero telemetry**: no usage tracking, no analytics, no data collection. Everything runs locally on `127.0.0.1`
51
+ - **Zero-dependency addon**: the Blender addon uses only Python stdlib + `bpy`. Nothing to pip install inside Blender
52
+ - **Thread-safe architecture**: background TCP server with queue-based main-thread execution, TCP keepalive for stale connection detection
53
+ - **1190 tests**: coverage across tools, handlers, validators, prompts, and the cross-platform installer (ubuntu/macos/windows × py3.11/3.13 in CI)
54
+
55
+ ## Quickstart
56
+
57
+ ### 1. Install the MCP server
58
+
59
+ ```bash
60
+ git clone https://github.com/HoldMyBeer-gg/blenderwright.git
61
+ cd blenderwright
62
+ uv pip install -e .
63
+ ```
64
+
65
+ ### 2. Install the Blender addon
66
+
67
+ 1. Download the latest addon zip from [GitHub Releases](https://github.com/HoldMyBeer-gg/blenderwright/releases)
68
+ 2. Open Blender 4.2 or later
69
+ 3. Go to **Edit > Preferences > Get Extensions**, click the dropdown (▾) top-right, and choose **Install from Disk...**
70
+ 4. Select the downloaded `.zip` file
71
+ 5. Enable **"blenderwright"** in the extensions list
72
+
73
+ > **Blender 4.0 / 4.1 users:** Not supported. blenderwright ships as a Blender Extension, which requires Blender 4.2 (LTS) or later. Please upgrade Blender from [blender.org/download](https://www.blender.org/download/).
74
+
75
+ <details>
76
+ <summary><strong>Developer install (symlink)</strong></summary>
77
+
78
+ If you're developing on blenderwright, symlink the addon folder into Blender's user extensions directory instead. Replace `<ver>` with your Blender version (e.g. `4.2`, `5.1`).
79
+
80
+ ```bash
81
+ # macOS
82
+ ln -s "$(pwd)/addon" ~/Library/Application\ Support/Blender/<ver>/extensions/user_default/blenderwright
83
+
84
+ # Linux
85
+ ln -s "$(pwd)/addon" ~/.config/blender/<ver>/extensions/user_default/blenderwright
86
+
87
+ # Windows (run as admin)
88
+ mklink /D "%APPDATA%\Blender Foundation\Blender\<ver>\extensions\user_default\blenderwright" "%cd%\addon"
89
+ ```
90
+
91
+ Then enable the extension in Blender preferences under **Get Extensions > User**.
92
+
93
+ </details>
94
+
95
+ ### 3. Start the server in Blender
96
+
97
+ In Blender's 3D Viewport, open the **N-panel** (press `N`), find the **blenderwright** tab. Set your preferred port (default: 9876), then click **Start Server**.
98
+
99
+ ### 4. Connect your AI assistant
100
+
101
+ <details>
102
+ <summary><strong>Claude Code</strong></summary>
103
+
104
+ ```bash
105
+ claude mcp add blenderwright -- uv run --directory /path/to/blenderwright blenderwright
106
+ ```
107
+
108
+ Replace `/path/to/blenderwright` with the actual path to your clone. Make sure Blender is running with the addon server started before using the tools.
109
+
110
+ **Usage:**
111
+
112
+ ```
113
+ $ claude
114
+
115
+ > Create a red metallic sphere on a white plane with three-point lighting
116
+
117
+ > Add a subdivision surface modifier to the sphere and set it to level 3
118
+
119
+ > Analyze the mesh quality of the sphere and fix any issues
120
+
121
+ > Set up a turntable animation and render it to /tmp/turntable/
122
+ ```
123
+
124
+ </details>
125
+
126
+ <details>
127
+ <summary><strong>Claude Desktop</strong></summary>
128
+
129
+ Add blenderwright to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
130
+
131
+ ```json
132
+ {
133
+ "mcpServers": {
134
+ "blenderwright": {
135
+ "command": "uv",
136
+ "args": ["run", "--directory", "/path/to/blenderwright", "blenderwright"]
137
+ }
138
+ }
139
+ }
140
+ ```
141
+
142
+ Replace `/path/to/blenderwright` with the actual path to your clone.
143
+
144
+ Restart Claude Desktop. The Blender tools will appear in the tool list.
145
+
146
+ </details>
147
+
148
+ <details>
149
+ <summary><strong>Other MCP Clients</strong></summary>
150
+
151
+ blenderwright is a standard MCP server using stdio transport. Any MCP-compatible client can connect by running the server directly:
152
+
153
+ ```bash
154
+ uv run --directory /path/to/blenderwright blenderwright
155
+ # or: python -m blenderwright.server
156
+ ```
157
+
158
+ The exact config location and format vary by client (typically JSON or TOML under `~/.<client>/`). The `command` is `uv` and the `args` are `["run", "--directory", "/path/to/blenderwright", "blenderwright"]`.
159
+
160
+ The server communicates over stdin/stdout using the MCP protocol. It connects to Blender's addon over TCP on `127.0.0.1:9876` (or your configured port).
161
+
162
+ </details>
163
+
164
+ ## Updating
165
+
166
+ Whichever way you installed, **Blender must be fully restarted**, not "Reload Scripts".
167
+ The addon runs a background TCP server thread that survives a script reload, so reloading
168
+ leaves a stale handler registered and the old socket still bound.
169
+
170
+ ### One command (zip installs)
171
+
172
+ ```bash
173
+ python install_addon.py upgrade
174
+ ```
175
+
176
+ With no argument it finds your Blender installations and offers them as a numbered
177
+ list, so there is no path to get wrong. You can still pass one explicitly:
178
+
179
+ ```bash
180
+ # macOS - the binary inside the bundle, not the .app itself
181
+ python install_addon.py upgrade /Applications/Blender.app/Contents/MacOS/Blender
182
+
183
+ # Linux
184
+ python install_addon.py upgrade /usr/local/bin/blender
185
+
186
+ # Windows
187
+ python install_addon.py upgrade "C:\Program Files\Blender Foundation\Blender 4.2\blender.exe"
188
+ ```
189
+
190
+ It refuses to run while Blender is open, checks the path before touching anything,
191
+ removes every blenderwright install across *all* Blender version directories, rebuilds the
192
+ zip from `addon/`, and installs it through Blender's own extension machinery. It also
193
+ handles the case that bites people most: an older copy left behind under a previous
194
+ Blender version.
195
+
196
+ Two companion commands:
197
+
198
+ ```bash
199
+ python install_addon.py doctor # list every blenderwright install found, and where
200
+ python install_addon.py uninstall --yes # remove them all (omit --yes for a dry run)
201
+ ```
202
+
203
+ Start with `doctor` if the addon is behaving strangely: a duplicate install under an
204
+ old Blender version is the usual cause.
205
+
206
+ ### Developer symlink installs
207
+
208
+ If you symlinked `addon/` into Blender's extensions directory, there is nothing to
209
+ install. `git pull` and restart Blender. Use `doctor` to confirm which kind of install
210
+ you have; it reports symlinks distinctly.
211
+
212
+ ### By hand, through the GUI
213
+
214
+ <details>
215
+ <summary><strong>Manual steps, if you would rather not run the script</strong></summary>
216
+
217
+ 1. If the server is running, open the N-panel **blenderwright** tab and click **Stop Server**.
218
+ 2. In Blender, open **Edit > Preferences > Get Extensions**, find **blenderwright**, and click **Uninstall**.
219
+ 3. Quit and restart Blender (this clears cached `blenderwright` modules).
220
+ 4. Install the new `.zip` via the **▾ > Install from Disk...** menu and enable it.
221
+
222
+ </details>
223
+
224
+ ## Expert Guidance
225
+
226
+ blenderwright includes 12 MCP prompts that guide the LLM toward professional-quality results:
227
+
228
+ | Prompt | What It Teaches |
229
+ |--------|----------------|
230
+ | `blender_best_practices` | Bool Tool preference, mesh editing patterns, modifier workflow |
231
+ | `topology_best_practices` | Quad topology, edge flow, poles, n-gon cleanup, face density |
232
+ | `scale_reference_guide` | Real-world dimensions for 8 common objects, unit system setup |
233
+ | `lighting_principles` | Three-point lighting, HDRI, EEVEE vs Cycles, color temperature |
234
+ | `studio_lighting_setup` | 6-step studio lighting workflow with specific energy values |
235
+ | `character_basemesh_workflow` | 7-step character base mesh from cube with mirror + subdivision |
236
+ | `material_workflow_guide` | PBR materials, Principled BSDF recipes, texture color spaces |
237
+ | `auto_critique_workflow` | Visual feedback loop: when to screenshot, what to check, token budget |
238
+ | `product_shot_setup` | Professional product shot setup guide |
239
+ | `character_base_mesh` | Character modeling guide |
240
+ | `scene_cleanup` | Scene organization workflow |
241
+ | `animation_turntable` | Turntable animation setup |
242
+
243
+ ## Tool Domains
244
+
245
+ <details>
246
+ <summary><strong>All 186 tools across 27 modules</strong></summary>
247
+
248
+ Full reference with every parameter: **[blenderwright.holdmybeer.gg](https://blenderwright.holdmybeer.gg/)**
249
+
250
+ | Domain | Tools | Highlights |
251
+ |--------|-------|-----------|
252
+ | Scene | 6 | Get scene info, set frame range, manage scenes, suggest helpful extensions |
253
+ | Objects | 15 | Create primitives, duplicate, parent, join, visibility, origin, convert, auto-smooth |
254
+ | Transforms | 6 | Position, rotation (euler/quat), scale, apply, snap |
255
+ | Modeling | 13 | Modifiers, booleans, subdivide, extrude, bevel, loop cut, bridge edge loops |
256
+ | Mesh Editing | 16 | Inset, fill, grid fill, mark seam/sharp, normals, dissolve, knife project, spin, crease |
257
+ | Selection | 6 | Select by index, by axis, by face sides, by similarity; invert; report what is selected |
258
+ | Mesh Quality | 3 | Analyze mesh defects: non-manifold, loose verts, zero-area faces, duplicates and repair them; decimate to reduce polycount |
259
+ | Bool Tool | 4 | Auto union, difference, intersect, slice (via Blender's Bool Tool addon) |
260
+ | Materials | 25 | Principled BSDF, procedural and raster textures, textures, blend modes, shader node graph (add/connect/remove nodes, including 5.1 Raycast node) |
261
+ | Lighting | 7 | Point/sun/spot/area lights, HDRIs, light rigs, shadows |
262
+ | Camera | 6 | Create, aim, DOF, viewport capture, active camera |
263
+ | Animation | 8 | Keyframes, interpolation, frame range, follow path |
264
+ | Rendering | 7 | Engine, resolution, samples, output format, render, EEVEE light path intensity |
265
+ | Curves | 10 | Bezier/NURBS/path, 3D text, convert, reverse, handle types, cyclic, subdivide |
266
+ | Sweep | 2 | Sweep a profile along a 3D path for tubes, hoses, cables and rails, with flip-free framing; check a path for bends too tight for the profile |
267
+ | 3D Printing | 1 | Reversed normals, self-intersection, thin walls, shells and overhangs via Blender's 3D Print Toolbox |
268
+ | Sculpting | 8 | Brushes, remesh, multires, symmetry, dynamic topology, stroke_method |
269
+ | UV Mapping | 4 | Smart project, unwrap (ANGLE_BASED, CONFORMAL, SLIM), projection, pack islands |
270
+ | Physics | 9 | Rigid body, cloth, fluid, particles (velocity, rendering, delete), bake |
271
+ | Geometry Nodes | 5 | Create node trees, add/connect nodes, set inputs |
272
+ | Armature | 6 | Bones, constraints, auto weights, pose |
273
+ | Annotations | 5 | Annotation layers and strokes (5.1 Annotation API) |
274
+ | Collections | 4 | Create, move objects, visibility, delete |
275
+ | File I/O | 5 | Import/export (FBX, OBJ, glTF, USD, STL...), save/open |
276
+ | Viewport | 3 | Shading mode, overlays, focus on object |
277
+ | Screenshot | 1 | Fast viewport capture (OpenGL) or full render, base64 output |
278
+ | Code Exec | 1 | Sandboxed Python execution in Blender (dangerous imports blocked) |
279
+
280
+ </details>
281
+
282
+ ## Architecture
283
+
284
+ ```
285
+ AI Assistant <--stdio/MCP--> blenderwright server <--TCP socket--> Blender addon <--bpy--> Blender
286
+ ```
287
+
288
+ <details>
289
+ <summary><strong>How it works</strong></summary>
290
+
291
+ - **MCP Server** (`src/blenderwright/`): Python process using the `mcp` SDK. Exposes tools, resources, and prompts over stdio. Validates all inputs before forwarding to Blender.
292
+ - **Blender Addon** (`addon/`): Runs a TCP socket server inside Blender on a background thread. Commands are queued and executed on the main thread via `bpy.app.timers` to respect Blender's threading model.
293
+ - **Render Guard**: Tracks render state via `bpy.app.handlers`. During renders, the server immediately returns a "busy" status. Automatically recovers from crashed renders via `load_post` handler. Can be force-reset via MCP command.
294
+ - **Protocol**: Length-prefixed JSON messages over TCP with SO_KEEPALIVE for stale connection detection. Each message is a 4-byte big-endian length header followed by a UTF-8 JSON payload.
295
+
296
+ </details>
297
+
298
+ ## Privacy & Security
299
+
300
+ <details>
301
+ <summary><strong>Privacy</strong></summary>
302
+
303
+ - **Zero telemetry**: blenderwright collects no usage data, sends no analytics, and makes no network requests beyond the local TCP connection to Blender.
304
+ - **Fully local**: all communication stays on your machine. No cloud services, no external APIs, no phone-home behavior.
305
+ - **Open source**: the entire codebase is auditable. What you see is what runs.
306
+
307
+ </details>
308
+
309
+ <details>
310
+ <summary><strong>Security</strong></summary>
311
+
312
+ - **Localhost only**: The TCP socket binds to `127.0.0.1`, never exposed to the network.
313
+ - **Sandboxed code execution**: `execute_blender_code` blocks 25 dangerous imports (`os`, `subprocess`, `socket`, `shutil`, `sys`, `ctypes`, `importlib`, `pathlib`, `signal`, `multiprocessing`, `pickle`, `shelve`, `tempfile`, `http`, `urllib`, `ftplib`, `smtplib`, `xmlrpc`, `code`, `codeop`, `compileall`, `webbrowser`, `antigravity`, `turtle`, `tkinter`) and removes dangerous builtins (`__import__`, `exec`, `eval`, `compile`, `open`, `globals`, `locals`, `vars`, `input`, `breakpoint`, `exit`, `quit`, `help`, `memoryview`). Safe Blender imports (`bpy`, `bmesh`, `mathutils`, `math`, `json`) are allowed.
314
+ - **Input validation**: All inputs pass through validators before reaching Blender: name sanitization, path traversal prevention, numeric range checks, enum allowlists.
315
+ - **File safety**: Import operations disable `use_scripts_auto_execute` to prevent script injection from imported files. File extensions are checked against allowlists.
316
+ - **Command allowlist**: The addon dispatcher only processes explicitly registered commands. Unknown commands are rejected.
317
+ - **Shader node allowlist**: Only 64 known shader node types can be created, which prevents arbitrary type injection.
318
+
319
+ </details>
320
+
321
+ ## Limitations
322
+
323
+ <details>
324
+ <summary><strong>Known limitations</strong></summary>
325
+
326
+ - **Blender must be running**: The MCP server communicates with Blender over TCP. Blender must be open with the addon enabled and server started.
327
+ - **Single connection**: The addon accepts one client connection at a time. Multiple AI assistants cannot control the same Blender instance simultaneously.
328
+ - **Selection is persistent, not per-call**: Selection lives on the mesh in Blender, so it stays set between calls. Choose geometry with the `select_*` tools, then pass `selection="CURRENT"` to a mesh tool. The default is still `"ALL"`. Because the selection is shared state, two assistants working on the same mesh would step on each other.
329
+ - **Sculpt strokes cannot be simulated**: You can configure brushes, symmetry, dyntopo, and remeshing, but actual brush strokes are not yet exposed.
330
+ - **Node graphs require sequential calls**: Both shader node trees and geometry node trees must be built one node/connection at a time.
331
+ - **No undo integration**: Operations appear in Blender's undo history individually but there's no MCP-level undo/redo or transaction grouping.
332
+ - **Viewport capture requires a visible 3D viewport**: Headless Blender may not support viewport screenshots.
333
+ - **No real-time feedback**: The MCP protocol is request/response. There's no streaming of viewport updates or render progress.
334
+
335
+ </details>
336
+
337
+ ## Development
338
+
339
+ ```bash
340
+ # Install with dev dependencies
341
+ uv pip install -e ".[dev]"
342
+
343
+ # Run tests (1190 tests)
344
+ uv run --extra dev pytest
345
+
346
+ # Run tests with coverage
347
+ uv run --extra dev pytest --cov=blenderwright
348
+
349
+ # Lint
350
+ ruff check src/ tests/
351
+
352
+ # Format
353
+ ruff format src/ tests/
354
+ ```
355
+
356
+ <details>
357
+ <summary><strong>Project structure</strong></summary>
358
+
359
+ ```
360
+ blenderwright/
361
+ ├── src/blenderwright/ # MCP server
362
+ │ ├── server.py # FastMCP entry point
363
+ │ ├── connection.py # TCP client to Blender (with busy-retry)
364
+ │ ├── validators.py # Input validation
365
+ │ ├── tools/ # 27 tool modules (186 tools)
366
+ │ ├── resources/ # MCP resources (scene, objects, materials)
367
+ │ └── prompts/ # 12 expert prompt templates
368
+ ├── addon/ # Blender addon (zero external deps)
369
+ │ ├── blender_manifest.toml # Blender 4.2+ Extension manifest
370
+ │ ├── __init__.py # bl_info (legacy fallback) + register/unregister
371
+ │ ├── server.py # TCP socket server (SO_KEEPALIVE)
372
+ │ ├── dispatcher.py # Command routing + allowlist
373
+ │ ├── thread_safety.py # Main-thread execution queue
374
+ │ ├── render_guard.py # Render state tracking + crash recovery
375
+ │ ├── ui_panel.py # N-panel UI (start/stop + port config)
376
+ │ └── handlers/ # 23 handler modules
377
+ └── tests/ # 1186 unit tests
378
+ ```
379
+
380
+ </details>
381
+
382
+ ## License
383
+
384
+ MIT. See [LICENSE](LICENSE).
385
+
386
+ Copyright © 2026 jabberwock.