blender-weave 1.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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Pedro Augusto
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,375 @@
1
+ Metadata-Version: 2.4
2
+ Name: blender-weave
3
+ Version: 1.0.0
4
+ Summary: Weave 3D worlds with AI — the MCP server for Blender
5
+ Author: Pedro Augusto
6
+ License: MIT
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: mcp[cli]>=1.3.0
14
+ Dynamic: license-file
15
+
16
+ # BlenderWeave
17
+
18
+ MCP server that connects AI to Blender's 3D pipeline — 91 tools covering objects, materials, rigging, animation, physics, node graphs, rendering, and asset integrations. Every modifying command returns structured scene perception in the [Perspicacity](https://github.com/pedronaugusto/perspicacity) format — no screenshots needed for routine feedback.
19
+
20
+ ## Architecture
21
+
22
+ ```
23
+ Claude Code / Cursor / Codex / any MCP client
24
+ │ stdio (MCP Protocol)
25
+ ▼
26
+ BlenderWeave MCP Server ← pip install / uvx / bundled via plugin
27
+ │ unix socket (~/.blenderweave/servers/)
28
+ │ length-prefixed JSON
29
+ ▲
30
+ BlenderWeave Addon ← installed in Blender
31
+ │ auto-discover + auto-reconnect
32
+ │ bpy.app.timers (main thread)
33
+ ▼
34
+ Blender 4.2+ / 5.0+ (bpy API)
35
+ ```
36
+
37
+ ## Installation
38
+
39
+ ### Blender Addon
40
+
41
+ Download `blender_weave.zip` from [Releases](https://github.com/pedronaugusto/blender-weave/releases) and install it in Blender:
42
+
43
+ 1. Open Blender → **Edit** → **Preferences** → **Extensions**
44
+ 2. Click **Install from Disk** (dropdown arrow next to the search bar)
45
+ 3. Select the downloaded `blender_weave.zip`
46
+ 4. Enable **BlenderWeave** in the extensions list
47
+
48
+ For development, symlink instead:
49
+ ```bash
50
+ # macOS
51
+ ln -s /path/to/blender-weave/addon \
52
+ ~/Library/Application\ Support/Blender/5.0/extensions/user_default/blender_weave
53
+
54
+ # Linux
55
+ ln -s /path/to/blender-weave/addon \
56
+ ~/.config/blender/5.0/extensions/user_default/blender_weave
57
+ ```
58
+
59
+ ### MCP Server
60
+
61
+ **Claude Code** (recommended — includes agent + Perspicacity skill):
62
+ ```bash
63
+ /plugin marketplace add pedronaugusto/claude-marketplace
64
+ /plugin install blender-weave@gusto-plugins
65
+ ```
66
+
67
+ **Cursor / VS Code / Claude Desktop / other MCP clients:**
68
+ ```bash
69
+ pip install blender-weave
70
+ # or: uvx blender-weave
71
+ ```
72
+
73
+ Then add to your client's MCP config:
74
+ ```json
75
+ {
76
+ "mcpServers": {
77
+ "blender-weave": {
78
+ "command": "uvx",
79
+ "args": ["blender-weave"]
80
+ }
81
+ }
82
+ }
83
+ ```
84
+
85
+ ### Connect
86
+
87
+ 1. Start your AI (Claude Code, Cursor, etc.) — the MCP server starts and creates a unix socket
88
+ 2. Open Blender — the addon auto-discovers the server and connects
89
+ 3. In Blender's 3D View sidebar (press **N**), find the **BlenderWeave** tab
90
+ 4. The panel has two tabs: **Core** (always on) and **External** (asset integrations)
91
+ 5. Enable integrations you want (Poly Haven, Sketchfab, etc.) — AmbientCG is enabled by default
92
+ 6. Start talking to your AI
93
+
94
+ Zero configuration needed. The addon auto-reconnects if Blender is restarted, and auto-discovers if multiple MCP servers are running.
95
+
96
+ ### Blender Panel
97
+
98
+ Open the sidebar in 3D View (press **N**) and find the **BlenderWeave** tab.
99
+
100
+ | Section | What it does |
101
+ |---------|-------------|
102
+ | **Connection** | Shows status (Connected / Connecting / No server). Auto-connects on startup; Connect button for manual retry. If multiple AI sessions are running, a dropdown lets you pick which one. |
103
+ | **Core tab** | Perception mode (Smart / Full / Compact), budget caps (OBJ, REL, LIT, etc.), radius filter, ray grid resolution, micro render size |
104
+ | **External tab** | Enable/disable asset libraries (Poly Haven, AmbientCG, Sketchfab, Poly Pizza, Smithsonian) and AI generation (Hyper3D, Hunyuan3D, Trellis2) with API keys |
105
+
106
+ **Perception modes:**
107
+ - **Smart** (default) — full perception minus physics/animation, radius-filtered. Best for most workflows.
108
+ - **Full** — everything enabled, all objects, all pairs. For deep scene audits.
109
+ - **Compact** — OBJ + DELTA + VERIFY only. Fastest response.
110
+
111
+ ## Spatial Intelligence (Always-On)
112
+
113
+ Every modifying command returns a compact Perspicacity DSL with full 3D spatial perception. Sections are separated by blank lines for fast scanning:
114
+
115
+ ```
116
+ DELTA Bottle moved [0.00,0.00,0.50] (+Z)
117
+
118
+ SCENE 12 objects 3 lights 1500W BLENDER_EEVEE ground_z=0.0
119
+ CAM Camera [2.1,-3.4,1.8] 50mm fov=39.6°
120
+ WORLD bg=[0.05,0.05,0.05] strength=1.0
121
+
122
+ LIGHT Key AREA 800W [1.0,0.95,0.9] [3,1,4]
123
+
124
+ OBJ Bottle [0,0,0.5] 23% mid-center d=2.3m Glass(clear,ior=1.45) dim=[0.08,0.08,0.3] lum=0.6 toward=Wall_Back
125
+ OBJ Wall_Back [0,3,1.5] 40% mid-center d=4.1m Concrete(textured) dim=[6,0.2,3] lum=0.3
126
+
127
+ ASSEMBLY FloorLamp members=[Base,Shade,Bulb] center=[2,1,0.8] types=[MESH]
128
+
129
+ REL Bottle→Wall_Back 1.8m behind overlap
130
+ LIT Key→Bottle @35° i=0.72
131
+ LIT Key→Wall_Back @62° i=0.31 shadow:Bottle
132
+ SHAD Key→Floor 65% casters:Bottle contact
133
+ MAT Glass: clear glass -- needs env reflections, objects behind
134
+ HARMONY types=glass(30%)+stone(50%)+metal(20%) temp=cool
135
+
136
+ PHYS Bottle active mass=0.5kg
137
+ COMP thirds=0.82 3/3_visible balance=0.65 depth=3/3
138
+ RAY 12x12 Bottle=25% Floor=60% empty=15%
139
+ MVIEW top: Floor=60% Bottle=5%
140
+ HIER Lid > Pot > Scene
141
+ GRP Kitchenware: Pot, Lid, Spoon
142
+ ANIM Bottle action=Spin frame=12/60 playing
143
+ ```
144
+
145
+ Individual features can be toggled in the addon panel under "Scene Perception".
146
+
147
+ | Tool | When to use |
148
+ |------|-------------|
149
+ | Auto-perception | Always on — attached to every modifying command |
150
+ | `get_scene_perception` | Explicit full spatial query |
151
+ | `get_scene_delta` | What changed since last perception call |
152
+ | `render_region` | Check a specific object at high quality |
153
+ | `get_viewport_screenshot` | Final review or explicit "show me" |
154
+
155
+ ## Tool Catalog (90+ tools)
156
+
157
+ ### Scene Perception & Feedback
158
+ | Tool | What it does |
159
+ |------|-------------|
160
+ | `get_scene_perception` | Full 3D spatial intelligence — depth-sorted objects, relationships, light analysis, material predictions, constraints |
161
+ | `get_scene_delta` | What changed since last perception call (~200 bytes) |
162
+ | `get_viewport_thumbnail` | Tiny 96px JPEG viewport capture (~4KB) |
163
+ | `analyze_scene` | Full scene analysis with screenshot + structured data |
164
+ | `get_scene_info` | Scene overview — objects, materials, render engine |
165
+ | `get_object_info` | Object details — transform, mesh data, world bounding box |
166
+ | `get_viewport_screenshot` | Full viewport screenshot as PNG |
167
+ | `execute_blender_code` | Run arbitrary Python in Blender (fallback) |
168
+
169
+ ### File & Undo
170
+ | Tool | What it does |
171
+ |------|-------------|
172
+ | `save_file` / `open_file` | File management |
173
+ | `undo` / `redo` | Undo stack navigation |
174
+ | `set_frame` | Animation timeline control |
175
+
176
+ ### Viewport
177
+ | Tool | What it does |
178
+ |------|-------------|
179
+ | `set_viewport_shading` | Wireframe, solid, material, rendered |
180
+ | `set_viewport` | Camera lock, preset views, overlays, frame selected/all |
181
+
182
+ ### Object Management
183
+ | Tool | What it does |
184
+ |------|-------------|
185
+ | `create_object` | Create meshes, lights, cameras, empties |
186
+ | `transform_object` | Move, rotate, scale — absolute or delta. Supports `recursive` and `look_at` |
187
+ | `batch_transform` | Transform multiple objects in one call |
188
+ | `duplicate_object` | Copy objects, optionally linked |
189
+ | `delete_object` | Remove objects by name list (recursive) |
190
+ | `place_relative` | Semantic placement — `in_front`, `behind`, `on_top`, etc. |
191
+ | `create_assembly` | Multi-part furniture (dining_chair, table, sofa, floor_lamp, bookshelf) |
192
+ | `batch_execute` | Multi-tool single round-trip, perception once at end |
193
+ | `manage_selection` | Select, deselect, invert, by type |
194
+ | `manage_collections` | Create, delete, nest collections; move objects; purge orphans |
195
+
196
+ ### Mesh Operations
197
+ | Tool | What it does |
198
+ |------|-------------|
199
+ | `mesh_operation` | Join, separate, boolean, shade smooth/flat, apply transforms, set origin, remesh |
200
+ | `generate_lod_chain` | Create LOD levels with automatic decimation |
201
+ | `generate_collision_mesh` | Generate collision meshes (convex hull, box, voxel) |
202
+
203
+ ### Materials & Textures
204
+ | Tool | What it does |
205
+ |------|-------------|
206
+ | `manage_materials` | Create PBR materials, assign, list, edit nodes, add nodes, connect/disconnect, color ramps, get node info |
207
+ | `set_texture` | Apply Poly Haven PBR texture to object |
208
+
209
+ ### UV Mapping & Baking
210
+ | Tool | What it does |
211
+ |------|-------------|
212
+ | `uv_operation` | Smart UV project, lightmap pack, unwrap, create/set/list UV layers |
213
+ | `bake_textures` | Bake high-to-low poly textures: diffuse, normal, AO, roughness, combined, emit |
214
+
215
+ ### Node Graph Engine
216
+ | Tool | What it does |
217
+ |------|-------------|
218
+ | `build_node_graph` | Create/replace geometry nodes, shader nodes, or compositor nodes |
219
+ | `get_node_graph` | Read back any node tree as structured JSON |
220
+ | `list_node_types` | Discover available nodes by category |
221
+
222
+ ### Modifiers
223
+ | Tool | What it does |
224
+ |------|-------------|
225
+ | `modify_object` | Add, remove, apply, or configure any modifier |
226
+
227
+ ### Rigging & Weights
228
+ | Tool | What it does |
229
+ |------|-------------|
230
+ | `manage_armature` | Create armatures, add/modify bones, parent meshes, IK, bone constraints |
231
+ | `manage_weights` | Vertex group assignment, auto weights, normalize, list, remove |
232
+ | `manage_shape_keys` | Blend shapes / morph targets |
233
+
234
+ ### Animation
235
+ | Tool | What it does |
236
+ |------|-------------|
237
+ | `set_keyframe` | Keyframe loc/rot/scale/custom with interpolation control |
238
+ | `manage_actions` | Create, assign, list, duplicate animation actions |
239
+ | `manage_nla` | NLA tracks and strips for non-linear animation |
240
+
241
+ ### Physics & Constraints
242
+ | Tool | What it does |
243
+ |------|-------------|
244
+ | `manage_physics` | Rigid body, collision, cloth, soft body |
245
+ | `manage_constraints` | Track To, Copy Rotation, Limit Location, Child Of, etc. |
246
+
247
+ ### Camera & Rendering
248
+ | Tool | What it does |
249
+ |------|-------------|
250
+ | `set_camera` | Focal length, sensor, DOF, focus object/distance |
251
+ | `camera_walkthrough` | Animated camera path with waypoints and look_at targets |
252
+ | `configure_render_settings` | Engine, samples, resolution, color management, EEVEE features |
253
+ | `render_scene` | Render to file — supports `animation=True` for sequences |
254
+ | `render_region` | Render just a region around an object (10-50x faster) |
255
+
256
+ ### Lighting & World
257
+ | Tool | What it does |
258
+ |------|-------------|
259
+ | `manage_lights` | List, create, set properties, change type |
260
+ | `manage_world` | HDRI, background color, environment strength |
261
+
262
+ ### Snapshots
263
+ | Tool | What it does |
264
+ |------|-------------|
265
+ | `manage_snapshots` | Save, list, compare, restore, delete scene snapshots |
266
+
267
+ ### Import / Export
268
+ | Tool | What it does |
269
+ |------|-------------|
270
+ | `import_model` | Import GLB, FBX, OBJ, USD, STL, ABC, PLY, DAE |
271
+ | `export_model` | Export scene or selection to any format |
272
+
273
+ ### Hierarchy & Drivers
274
+ | Tool | What it does |
275
+ |------|-------------|
276
+ | `manage_hierarchy` | Parent/unparent objects, list children, hierarchy tree |
277
+ | `manage_drivers` | Scripted drivers — link properties between objects |
278
+ | `manage_custom_properties` | Set/get/list/remove custom properties on objects |
279
+
280
+ ### Curves
281
+ | Tool | What it does |
282
+ |------|-------------|
283
+ | `manage_curves` | Create curves from points, edit, bevel, convert to mesh |
284
+
285
+ ### Particles
286
+ | Tool | What it does |
287
+ |------|-------------|
288
+ | `manage_particles` | Emitter/hair particle systems with instance collections |
289
+
290
+ ### Procedural Generation
291
+ | Tool | What it does |
292
+ |------|-------------|
293
+ | `procedural_generate` | Procedural buildings, terrain, trees, roads, rooms |
294
+
295
+ ### Volume Grids (Blender 5.0+)
296
+ | Tool | What it does |
297
+ |------|-------------|
298
+ | `volume_operation` | Mesh-to-SDF, SDF boolean/offset/fillet/smooth, procedural terrain, fog volumes |
299
+
300
+ ### Spatial Power Tools
301
+ | Tool | What it does |
302
+ |------|-------------|
303
+ | `batch_execute` | Combine multiple tools in one call — perception runs once at end |
304
+ | `place_relative` | Semantic placement: `in_front`, `behind`, `left_of`, `on_top`, `centered_on` |
305
+ | `create_assembly` | Multi-part furniture with proper hierarchy in one call |
306
+ | `camera_walkthrough` | Animated camera path from waypoint list with look_at targets |
307
+
308
+ ### Asset Libraries (free, search + download)
309
+
310
+ | Integration | API Key | What it provides |
311
+ |-------------|---------|-----------------|
312
+ | **Poly Haven** | None (CC0) | HDRIs, PBR textures, 3D models |
313
+ | **AmbientCG** | None (CC0) | PBR materials, HDRIs, 3D models |
314
+ | **Poly Pizza** | Free key required | Low-poly CC0/CC-BY 3D models (GLB) |
315
+ | **Smithsonian 3D** | Free key (api.data.gov) | Museum-quality 3D scans (fossils, aircraft, artifacts) |
316
+ | **Sketchfab** | API key | Extensive 3D model library with auto-normalization |
317
+
318
+ | Tool | What it does |
319
+ |------|-------------|
320
+ | `get_polyhaven_status` / `get_polyhaven_categories` | Poly Haven integration status and categories |
321
+ | `search_polyhaven_assets` / `download_polyhaven_asset` | Search and download Poly Haven assets |
322
+ | `set_texture` | Apply downloaded PBR texture to object |
323
+ | `get_ambientcg_status` | AmbientCG integration status |
324
+ | `search_ambientcg_assets` / `download_ambientcg_asset` | Search and download AmbientCG materials |
325
+ | `get_sketchfab_status` | Sketchfab integration status |
326
+ | `search_sketchfab_models` / `get_sketchfab_model_preview` | Browse and preview Sketchfab models |
327
+ | `download_sketchfab_model` | Download with automatic size normalization |
328
+ | `get_polypizza_status` | Poly Pizza integration status |
329
+ | `search_polypizza_models` / `download_polypizza_model` | Search and download Poly Pizza models |
330
+ | `get_smithsonian_status` | Smithsonian 3D integration status |
331
+ | `search_smithsonian_models` / `download_smithsonian_model` | Search and download Smithsonian scans |
332
+
333
+ ### AI 3D Generation
334
+
335
+ | Integration | What it does |
336
+ |-------------|-------------|
337
+ | **Hyper3D Rodin** | Text-to-3D and image-to-3D via cloud API |
338
+ | **Hunyuan3D** | Text/image-to-3D via Tencent's model |
339
+ | **Trellis2** | Image-to-3D via local inference |
340
+
341
+ | Tool | What it does |
342
+ |------|-------------|
343
+ | `get_hyper3d_status` / `generate_hyper3d_model_via_text` / `generate_hyper3d_model_via_images` | Hyper3D generation |
344
+ | `poll_rodin_job_status` / `import_generated_asset` | Poll and import Hyper3D results |
345
+ | `get_hunyuan3d_status` / `generate_hunyuan3d_model` | Hunyuan3D generation |
346
+ | `poll_hunyuan_job_status` / `import_generated_asset_hunyuan` | Poll and import Hunyuan3D results |
347
+ | `get_trellis2_status` / `generate_trellis2_model` | Trellis2 generation |
348
+ | `poll_trellis2_job_status` | Poll Trellis2 progress |
349
+
350
+ ## Blender 5.0 Support
351
+
352
+ BlenderWeave auto-detects Blender version and handles breaking changes transparently. New Blender 5 features include EEVEE ray tracing, ACES color management, and volume/SDF operations.
353
+
354
+ ## AI Setup
355
+
356
+ See [CLAUDE.md](CLAUDE.md) for optimal AI workflow guidelines — feedback strategy, tool priority, safety patterns, and material editing best practices.
357
+
358
+ For Claude Code users with the plugin installed, the bundled agent and Perspicacity skill provide enhanced spatial reasoning automatically.
359
+
360
+ ## Troubleshooting
361
+
362
+ - **"No MCP server running"** — start your AI client first (it creates the server). The addon auto-discovers it.
363
+ - **Timeout errors** — break complex operations into smaller steps
364
+ - **First command fails** — normal on cold start, retry and it works
365
+ - **Blender restart** — the addon auto-reconnects, no need to restart the AI client
366
+ - **Multiple AI sessions** — use the Server dropdown in the BlenderWeave panel to pick which one
367
+ - **Restart both** — if things break, restart both the AI client and Blender
368
+
369
+ ## Contributing
370
+
371
+ Contributions welcome.
372
+
373
+ ## License
374
+
375
+ MIT — Pedro Augusto