viewport_add
Add a SubViewport node to a Godot scene for off-screen rendering to a texture. Configure dimensions and parent node.
Instructions
Add a SubViewport node to a scene for rendering to texture.
Category: Viewport
Args: project_path: Path to the Godot project directory scene_path: Path to the scene file (relative to project) parent_node_path: Path to the parent node viewport_name: Name for the new viewport node width: Viewport width in pixels (default: 1024) height: Viewport height in pixels (default: 600)
Returns: Success message or error description
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": {
"project_path": "<project_path>",
"scene_path": "<scene_path>",
"parent_node_path": "<parent_node_path>",
"viewport_name": "<viewport_name>"
},
"name": "viewport_add"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes | ||
| scene_path | Yes | ||
| parent_node_path | Yes | ||
| viewport_name | Yes | ||
| width | No | ||
| height | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |