Weathering, layer stacks and variations in Sampler with AI

Updated 2026-12-01 · MCP Pro for Sampler 0.1.0

Beyond photos, Sampler builds materials from a stack of layers: catalogue materials at the bottom, filters on top. MCP Pro for Sampler gives an AI client typed access to the whole stack, so it can build a material, weather it, tune it and make variations, checking the result as an image after each step.

Base colour, normal and roughness after heavy dirt and moss
recipe_weathering(effects=["dirt", "moss"], strength="heavy", seed=5) in the live test.

Find filters and materials

search_filters (with categories), search_materials, search_texture_generators and search_export_presets search Sampler's catalogue. describe_catalog_item lists an item's parameters before you use it, and import_resource brings in a .sbsar. Note that every asset you create also appears in Sampler's material library, so search_materials shows those too.

Build the layer stack

create_asset(name="M_Marble")
add_material(material="Marble", preset="Gold Marble")
add_filter(filter="Cracks", parameters={"cracks_color": "#402010"})
apply_layer_preset(layer="Cracks", preset="Heavy Cracks")
list_layers()

add_filter and add_material insert anywhere in the stack (position, below), with a preset and parameters in the same call. replace_layer, remove_layer, apply_layer_preset, reset_layer and set_layer_channels (restrict a layer to, say, roughness only) complete the set. flatten_layer and flatten_asset bake layers into one image layer and need confirm=true.

Layers are addressed by position (0 = bottom, -1 = top) or by name (Dirt#2 = the second "Dirt" from the bottom); assets by name or #index, defaulting to the selected asset.

Set parameters

get_parameters(layer="Cracks")
set_parameters(layer="Cracks", values={"cracks_width": 0.9, "cracks_color": "#402010"})

Parameters are addressed by identifier or label. Sliders are clamped to their declared range (Sampler itself does not clamp; pass clamp=false to skip), colours are #rrggbb, options are set by their name, toggles and vectors work as you would expect. blend=true reaches a layer's blend parameters. expose_parameter makes a parameter part of the exported .sbsar.

Weathering in one call

recipe_weathering(effects=["dirt", "rust", "scratches"], strength="medium", seed=7)

Effects: dirt, dust, rust, moss, snow, corrosion, oxidation, cracks, scratches, splatter, stains, wet, erosion and gum. The recipe stacks the filters on top, picks each filter's light or heavy preset for the strength (light / medium / heavy), sets seeds and returns a preview. Tune afterwards with set_parameters.

Texture generators and seeds

set_texture_generator plugs a generator (for example 'Hexagon' or 'Dirt' from search_texture_generators) into a layer's image input, with its own parameters (set_texture_generator_parameters). set_random_seed sets the seed on one layer or every layer of an asset, the quickest way to get a different look from procedural layers.

Variations

recipe_variations(count=4, vary_color=True, export_dir="D:/out/variations")

New seeds on every layer, optional hue shifts on layers that have one, each variation exported into its own folder if you give export_dir, all shown as one contact sheet. The original parameters are restored afterwards (unless keep_last=true) and the seeds are reported, so you can reproduce the one you like with set_random_seed.

Three variations labelled with their seeds
recipe_variations(count=3, vary_color=True, seed=3) in the live test.

Snapshots instead of undo

Sampler's Python API has no undo. Before experiments, ask for a snapshot:

snapshot_parameters(label="before dirt")
... experiments ...
restore_parameters(snapshot="before dirt")

A snapshot remembers every parameter value (layer and blend parameters, seeds) of an asset and lives until Sampler restarts. It does not bring back removed or flattened layers; save the project before those.

API limits

Get MCP Pro for Sampler
$12 once on itch.io (Early Access), updates included.

itch.io · $12

More guides