⏳ This skill is pending AI review.

Scores will appear once the review pipeline completes.

version unknown

geometry-script

carson-katri@carson-katri⭐ 390 stars· last commit 1mo ago· 29 open issues

Build and edit Blender node trees in Python with the Geometry Script add-on (`from geometry_script import *`, `@tree`; `geometry_script.shader` for `@shader`/`@material`/`@world`; `geometry_script.compositor` for `@compositor`). Use when asked to create, change, debug or inspect a geometry node tree, shader node group, material, world or compositor node group, procedurally generate geometry in Blender, or when a script uses geometry_script — whether through Blender's official MCP server (execute_blender_code) or headless Blender.

Choose how to use this skill

You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.

1. Native installer

This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.

Do not guess an installer command or replace an existing version without reviewing the diff.

2. Complete package recommended

Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.

No complete ProSkills package is published for this listing yet.

3. Prompt-only

Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.

Need only the instruction file?

Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.

No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.

—/10

// RATINGS

⭐GitHub Stars
⭐⭐⭐ 390 on GitHubGitHub ↗

Popular

🟢ProSkills Score
—
📍

Not yet listed on ClawHub or SkillsMP

// README

Geometry Script wordmark

A scripting API for Blender's Geometry Nodes, shaders and compositor:

from geometry_script import *

@tree("Repeat Grid")
def repeat_grid(geometry: Geometry, width: int = 3, height: int = 3):
    mesh = grid(
        size_x=width, size_y=height,
        vertices_x=width, vertices_y=height,
    ).mesh
    points = mesh_to_points(mesh=mesh).points
    return instance_on_points(points=points, instance=geometry).instances

Generated node tree

Installation

Geometry Script is a Blender extension and requires Blender 5.2 or newer.

Drag the box for your Blender version into Blender to install it:

Blender asks to allow online access if it's off, then to add the Geometry Script repository, then confirms the install. The nightly release always lists the links for every Blender version with a build.

To install manually instead:

  1. Download the ZIP matching your Blender version from the nightly release, e.g. geometry_script-1.0.0-blender-5.2.zip
  2. Open Blender > Preferences > Get Extensions
  3. Open the dropdown at the top right, choose Install from Disk... and select the downloaded ZIP file

Claude Code skill

The repository is also a Claude Code plugin marketplace with a skill for building node trees with Geometry Script. Install it with:

/plugin install geometry-script --marketplace carson-katri/geometry-script

On Claude Code versions before 2.1.275, add the marketplace first:

/plugin marketplace add carson-katri/geometry-script
/plugin install geometry-script@geometry-script

The skill runs scripts through Blender's MCP server when it's connected, or in background Blender otherwise. Run /plugin marketplace update geometry-script to get the latest version, or turn on auto-update for the marketplace in /plugin.

What is Geometry Script?

Geometry Script is a robust yet easy to use Python API for creating Geometry Nodes with code.

At a certain point, Geometry Node trees become unmanagably large. Creating node trees in Python enables quicker editing and reorganization of large, complex trees.

Geometry Script has all of the performance and capabilities of Geometry Nodes, but in a more managable format. The scripts are converted directly to Geometry Node trees making them easy to tweak for others unfamiliar with scripting.

Every node in your Blender version is available as a typed Python function, generated from Blender itself, so your editor can complete node names, inputs, outputs and enum values.

Shader node groups, materials, worlds and compositor node groups can be scripted the same way, with geometry_script.shader and geometry_script.compositor:

from geometry_script.shader import *

@material("Gold")
def gold():
    return principled_bsdf(base_color=(1.0, 0.77, 0.34, 1.0), metallic=1.0, roughness=0.2).bsdf

Documentation

Read the documentation for more information on installation, syntax, and tutorials.

Contributing

Use uv to get fake-bpy-module and some pyright settings.

uv sync

The node modules (api/nodes.py, api/shader_nodes.py and api/compositor_nodes.py) are generated from Blender and aren't checked in. Loading the add-on from a checkout generates them with that Blender, or you can generate them yourself, e.g. for editor completions:

blender -b --factory-startup --python code_generator/node_functions_generator.py

To build an installable package for a specific Blender version, which generates the node modules with that Blender and runs the smoke test:

python tools/build.py --blender /path/to/blender  # writes dist/geometry_script-<version>-blender-<major>.<minor>.zip

Then you can follow Blender's steps to setup a symlink for a local repository.

// HOW IT'S BUILT

// FILES

2 files shipped with this skill. Inline text is the catalog copy. The upstream link is the source repository.

  • skills/geometry-script/SKILL.md7.8 KBupstream ↗
    ---
    name: geometry-script
    description: Build and edit Blender node trees in Python with the Geometry Script add-on (`from geometry_script import *`, `@tree`; `geometry_script.shader` for `@shader`/`@material`/`@world`; `geometry_script.compositor` for `@compositor`). Use when asked to create, change, debug or inspect a geometry node tree, shader node group, material, world or compositor node group, procedurally generate geometry in Blender, or when a script uses geometry_script — whether through Blender's official MCP server (execute_blender_code) or headless Blender.
    ---
    
    # Geometry Script
    
    Geometry Script turns a decorated Python function into a Geometry Nodes group.
    Every Blender node is a generated, typed function. The add-on checks your
    input names, output names, enum values and link types, and its errors say what
    to change. **Guess, run and fix from the error.** That is cheaper than reading
    up front.
    
    The repo root is two directories above this file. `tools/` and `api/` paths
    below are relative to it.
    
    ## The loop
    
    1. Write the script to a `.py` file, not an inline string, so later edits are small diffs.
    2. Run it and read the short report. Always go through `agent.run`: raw `exec` of
       the same script returns a traceback about 10x longer.
       - **Blender MCP, running Blender:** `execute_blender_code` with
         `from geometry_script import agent; agent.run("/abs/path/script.py", object="Name")`.
         The report comes back as `stdout`.
       - **Blender MCP, no window:** `execute_blender_code_for_cli` with a `blend_file` and
         `from geometry_script import agent; result = agent.run("/abs/path/script.py", object="Name", echo=False)`.
         This tool returns only `result`, not printed output.
       - **No MCP:** `python3 tools/run.py script.py --object Name`
         (add `--blend file.blend` to start from a file).
    3. Fix the single error it prints, then run again.
    4. Check the result with the report's geometry stats (vertex/face/point/instance
       counts, bounds) and node warnings. Take a viewport screenshot only when what
       it *looks like* matters.
    
    **Live edit:** if the user has the script open in Blender's Text Editor with
    Live Edit and the add-on's auto-resolve on, saving the file reruns it. Then
    just edit the file and call `agent.status()`, which prints the latest run's report.
    
    `agent.run` prints a few lines and returns them as `{"ok": bool, "report": str}`: each tree built (nodes, inputs, outputs), then the
    evaluated geometry and node warnings for every object using those trees.
    `object=` attaches the last tree built, or `tree=` if given, to that object,
    creating the object if needed. Errors print as `ERROR Type: message` plus the
    failing line of your script. Pass `traceback=True` only when that isn't enough.
    
    ## Saving context
    
    | Need | Cheap way | Avoid |
    |---|---|---|
    | Find a node | `python3 tools/describe.py --search "points on faces"` or `agent.search(...)` | grepping `api/nodes.py` (9k+ lines) |
    | A node's sockets | `python3 tools/describe.py set_position mesh_to_points` or `agent.describe(...)` | reading the generated function source |
    | Shader / compositor nodes | `tools/describe.py --tree shader ...`, `agent.describe(..., tree="compositor")` | grepping `api/shader_nodes.py` / `api/compositor_nodes.py` |
    | Check a build | `agent.run(...)` / `tools/run.py` report, or `agent.status()` after a live-edit save | raw `exec` with full tracebacks; screenshots |
    | Understand an existing tree | `agent.describe_tree("Name")` (node group, material or world): prints it as Geometry Script calls, without default values | dumping `node_tree.nodes` / links |
    | Know the API | this file | the book in `book/` (longer) |
    | See the result | report stats first; then MCP `get_screenshot_of_area_as_image(area_ui_type="VIEW_3D", size_limit_in_bytes=200000)` | `get_screenshot_of_window_as_image` (the whole window) |
    | A `bpy` (not node) question | MCP `search_api_docs` / `get_python_api_docs` | guessing, or long `dir()` dumps |
    
    Describe only the nodes you're unsure of, and several in one call. Most names
    are the node's UI name in snake_case, and the error will tell you if you're wrong.
    
    ## Writing trees
    
    ```python
    from geometry_script import *
    
    @tree("Scatter Cubes")                       # group name; rebuilt in place if it exists
    def scatter_cubes(geometry: Geometry, count: int = 4, size: float = 0.3):
        mesh = grid(size_x=4.0, size_y=4.0, vertices_x=count, vertices_y=count).mesh
        points = mesh_to_points(mesh=mesh).points
        cube_mesh = cube(size=(size, size, size)).mesh     # socket tuples -> Combine XYZ
        lifted = set_position(geometry=points, offset=(0.0, 0.0, size * 2)).geometry
        return instance_on_points(points=lifted, instance=cube_mesh).instances
    ```
    
    - **Inputs:** parameter annotations and defaults become group inputs: `Geometry`, `float`,
      `int`, `bool`, `str`, `Vector`, `Color`, `Rotation`, `Matrix`, `Menu`, `Object`,
      `Material`, `Collection`, `Image`, plus `Field[T]`, `Grid[T]`, `Vector2`. Return one
      value, a tuple, or a dict `{"Output Name": value}` for named outputs.
    - **Node functions take keyword arguments only** and return a namedtuple of outputs:
      `mesh_to_points(mesh=m).points`. Enum settings are strings: `mode="FACES"`.
      Type settings (`data_type`, `input_type`) are inferred from what you link, so
      set them only to override.
    - **Arithmetic** (`+ - * / % **`, unary `-`) on float, int and vector sockets
      adds Math / Vector Math nodes. Comparisons (`< <= > >= == !=`) add a
      Compare node and give a boolean socket: `z > 0.5`, `index().index % 2 == 0`.
      Combine them with `boolean_math`, not `and`/`or`/`not` or `0 < x < 1`.
      Fields such as `position().position` and `index().index` are plain sockets.
    - **Calling a `@tree` function inside another `@tree`** adds a group node. Those
      take positional arguments: `repeat_grid(geometry)`.
    - **Builds are all-or-nothing:** if a build raises, the previous tree (and its
      modifier input values) is left untouched. Modifiers keep their input values
      across rebuilds.
    - **Names that would shadow Python builtins get a trailing underscore:** `math_`
      (`math(...)` also works, and `math.pi` is still the math module), `id_`,
      `object_`, `string_`.
    
    ### Zones
    
    ```python
    @repeat_zone
    def climb(geometry: Geometry, step: float, iteration: int):   # `iteration` is the index
        return set_position(geometry=geometry, offset=(0.0, 0.0, step)).geometry, step * 2.0
    
    @simulation_zone
    def fall(geometry: Geometry, delta_time: float):
        return set_position(geometry=geometry, offset=(0.0, 0.0, -1.0)).geometry
    
    @for_each_element(domain="POINT")
    def per_point(index: int, radius: float):
        return ForEachResult(main={"scale": radius * 2.0},
                             generated=[{"geometry": uv_sphere(radius=radius).mesh}])
    
    @closure_zone
    def scale(x: float, factor: float = 2.0):
        return x * factor
    
    @tree("Zones")
    def zones(geometry: Geometry):
        climbed = climb(geometry, 1.0, iterations=4).geometry
        out = per_point(mesh_to_points(mesh=climbed).points, radius=0.25)
        value = scale.evaluate(scale(), 1.0, 3.0)
        return {"Geometry": fall(out.generated.geometry), "Value": value}
    ```
    
    ### Shaders, materials, worlds and the compositor
    
    Each tree type has its own module of node functions; names like `normal`, `mix`
    or `object_info` mean different nodes in each. A node used in the wrong tree
    raises an error naming the module it belongs to.
    
    ```python
    from geometry_script import *            # geometry nodes, @tree / @geometry
    from geometry_script import shader as sh # @sh.shader, @sh.material, @sh.world
    from geometry_script import compositor as comp
    
    @sh.shader("Stripes")                    # shader node group: works like @tree
    def stripes(color: Color = (0.9, 0.3, 0.1, 1.0), scale: float = 6.0):
        wave = sh.wave_texture(scale=scale)
        return sh.mix(data_type="RGBA", factor=wave.factor, a=color, b=(0, 0, 0, 1)).result
    
    @sh.material("Striped")                  # no parameters; return the surface shader,
  • README.mdupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

Plain-text copy, no login: /skill-bundles/carson-katri-geometry-script-skills-geometry-script.md

// REPO STATS

390 stars
29 open issues
Last commit: 1mo ago