On this page |
Mesh sockets are 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 attach to meshes created from the same geo as the sockets.
Input ¶
You can import the mesh sockets found on input Static Meshes. When the Export Sockets checkbox is enabled on the input, the plugin automatically creates the point, groups, and attributes to the mesh’s sockets.
Output ¶
Using Point Groups ¶
To create mesh sockets, you need to assign points to a point group with the prefix mesh_socket
.
The position P
, rotation rot
, and scale scale
attributes of these points defines 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.
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
You can display and edit the generated sockets in the static mesh editor.
To attach actors to them, drag and drop an Actor on the asset in the World outliner or use the “Attach to” in the context menu.
Using Detail Attributes ¶
You can also create mesh sockets by using the following Detail Attributes: X being the 0 based index of the socket.
Command |
Function |
|
---|---|---|
|
Returns true if a valid Houdini Engine session is running/connected |
|
Name |
Type |
Description |
|
float 3 |
Vector3 representing the socket’s location |
|
float 4 |
Quaternion used for the socket’s location |
|
float 3 |
Vector3 representing the socket’s Scale |
|
string |
For the socket’s name |
|
string |
For the socket’s Tag |
Here’s an example VEX snippet that can be used in a attribute wrangle to create two sockets via detail attributes:
v\@mesh_socket0_pos = {0.5, 0.5, 0.5}; v\@mesh_socket0_scale = {2, 2, 2}; s\@mesh_socket0_name = "plip"; s\@mesh_socket0_tag = "test"; s\@mesh_socket0_actor = "Cube"; v\@mesh_socket1_pos = {0, 0.5, 0}; v\@mesh_socket1_scale = {0.5, 0.5, 0.5}; s\@mesh_socket1_name = "plop";
Detail Attributes is recommended over Point Groups, especially when using Packed Primitives.
Assignment ¶
You can assign existing actor assets from the content browser to the sockets generated on the Static Mesh Components.
-
Add a string attribute named
mesh_socket_actor
containing the name of the actor, path of or the path the asset.
Multiple actors can be pre-assigned to a socket. Separate their names with ,
or ;
(commas or semicolons).
An actor is created if the attribute is set to an asset and that path is valid. The matching actors automatically attaches to the sockets in Unreal upon cook.
Note
If multiple actors in the world match the mesh_socket_actor
attribute, they all assign to that socket. Also, if multiple sockets point to the same actor for pre assignement, only the last socket has the actor assigned.