flatten_usd
Flatten a USD stage into one file by resolving references, payloads, and sublayers, so you can hand the entire scene to another tool as a single USD file.
Instructions
Write a stage flattened into one USD file: its references, payloads and sublayers resolved into a single layer.
Use it to hand the whole scene to another tool as one file; save_scene keeps the references and writes only the root layer, and export_prim_as_file writes one prim's subtree. Leave input_path empty for the open stage, or name a USD file: one the open stage has loaded, its own file included, is flattened as Kit holds it, unsaved edits too, and the open stage is left as it is; one USD can't open is an error. output_path is overwritten, but one the open stage has loaded (its own file, a sublayer, a referenced or payload file) is an error, since writing it would replace a file the open scene is made of: name another path, or save the open stage with save_scene. Textures and other files the stage points at are not copied.
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": {
"output_path": "<output_path>"
},
"name": "flatten_usd"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input_path | No | The USD file to flatten, on Kit's machine; the open stage, unsaved edits too, when empty | |
| output_path | Yes | The USD file to write, on Kit's machine; overwritten if there, but never one the open stage has loaded |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |