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.
Attribute Wrangle Example ¶
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.
Attributes and groups ¶
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 |
|
|
Vector3 representing the socket’s location |
|
|
Quaternion used for the socket’s location |
|
|
Vector3 representing the socket’s Scale |
|
string |
For the socket’s name |
|
string |
For the socket’s Tag |
Houdini to Unreal ¶
This table lists special attributes to set in an HDA and the plugin recognizes when you translate the Houdini data to Unreal outputs. You can setup these attributes on your assets to control and override some properties and behaviours of the generated Unreal outputs. See Attributes and Groups for more information.
Mesh Sockets ¶
Attribute Name |
Owner |
Type |
Description |
---|---|---|---|
|
point |
string |
Name of a mesh Socket generated by Point Groups |
|
point |
string |
Tag of a mesh Socket generated by Point Groups |
|
point |
string |
Name of an Actor to be automatically attached to a socket generated by Point Groups. In V2, this can also be a path to an asset that will be instantiateed as an Actor and attached to the socket |
|
detail |
float3 |
Vector3 representing a Mesh Socket’s location |
|
detail |
float4 |
Quaternion used for a Mesh Socket’s rotation |
|
detail |
float3 |
Vector3 representing a Mesh Socket’s Scale |
|
detail |
string |
Name of a generated Mesh Socket |
|
detail |
string |
Tag of a generated Mesh Socket |
|
detail |
string |
Name of an Actor to be automatically attached to |
Unreal to Houdini ¶
This table lists special attributes which are created by the plug-in when importing data from Unreal to Houdini. See Attributes and Groups for more information.
Mesh Sockets ¶
Attribute Name |
Owner |
Type |
Description |
---|---|---|---|
|
point |
string |
Name of a mesh Socket imported from the input object |
|
point |
int |
Tag of a mesh Socket imported from the input object |
|
float3 |
int |
Vector3 representing the location of the socket imported from the input object |
|
float4 |
string |
Quaternion representing the rotation of the socket imported from the input object |
|
float3 |
int |
Vector3 representing the scale of the socket imported from the input object |
|
detail |
string |
Name of the imported Mesh Socket |
|
detail |
string |
Tags of the imported Mesh Socket |
Groups ¶
Some special group names have naming schemes which specify generation behavior when marshalling data from Houdini to Unreal.