Put a texture set on a material
r3_texture_applyWire a texture set to a material in a project: the colour map to map, the normal map to normalMap, the ambient-occlusion / roughness / metalness map to aoMap + roughnessMap + metalnessMap (for a set without metal its blue channel is 0, so a metal map left by an earlier set is replaced and the material's own metalness is kept), the SAME repeat on every map, the material colour white, roughness 1 and metalness 1 for a metallic set (THREE multiplies the colour map by the colour and the roughness map by the roughness: a grey #808080 colour would show the texture at half brightness, the default roughness 0.5 would halve every roughness; the colour's alpha, the opacity, is kept). A Color the material shares with another component is left as it is, and the material gets its own new white Color; the answer says which. Creates one Texture per map, or reuses a Texture of the project already on that image. MaterialStandard / Physical get every map; Lambert / Phong / Toon get map, normalMap and aoMap; Basic is refused (unlit). repeat is how often the tile repeats across the surface (both axes); or give worldSize in metres: a number for a square surface (1000 for a 1 km terrain with 1 m gravel), or {x, y} for its two sides ({"x": 2, "y": 40} for a 2 m × 40 m path), giving repeatX = x / the set's tile size and repeatY = y / it, so a long strip does not stretch the texture. Give neither and the mesh using the material is measured (its own geometry size times its scale, as r3_component_bounds measures; the two largest sides). Kept at once in the project's live copy: every R3 tab with the project open shows it.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"setId": "<setId>",
"projectId": "<projectId>",
"material": "<material>"
},
"name": "r3_texture_apply"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| setId | Yes | The texture set (r3_texture_create answers it). | |
| repeat | No | How often the texture repeats across the surface, on both axes and every map. | |
| material | Yes | The material to wire: its entityRef or id (r3_project_load), e.g. "material_ground". | |
| projectId | Yes | The project (r3_project_list). | |
| worldSize | No | Or: the surface size in metres, a number (square) or {x, y} (its two sides, e.g. {"x": 2, "y": 40} for a 2 m × 40 m path); repeatX = x / the set's tile size (1 m for the presets), repeatY = y / it. Neither given: the mesh(es) using the material are measured. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seq | No | ||
| answer | Yes | This answer in words: what was done, what R3 measured, decided or refused, and what to do next. The same text as the result's text block. Read it: the fields beside it are the data, this is the guidance. | |
| colour | Yes | ||
| repeat | Yes | ||
| repeatX | Yes | ||
| repeatY | Yes | ||
| scalars | Yes | ||
| material | Yes | ||
| measured | Yes | ||
| textures | Yes | ||
| projectId | Yes |