add_skeletal_mesh_socket
Add an undoable socket to a named bone on a skeletal mesh asset and save the mesh; copies to the skeleton when allowed.
Instructions
Add a socket on a named bone of a skeletal mesh asset (undoable) and save the mesh. A copy also goes to the mesh's skeleton, which is then saved too; when the skeleton already has a socket of that name, the mesh has no skeleton, or the skeleton is engine content or under a read-only root, no copy is made (added_to_skeleton false) and skeleton_note says why. Errors, writing nothing, when the mesh does not load, the mesh already has a socket of that name, or the bone is missing from the mesh or its skeleton. success is false when a changed package fails to save. Edit existing sockets with set_skeletal_mesh_socket_transform or rename_skeletal_mesh_socket; skeleton-only sockets with add_socket_to_skeleton_asset.
Returns: { socket_name: string, bone_name: string, socket_count: int, location_x: float, location_y: float, location_z: float, added_to_skeleton: bool, skeleton_path: string, skeleton_note: string?, saved: bool, save_error: string?, skeleton_saved: bool?, skeleton_save_error: string? }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| location | No | Optional [x, y, z] relative location | |
| rotation | No | PREFERRED: the OBJECT {"roll":R,"pitch":P,"yaw":Y} (any subset, absent axes are 0). The ARRAY form below is [pitch, yaw, roll] -- its index 2 is ROLL, NOT yaw, which once put a PlayerStart on its side. Optional [pitch, yaw, roll] relative rotation | |
| bone_name | Yes | Name of the bone to attach the socket to; it must exist in the mesh and, when the copy goes to the skeleton, in the skeleton too. | |
| socket_name | Yes | Name for the new socket; leading and trailing spaces are trimmed, and a name the mesh already has is an error. | |
| skeletal_mesh_path | Yes | Content path to the skeletal mesh asset |