add_static_mesh_socket
Add a socket to a UStaticMesh asset with optional relative location, rotation, scale, and tag, then save the mesh. Use to create attachment points for components or effects.
Instructions
Add a new socket to a UStaticMesh asset (package or object path) with an optional relative location, rotation, scale and tag, then save the mesh; no undo transaction. A socket_name the mesh already has is an error, and so is a location, rotation or scale that is not three numbers; both are checked before the mesh is touched. A failed save is an error, yet the socket stays on the mesh in memory. Edit an existing socket with set_static_mesh_socket_transform or rename_static_mesh_socket; list them with get_static_mesh_sockets; skeletal meshes use add_skeletal_mesh_socket.
Returns: { socket_name, socket_count, location_x, location_y, location_z, scale_x, scale_y, scale_z, tag }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tag | No | Free-form socket tag string (optional) | |
| scale | No | Socket relative scale as [x, y, z] (optional; defaults to 1,1,1) | |
| location | No | Socket relative location as [x, y, z] (optional) | |
| 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. Socket relative rotation as [pitch, yaw, roll] (optional) | |
| socket_name | Yes | Name for the new socket. | |
| static_mesh_path | Yes | Content path to the UStaticMesh asset. |