Screenshot a scene or model
godot_screenshotRender a Godot scene or .glb/.gltf model to PNG and compare it with a baseline to catch visual changes or blank frames.
Instructions
Render a scene, or a .glb/.gltf model framed by a camera and lit, to a PNG with Godot 4.7 (Compatibility renderer, works on software OpenGL; on Linux without a display it uses xvfb-run). Returns the picture and a short text: how much of each view is drawn and where, so you can tell an empty or off-screen picture even without reading the image, and a warning when it is blank (black, transparent, one colour). For a model, views front (from +Z, where models face), back, side, top and iso; several make a grid. width and height are per view; frames lets the scene settle before the picture. The PNG is written next to the model (car.glb gives car.png) or, for a scene, to .godot/godotwright/screenshot.png. An error result when Godot is missing or the scene cannot run. Use it to look at what you built. As a visual test: baseline: "auto" keeps the first picture in .godotwright/baselines/ (named after the scene or model, size and views; Godot does not import it, so commit it) and compares every later picture with it, pixel by pixel (renders are deterministic: fixed fps and fixed random seeds). Unchanged (not one pixel) gives text only (saves tokens). Any change gives the percent, the box of the largest change, the mean shift, up to five areas of change (and how far an area moved), where in the picture and a brightness shift, the diff picture (changed pixels in red, kept in .godot/godotwright/) and the new picture; beyond threshold (percent of pixels, default 0.5) it is an error result, within it a warning to look at the diff. tolerance (0-255, default 3) is how far a colour may move before a pixel counts as changed. baseline may also be a .png path inside the project, or a name (hud): .godotwright/baselines/hud.png (or in baseline_dir) with hud.json beside it, which keeps the scene, size, views and frames, so later calls need only the name and godotwright ci compares it on every pull request. update_baseline: true accepts the new picture as the baseline. Without Godot, godot_model_view shows a model as text; to check behaviour rather than looks, use godot_play.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "godot_screenshot"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | project folder, or a file or folder inside it (relative to the server's folder; default: the current project) | |
| model | No | a .glb or .gltf file to look at instead of a scene | |
| scene | No | the res:// scene to render (default: the main scene) | |
| views | No | camera views for a model or a 3D scene without a camera (default [iso]) | |
| width | No | width of one view (default 640) | |
| frames | No | frames to run before the picture (default 10) | |
| height | No | height of one view (default 360) | |
| baseline | No | compare with a baseline: "auto" (in .godotwright/baselines/, saved on the first run), a .png path inside the project, or a name (.godotwright/baselines/<name>.png with its settings in <name>.json) | |
| threshold | No | percent of pixels that may change before the picture counts as changed (default 0.5, or the named baseline's) | |
| tolerance | No | how far (0-255) a pixel's colour may move before it counts as changed (default 3, or the named baseline's) | |
| baseline_dir | No | folder of named baselines inside the project (default .godotwright/baselines; godotwright ci needs --baseline-dir for another one) | |
| update_baseline | No | save the new picture as the baseline instead of comparing (baseline defaults to auto) |