set_variant_selection
Selects a variant in a prim's variant set or clears a layer's selection, then waits until the viewport reflects the change.
Instructions
Select a variant in a prim's variant set, or clear a layer's selection, and wait until the viewport shows it.
By default the selection goes to Kit's session layer: it shows at once over what the files select, and save_scene leaves it out of the file, so a check leaves every file as it found it; it lasts until it is cleared or the stage is opened again. To keep one in the stage's file, use layer="edit_target", where edits go: the root layer, which save_scene writes, unless Kit's Layer window made a sublayer the edit target, which save_scene doesn't write; the answer names the layer. It is refused while the session layer holds a selection for the set, since that would hide it: clear that first with variant_name="". An extension older than the server writes every switch at the edit target and can't clear, and the answer warns. get_prim_properties' variant_sets line lists a prim's sets, their options and the layer holding each selection. A selection on an instance prim gives it a prototype of its own; a prim inside an instance is refused, naming the instance. An unknown set or variant is refused, listing those there (create_variant_structure makes them). Switch variants with this rather than execute_script: with Fabric Scene Delegate on before Kit 110 (Isaac Sim 5.x), it deactivates and reactivates the prim in the session layer around the switch, some 40 app updates, so the viewport drops the old geometry; otherwise it waits 5. compare_prims measures two variants and leaves the selection as it was.
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>",
"variant_set": "<variant_set>",
"variant_name": "<variant_name>"
},
"name": "set_variant_selection"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| layer | No | session: Kit's session layer, which no save writes, so every file stays as it is; edit_target: where edits go, the stage's root layer, which save_scene writes, unless Kit's Layer window made a sublayer the edit target | session |
| prim_path | Yes | The prim with the variant set | |
| variant_set | Yes | The variant set's name, e.g. "model" | |
| variant_name | Yes | The variant to select, e.g. "shell"; "" clears the layer's selection, so the one beneath shows again |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |