set_prim_attribute
Set one attribute of a prim, such as light intensity, camera focal length, shape size, or display color, when no other tool handles that property.
Instructions
Set one attribute of a prim, such as a light's intensity or colour, a camera's focal length, a shape's size or radius, or a display colour.
Use it for an attribute no other tool sets; set_prim_transform, set_visibility, set_material and set_physics_properties set theirs. The attribute must exist on the prim: get_prim_properties lists them, a schema's included, and a name it lacks gets its closest names. The value is converted to the attribute's type, within the type's range; a token outside its allowed ones is written, with a note naming them. A change that alters a shape's box updates its authored extent, so get_prim_bounds follows. Refused, with nothing written: a relationship, an xform op, visibility, an animated attribute, one a stronger layer holds, a size change whose extent another layer or an animation holds, a prim inside an instance or a prototype, an inactive prim. By default (layer="auto") it writes where edits go, but Kit's own cameras and a viewport light rig's lights in Kit's session layer, which save_scene doesn't keep. layer="session" writes there for a check that must leave every file as it is; no tool takes such a value back, and a later write beneath it, at the edit target, is refused until the stage is opened again or execute_script removes it from the session layer. A physics value set while the simulation plays may reach PhysX only once it stops. A DistantLight comes at an intensity of 50,000, UsdLux's sunlight; a few thousand suits a viewport capture. The answer gives the value before and after, and the layer written.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The attribute, as get_prim_properties names it, e.g. "inputs:intensity" | |
| layer | No | auto: where edits go, but Kit's own cameras and a light rig's lights in Kit's session layer; session: Kit's session layer, which no save writes, for a check that must leave every file as it is; edit_target: where edits go | auto |
| value | Yes | Its new value in JSON: a number, true or false, a string or token, or a list for a vector, colour or array, e.g. [1, 0, 0] | |
| prim_path | Yes | Full USD path of the prim, e.g. "/World/Robot" |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |