Add something to an R3 project
r3_factory_runAdd an object to an existing R3 project — a cube, sphere, terrain, lighting, a physics body, and so on. Each factory builds a complete, correctly-wired object (mesh + geometry + material + colour, already connected), so you never assemble components by hand. Kept at once in the project's live copy: every R3 tab with the project open shows it now, no editor needed and nothing to save (r3_editor_create is the same tool). The answer says what was kept and its seq. "name" names what you make ("Leg front left" → entityRef leg_front_left): the primary component (a cube's Mesh, a light), unique in the project (a name already used gets _2); its geometry and material take it too (leg_front_left_geometry, leg_front_left_material). Name parts when you make them (a later rename: r3_component_rename). "StudioLighting" lights a scene the way a photo studio does: one of R3's built-in HDR environments (studio, sunset, sky) as the scene's environment, so metal and glossy materials reflect, plus a key light. Use r3_factory_list to see the factories and their options.
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>",
"factory": "<factory>"
},
"name": "r3_factory_run"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | The name of what you make, e.g. "Leg front left" (at most 120 characters). Its entityRef, the name code uses, follows from it (leg_front_left). | |
| params | No | Factory options, e.g. {"color": 16711680, "position": {"y": 2}}. Every option has a default. Color is a packed RGB integer. Rotations are in RADIANS, not degrees: a quarter turn is Math.PI/2 ≈ 1.5708 (the R3 Inspector shows rotations in degrees: 90°). | |
| factory | Yes | Factory name, e.g. "Cube", "Sphere", "PhysicsCube". See r3_factory_list. | |
| projectId | Yes | The project to add to, from r3_project_create. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seq | No | ||
| roles | 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. | |
| created | Yes | ||
| factory | Yes | ||
| physics | Yes | ||
| projectId | Yes | ||
| componentCount | Yes |