Scenario PATINA retexture
Overview
A mesh whose materials are flat colors or placeholders (an image-to-3D result, a whole diorama) becomes a PBR-shaded asset in three moves: group its materials into physical surface families, generate one seamless PATINA material per family on Scenario, and wire the five maps into Blender materials with vertices, faces, and transforms left unchanged. An optional film renders the original and the retextured scene along one camera path with the same lights, exposure, and cut, so the material response is the only thing that differs between the two panels. The film is rendered locally to present the 3D deliverable, never generated on Scenario, so the skill's output type stays 3D.
PATINA is Patina AI's material family on Scenario (tag
). This skill runs PATINA Material, the prompt-to-material member; the flat-texture members (Image to Maps, Material Extract) belong to
. Repainting a whole mesh with a 3D-to-3D texturing model is the
lane; this one keeps per-material control and editable Blender shaders. The agent's own steps stay on MCP; the bundled scripts (Blender 4.2 or newer, Python 3 with Pillow and numpy, ffmpeg) do the local repetition and never call Scenario. Connection and the core loop: the
skill. If a sibling skill named here is missing from your available skills, ask the user to install it (
npx skills add scenario-labs/skills --skill <name>
); unattended, proceed from tool schemas and flag the gap.
Quick reference
| Step | Tool | Notes |
|---|
| Scope | , | The source asset and the generation destination may live in different projects: pass the right pair on every call |
| Fetch the mesh | , then | , , , ; save with |
| Inventory | inventory.py in Blender | Writes and : per-material object counts, bounds, base color |
| Find PATINA | with , , | Pick PATINA Material (); before running |
| Price | with | One 1024x1024 five-map set was 17 CU at authoring time; , , , , and move it |
| Generate | with , one per family | Fixed per family; one over every |
| Identify maps | on each output | names the role; never rely on position |
| Download | , then | textures/<family>/<role>.png
|
| Apply | apply_materials.py in Blender | Manifest in materials-manifest.md; geometry hash asserted |
| Film | film.py , , | Config in film-config.md; resumable |
Material families
Read
, not the scene. Group materials by what the surface physically is (plaster, cedar, terracotta, glazed ceramic, brass, painted steel, glass, canvas, asphalt, foliage), reusing one family across color variants: the shader keeps each original color as a tint under the PATINA basecolor by default, so one plaster set serves cream, ochre, and grey walls. Split a shared color that sits on different surfaces (the same green on a canvas awning and a painted sign) with an
entry keyed by object-name prefix. A 41-material diorama needed 14 families; expect one job per family. Where the mesh already models bricks, roof tiles, or planks, prompt for the material of one element (fired clay, weathered cedar), never for the pattern: the geometry supplies the structure and a patterned map doubles it.
Generating one set per family
on the discovered id is the contract; the names below held at authoring time.
(required, 2048 characters) describes a flat, evenly lit, seamless physical surface with no objects or signage.
is an array even for one entry (a bare string is ignored); keep the default of all five.
and
run 512 to 2048 in steps of 16, 1024 by default, and
(128, about 1024 px) follows them: 256 for a 2048 set, or the repeat window no longer matches the texture.
2 or 4 enlarges the predicted maps only, not the base texture.
restricts the repeat to one axis for planks or corrugation.
returns up to 4 variants of one prompt, each priced.
is on by default: turn it off when the prompt is deliberate. Set
per family and keep it in the manifest so a family can be regenerated identically.
Keep
and
at the top level of
, beside
,
, and
; only model inputs belong under
. Price the exact payload with
(a cost estimate, not parameter validation), confirm the budget (families times cost), then launch every family with
and one
over all the job ids (32 per call), re-called with
on timeout rather than answered with a second
. On a transport error,
before re-running: the job usually landed.
With the default five
and
1, a completed job carried six asset ids at authoring time: the base texture (
inference-txt2img-texture
) and one asset per map, labeled
,
,
,
, and
;
multiplies the set. Treat the
values read back with
as the contract and map them to the five roles, never the order. The roughness request comes back labeled smoothness, and at authoring time the values were roughness (a brushed brass map read darker than a matte grey one), so the label is the trap, not the data:
that map for a family whose finish you know before touching
in the manifest, which inverts it when true.
each map (PNG by default) into
textures/<family>/<role>.png
, and record prompt, seed, job id, asset ids, scope pair, and billed
under the manifest's
.
Applying in Blender
blender --background --factory-startup --python scripts/inventory.py -- model.glb work/
imports the mesh (GLB, glTF, OBJ, or FBX) or opens a
, saves a packed
, and writes
. Write
mapping every material name to a family and every family to its five maps (the manifest reference has every key and default), then run
blender --background --factory-startup work/Before.blend --python scripts/apply_materials.py -- work/materials.json
. It validates the manifest, projects a dedicated
layer along each face's dominant axis at object scale so
means meters per repeat (a mesh shared by linked duplicates is made single-user first), builds one Principled BSDF per original material and family, packs the images, and asserts the geometry hash is unchanged. The
is the deliverable: a glTF export flattens the calibrated shader graph (the exporter carries only direct texture links), so bake before exporting to an engine. Open the result or render one still before spending render time on a film.
Comparison film
python3 scripts/film.py config.json pilot
renders both endpoints of every shot at half resolution for both passes and writes
with a rough time estimate. Fix framing and material defects from that sheet, then
renders at native resolution, resumes valid frames, saves both camera scenes as editable
files, and assembles and verifies the films;
prints progress. The run folder is fingerprinted from the inputs, the scripts, and the config, so a change to any of them starts a new folder. The entry points share
common.py and
scene.py, and
launches
worker.py inside Blender; none of the three is run directly.
Design shots from
bounds, not from the example plan, whose coordinates fit one asset. The fast preset (EEVEE, 24 samples, half-resolution ray-traced reflections with denoising, 12 fps sources interpolated to 24 fps for slow moves) ran at about a second per 2368x1332 frame on a laptop, so the example plan's 792 source frames per pass take roughly a quarter hour each; refine from
, and keep
24 for fast motion. Verify with
, sampled at 2 fps across the whole master: one still per shot passes a defect that fades in mid-shot. A clean encoder log is not visual approval.
Worked example: retexture a street diorama and film the comparison
- Use the team/project pair already authorized by the user, or enumerate with and and ask them to choose. Unattended without an authorized pair, stop before scoped calls and report the missing scope. on the diorama (an image-to-3D result: 41 materials, no image textures, 78K faces), , then
curl -fL -o work/street.glb "<url>"
.
- Inventory with ; group the 41 materials into families such as , , , , , , , , , and , with an override sending the awning objects to .
- for PATINA, then on the returned PATINA Material id; re-discover each session.
- with top-level on the exact family payloads. At authoring time, 17 CU per family made 238 CU for fourteen; use the current estimates. Proceed within an already authorized budget or ask the user to approve the total. Unattended without enough authorized budget, return the estimates and stop before generation.
- Fourteen calls with top-level , prompts such as "aged lime plaster wall, fine mineral grain, flat, evenly lit, seamless", fixed per family; one with all fourteen ids until every row is complete.
- on each output to read ; the smoothness-labeled plaster map to settle polarity; and every map into .
- Write (roughness ranges per family, as settled, with job ids and cost) and run ; open once.
- Copy example-config.json, replace the shots with ones framed from the inventory bounds, run in mode, inspect, then ; hand over the master, the sharing copy, both passes, and the two editable scenes, and name the interpolation used.
- Optional: follow the skill's multipart upload flow: with , ,
content_type: "video/mp4"
, and in bytes (omit ), PUT every part to its returned URL, then with the returned and the same scope. Only after completion returns the video asset id, file it with the source and the maps in a collection (, then : catalog tools, run through scenario_tool_execute_write
with their arguments under ).
Common mistakes
- Mapping outputs by position or by the field alone: read , and confirm the smoothness label's polarity before inverting.
- Prompting for bricks, tiles, or planks on a mesh that already models them: the pattern doubles.
- Asking a PATINA prompt for signage, objects, or lighting: it produces a material, not a scene.
- Regenerating a family because timed out or raised a transport error: re-call with , or first.
- Running the full film before a pilot, or approving it from one still per shot instead of the 2 fps sweep sheet.
- Editing the config or a script mid-run and expecting the render to resume: the fingerprint changed, so it starts fresh.
- Hardcoding the PATINA id or the 17 CU figure: re-discover with , re-price with .