export_prim_as_file
Export a prim's subtree to a standalone USD file, flattened with externally bound materials so the asset opens without the original scene and can be shared with another tool or project.
Instructions
Write one prim's subtree to a USD file of its own, flattened, with the materials it is bound to from outside the subtree, so the file opens without the scene.
The prim becomes / and the file's default prim, with the stage's up axis and units. Use it to hand one asset to another tool or project; flatten_usd writes the whole stage, save_scene the root layer as it is. 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. An error too when the prim doesn't exist. Textures and other files the subtree 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": {
"prim_path": "<prim_path>",
"output_path": "<output_path>"
},
"name": "export_prim_as_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prim_path | Yes | The root of the subtree to export | |
| output_path | Yes | The file to write on Kit's machine: .usd, .usda or .usdc, which a path without one gets; never one the open stage has loaded |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |