-
Notifications
You must be signed in to change notification settings - Fork 867
Pro builder #870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pro builder #870
Changes from all commits
083f8db
64ac4bb
1c1cce2
437528b
4494c75
fa6b52f
1acfbe4
5bd3a22
2c59260
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ Complete reference for all MCP tools. Each tool includes parameters, types, and | |
| - [UI Tools](#ui-tools) | ||
| - [Editor Control Tools](#editor-control-tools) | ||
| - [Testing Tools](#testing-tools) | ||
| - [ProBuilder Tools](#probuilder-tools) | ||
|
|
||
| --- | ||
|
|
||
|
|
@@ -789,3 +790,118 @@ execute_custom_tool( | |
| ``` | ||
|
|
||
| Discover available custom tools via `mcpforunity://custom-tools` resource. | ||
|
|
||
| --- | ||
|
|
||
| ## ProBuilder Tools | ||
|
|
||
| ### manage_probuilder | ||
|
|
||
| Unified tool for ProBuilder mesh operations. Requires `com.unity.probuilder` package. When available, **prefer ProBuilder over primitive GameObjects** for editable geometry, multi-material faces, or complex shapes. | ||
|
|
||
| **Parameters:** | ||
|
|
||
| | Parameter | Type | Required | Description | | ||
| |-----------|------|----------|-------------| | ||
| | `action` | string | Yes | Action to perform (see categories below) | | ||
| | `target` | string | Sometimes | Target GameObject name/path/id | | ||
| | `search_method` | string | No | How to find target: `by_id`, `by_name`, `by_path`, `by_tag`, `by_layer` | | ||
| | `properties` | dict | No | Action-specific parameters | | ||
|
|
||
| **Actions by category:** | ||
|
|
||
| **Shape Creation:** | ||
| - `create_shape` — Create ProBuilder primitive (shape_type, size, position, rotation, name). 12 types: Cube, Cylinder, Sphere, Plane, Cone, Torus, Pipe, Arch, Stair, CurvedStair, Door, Prism | ||
| - `create_poly_shape` — Create from 2D polygon footprint (points, extrudeHeight, flipNormals) | ||
|
|
||
| **Mesh Editing:** | ||
| - `extrude_faces` — Extrude faces (faceIndices, distance, method: FaceNormal/VertexNormal/IndividualFaces) | ||
| - `extrude_edges` — Extrude edges (edgeIndices or edges [{a,b},...], distance, asGroup) | ||
| - `bevel_edges` — Bevel edges (edgeIndices or edges [{a,b},...], amount 0-1) | ||
| - `subdivide` — Subdivide faces via ConnectElements (faceIndices optional) | ||
| - `delete_faces` — Delete faces (faceIndices) | ||
| - `bridge_edges` — Bridge two open edges (edgeA, edgeB as {a,b} pairs, allowNonManifold) | ||
| - `connect_elements` — Connect edges/faces (edgeIndices or faceIndices) | ||
| - `detach_faces` — Detach faces to new object (faceIndices, deleteSourceFaces) | ||
| - `flip_normals` — Flip face normals (faceIndices) | ||
| - `merge_faces` — Merge faces into one (faceIndices) | ||
| - `combine_meshes` — Combine ProBuilder objects (targets list) | ||
| - `merge_objects` — Merge objects with auto-convert (targets, name) | ||
| - `duplicate_and_flip` — Create double-sided geometry (faceIndices) | ||
| - `create_polygon` — Connect existing vertices into a new face (vertexIndices, unordered) | ||
|
|
||
| **Vertex Operations:** | ||
| - `merge_vertices` — Collapse vertices to single point (vertexIndices, collapseToFirst) | ||
| - `weld_vertices` — Weld vertices within proximity radius (vertexIndices, radius) | ||
| - `split_vertices` — Split shared vertices (vertexIndices) | ||
| - `move_vertices` — Translate vertices (vertexIndices, offset [x,y,z]) | ||
| - `insert_vertex` — Insert vertex on edge or face (edge {a,b} or faceIndex + point [x,y,z]) | ||
| - `append_vertices_to_edge` — Insert evenly-spaced points on edges (edgeIndices or edges, count) | ||
|
|
||
| **Selection:** | ||
| - `select_faces` — Select faces by criteria (direction + tolerance, growFrom + growAngle) | ||
|
|
||
| **UV & Materials:** | ||
| - `set_face_material` — Assign material to faces (faceIndices, materialPath) | ||
| - `set_face_color` — Set vertex color on faces (faceIndices, color [r,g,b,a]) | ||
| - `set_face_uvs` — Set UV params (faceIndices, scale, offset, rotation, flipU, flipV) | ||
|
|
||
| **Query:** | ||
| - `get_mesh_info` — Get mesh details with `include` parameter: | ||
| - `"summary"` (default): counts, bounds, materials | ||
| - `"faces"`: + face normals, centers, and direction labels (capped at 100) | ||
| - `"edges"`: + edge vertex pairs with world positions (capped at 200, deduplicated) | ||
| - `"all"`: everything | ||
| - `ping` — Check if ProBuilder is available | ||
|
|
||
| **Smoothing:** | ||
| - `set_smoothing` — Set smoothing group on faces (faceIndices, smoothingGroup: 0=hard, 1+=smooth) | ||
| - `auto_smooth` — Auto-assign smoothing groups by angle (angleThreshold: default 30) | ||
|
|
||
| **Mesh Utilities:** | ||
| - `center_pivot` — Move pivot to mesh bounds center | ||
| - `freeze_transform` — Bake transform into vertices, reset transform | ||
| - `validate_mesh` — Check mesh health (read-only diagnostics) | ||
| - `repair_mesh` — Auto-fix degenerate triangles | ||
|
|
||
| **Not Yet Working (known bugs):** | ||
| - `set_pivot` — Vertex positions don't persist through mesh rebuild. Use `center_pivot` or Transform positioning instead. | ||
| - `convert_to_probuilder` — MeshImporter throws internally. Create shapes natively instead. | ||
|
Comment on lines
+849
to
+869
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The action catalog is incomplete for experimental actions.
🤖 Prompt for AI Agents |
||
|
|
||
| **Examples:** | ||
|
|
||
| ```python | ||
| # Check availability | ||
| manage_probuilder(action="ping") | ||
|
|
||
| # Create a cube | ||
| manage_probuilder(action="create_shape", properties={"shape_type": "Cube", "name": "MyCube"}) | ||
|
|
||
| # Get face info with directions | ||
| manage_probuilder(action="get_mesh_info", target="MyCube", properties={"include": "faces"}) | ||
|
|
||
| # Extrude the top face (find it via direction="top" in get_mesh_info results) | ||
| manage_probuilder(action="extrude_faces", target="MyCube", | ||
| properties={"faceIndices": [2], "distance": 1.5}) | ||
|
|
||
| # Select all upward-facing faces | ||
| manage_probuilder(action="select_faces", target="MyCube", | ||
| properties={"direction": "up", "tolerance": 0.7}) | ||
|
|
||
| # Create double-sided geometry (for room interiors) | ||
| manage_probuilder(action="duplicate_and_flip", target="Room", | ||
| properties={"faceIndices": [0, 1, 2, 3, 4, 5]}) | ||
|
|
||
| # Weld nearby vertices | ||
| manage_probuilder(action="weld_vertices", target="MyCube", | ||
| properties={"vertexIndices": [0, 1, 2, 3], "radius": 0.1}) | ||
|
|
||
| # Auto-smooth | ||
| manage_probuilder(action="auto_smooth", target="MyCube", properties={"angleThreshold": 30}) | ||
|
|
||
| # Cleanup workflow | ||
| manage_probuilder(action="center_pivot", target="MyCube") | ||
| manage_probuilder(action="validate_mesh", target="MyCube") | ||
| ``` | ||
|
|
||
| See also: [ProBuilder Workflow Guide](probuilder-guide.md) for detailed patterns and complex object examples. | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.