Houdini Engine for Unreal
 All Files Pages
Mesh Sockets

Mesh sockets are extremely useful if you want to attach something to your meshes in Unreal without having to parent and set the transform of the objects manually. Houdini Engine for Unreal supports the creation of mesh sockets either by using Point Groups or with Detail Attributes.

By default, found sockets are attached to meshes generated by the same part. If no valid meshes for that part are found, then the sockets will be attached to meshes created from the same geo as the sockets.

Set up

Using Point Groups

In order to do create mesh sockets, you just need to assign points to a point group starting with the mesh_socket prefix. The position (P) rotation (rot) and scale (scale) attributes of these points will be used to define the socket's transform. If the rotation attribute is not found, the socket's rotation can be deduced from the normal (N) attribute of the point if it's present. Please note that the rot attribute should be set as a quaternion (float 4) and not an euler angle.

You can define a socket's name by adding a string attribute to the points named mesh_socket_name, and a socket's Tag by using an attribute named mesh_socket_tag

Unreal_SocketsSpreadsheet.png

Spreadsheet view of 3 sockets name Top, Bottom and SIDE in a "socket_cube" group

The generated sockets can be displayed and edited in the static mesh editor, and you can attach actors to them like you normally would, either by drag and dropping an Actor on the asset in the world outliner or by using “Attach to” in the context menu.

Unreal_Sockets.png

View of the above sockets in Unreal's Static Mesh Editor

Using Detail Attributes

Alternatively, you can also create mesh sockets by using the following Detail Attributes:

mesh_socketX_pos (float 3) Vector3 representing the socket's location.
mesh_socketX_rot (float 4) Quaternion used for the socket's location.
mesh_socketX_scale (float 3) Vector3 representing the socket's Scale.
mesh_socketX_name (String) for the socket's name.
mesh_socketX_tag (String) for the socket's Tag.

X being the 0 based index of the socket.

Here's an example VEX snippet for creating two sockets:

v@socket0_pos = {0.5, 0.5, 0.5};
v@socket0_scale = {2, 2, 2};
s@socket0_name = "plip";
s@socket0_tag = "test";
s@socket0_actor = "Cube";

v@socket1_pos = {0, 0.5, 0};
v@socket1_scale = {0.5, 0.5, 0.5};
s@socket1_name = "plop";

When possible, using Detail Attributes is recommended over Point Groups, especially when using Packed Primitives.

Pre-assignement

You can pre-assign Actors to the sockets generated on Static Mesh Components by the plug-in.

This can be done by adding a string attribute named unreal_mesh_socket_actor containing the name of the actor that you want to assign to the socket. Multiple actors can be pre-assigned to a socket. This can be acheived simply by separating their names with , or ; (commas or semicolons).

The corresponding actors will automatically be attached to the sockets in Unreal upon cook.