Save an Entity as a template
r3_entity_save_templateSave an Entity of a project as an entity template version: its members (the components bound to it, with the positions, rotations and colours they hold). Without templateId it updates the template the Entity was imported from (or makes a new one, under the Entity's id); asNew: true always makes a new template. Updating an existing template needs baseVersion, the version read with r3_entity_read: if the template changed since, nothing is saved and the answer names the current version. The project itself is not changed. The answer lists every reference a member holds to a component outside the Entity (outsideReferences): infrastructure (scene, world, camera, listener, renderer, transport) is expected and re-bound on import; anything else (a geometry or material left outside) is listed first, because an import into another project leaves it empty. The save is not refused for them.
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": {
"projectId": "<projectId>",
"entityRef": "<entityRef>"
},
"name": "r3_entity_save_template"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | What changed, kept with the version. | |
| asNew | No | true saves a NEW template, never updating one. | |
| entityRef | Yes | The Entity (its entityRef, or its id). | |
| projectId | Yes | The project holding the Entity. | |
| templateId | No | The template to update (default: the one the Entity came from, else a new one). | |
| baseVersion | No | The template version you read (r3_entity_read): required to update an existing template. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| 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. | |
| version | Yes | ||
| templateId | Yes | ||
| memberCount | Yes | ||
| versionCreated | Yes | ||
| outsideReferences | Yes | ||
| valueComponentCount | Yes |