On this page |
|
Special groups and attributes are used when marshalling data between Houdini and Unity.
Standard Houdini Attributes ¶
Certain standard Houdini attributes are used when marshaling data between Houdini and Unity.
Attribute Name |
Description |
---|---|
|
position |
|
rotation |
|
color |
|
opacity |
|
normal |
|
uv |
|
additiona uv channels |
|
For object-level instancing, See Instancing |
Houdini to Unity ¶
This table lists special attributes which will be recognized when marshalling data from Houdini to Unity. Setting up those attributes on your asset will allow you to control and override some properties of the generated Unity geometry.
General ¶
Attribute Name |
Owner |
Type |
Description |
---|---|---|---|
|
prim, detail |
string |
Unity tag to set for generated GameObjects. Note that tag must already exist in Unity Editor scene |
|
prim, detail |
int |
Set to 1 to make generated GameObject static, or 0 for non-static |
|
prim, detail |
string |
Unity layer to set for generated GameObjects. Note that the layer must already exist in Unity Editor scene |
Instancers ¶
Attribute Name |
Owner |
Type |
Description |
---|---|---|---|
|
point, detail |
string |
Path in Unity project of an Asset to instance at the given owner transform. Should be relative to the project Assets folder example: Assets/Prefabs/Hero.prefab |
|
point, detail |
int |
Use the prefab’s original static, tag, and layer attributes when instancing (as opposed to the HDA parent’s). Takes precedence over |
|
point, detail |
string |
Prefix to append to instance objects example: |
|
point, detail |
int |
Indicates the name of another attribute to be used to split the instancers into multiple components depending on that second attributes values |
Level of Detail ¶
Attribute Name |
Owner |
Type |
Description |
---|---|---|---|
|
detail |
float array |
Transition screensizes for LOD levels (range should be 0 to 1 or 1 to 100) |
Materials ¶
Attribute Name |
Owner |
Type |
Description |
---|---|---|---|
|
prim, detail |
string |
Path in Unity of a Material asset to apply to a part. Should be relative to the project Assets folder example: Assets/Materials/HeroMat.mat |
Meshes ¶
Attribute Name |
Owner |
Type |
Description |
---|---|---|---|
|
point, detail |
int |
Generated meshes will be marked as readable if this is 1. By default, generated meshes are non-readable |
Terrain Data ¶
The following table lists special attributes which can be set on the height heightfield layer to specify an existing TerrainData asset file to used. A copy of the TerrainData asset file will be created on generation in Unity.
Attribute Name |
Owner |
Type |
Description |
---|---|---|---|
|
prim |
string |
Path in Unity project of a TerrainData asset to set as the Terrain Data. Relative to project Assets folder example: Assets/Terrain/terlayer.asset |
|
prim |
string |
Path to write the generated or copied TerrainData asset to |
|
point |
int |
Specifies the terrain tile of a scatter point. Useful for tree instancing with the tile split node |
Heightfield Layers ¶
The following table lists special attributes which can be set on heightfield layers in order to set the corresponding Terrain Layer properties on the generated Unity Terrain. Note that height and mask layers are ignored when creating Terrain Layers, so these attributes must be set on other heightfield layers.
Attribute Name |
Owner |
Type |
Description |
---|---|---|---|
|
prim |
string |
Path in Unity project of a TerrainLayer asset to set as the Terrain Layer. Relative to project Assets folder example: Assets/Terrain/base.terrainlayer |
|
prim |
string |
Path in Unity project of a Texture asset to set as the terrain layer’s diffuse texture. Relative to project Assets folder example: Assets/Texture/sand.png |
|
prim |
string |
Path in Unity project of a Texture asset to set as the terrain layer’s mask texture. Relative to project Assets folder |
|
prim |
string |
Path in Unity project of a Texture asset to set as the terrain layer’s normal texture. Relative to project Assets folder |
|
prim |
float |
Terrain layer’s normal scale (float of size 1) |
|
prim |
float |
Terrain layer’s shader’s metallic value (float of size 1, with value between 0 and 1) |
|
prim |
float |
Terrain layer’s shader’s smoothness value (float of size 1, with value between 0 and 1) |
|
prim |
float array |
Terrain layer’s shader’s specular color (float of size 4, with values between 0 and 1) |
|
prim |
float array |
Terrain layer’s texture’s tile offset (float of size 2) |
|
prim |
float array |
Terrain layer’s texture’s tile size (float of size 2) |
Terrain Detail Layers ¶
Attribute |
Description |
---|---|
|
Converts the height field layer to a detai llayer. Set a Primitive String on the layer with a value detail. |
unity_hf_detail_prototype_prefab
unity_hf_detail_prototype_texture
|
Set a Primitive Float attribute with a bend factor value. |
|
Set a Primitive Color (4 float) attribute with dry color value. |
|
Set a Primitive Color (4 float) attribute with healthy color value. |
|
Set a Primitive Float attribute with maximum height value. |
|
Set a Primitive Float attribute with maximum width value. |
|
Set a Primitive Float attribute with minimum height value. |
|
Set a Primitive Float attribute with minimum width value. |
|
Set a Primitive Float attribute with a noise spread value. |
|
Set a Primitive Integer attribute with a DetailRenderMode value of 0 for GrassBillboard, 1 for VertexLit, and 2 for Grass (Default). |
Detail Layers - Global Detail Properties ¶
-
On the height layer, the following attributes can be specified to set the detail values for the generated TerrainData:
Attribute |
Description |
---|---|
|
Set a Detail Integer attribute with value from 0 to 250 for Detail Distance |
|
Set a Detail Float attribute with value from 0 to 1 for Detail Density |
|
Set a Detail Integer attribute with value from 8 to 128 for Density Resolution Per Patch |
Tree Instances ¶
Tree Instances are defined using the following Point attributes after the HeightField Scatter node in the network. Automatically setting Terrain tree instances is only available for Unity 2019.1 or newer.
Attribute |
Description |
---|---|
|
Set the index (Integer) of the TreePrototype to use (starting at 0). The index refers to the TreePrototype definition described above |
|
Set the height scale (Float) of the TreePrototype |
|
Set the width scale (Float) of the TreePrototype |
|
Set the lightmap color (4 Float) of the TreePrototype |
|
Set the color (4 Float) of the TreePrototype |
|
Set the rotation of the TreePrototype |
Unity to Houdini ¶
This table lists special attributes which are created by the plug-in when marshaling data from Unity to Houdini.
These attributes will be available in Houdini when using Inputs to marshall data from Unity to Houdini.
These Standard Houdini Attributes will generally also be available: position (p), vertex colors (Cd, Alpha), normals (N) and UV sets (uv, uv2, uv3).
You can see these attributes and their values by troubleshooting the internal Houdini Scene (File ▸ Open Scene In Houdini) after initializing your asset’s Inputs.
Materials ¶
Attribute Name |
Owner |
Type |
Description |
---|---|---|---|
|
prim |
string |
Path in Unity of a Material asset to apply to the mesh. Should be relative to the project Assets folder. Automatically set when using an input mesh |
Inputs ¶
Attribute Name |
Owner |
Type |
Description |
---|---|---|---|
|
prim |
string |
Name of mesh’s owner GameObject. Automatically set when using an input mesh |
Groups ¶
Some special group names have naming schemes which specify generation behavior when marshalling data from Houdini to Unity.
Primitives that belong to collision groups will be separately created as Mesh Collider components and added to the output GameObject. The rendered_collision_geo
groups will have MeshRenderer and MeshFilter components as well.
Collision ¶
Colliders can be automatically added to generated meshes by using keywords in group names for geometry. These group names are:
Mesh Collision ¶
Group Name |
Description |
---|---|
|
Adds a non-convex, non-rendered mesh collider |
|
Adds a non-convex, rendered mesh collider |
Simple Collision ¶
Known as Unity Primitive Collision
Group Name |
Description |
---|---|
|
Adds a simple box collider (ignores geo in group). It will be an axis-aligned box with dimensions encapsulating all the vertices in the geo group |
|
Adds a simple sphere collider (ignores geo in group). It will be an axis-aligned sphere with dimensions encapsulating all the vertices in the geo group |
|
Adds a simple capsule collider (ignores geo in group). It will be an axis-aligned capsule with dimensions encapsulating all the vertices in the geo group |
|
Adds a simple box collider with geometry created as mesh. It will be an axis-aligned box with dimensions encapsulating all the vertices in the geo group |
|
Adds a simple sphere collider with geometry created as mesh. It will be an axis-aligned sphere with dimensions encapsulating all the vertices in the geo group |
|
Adds a simple capsule collider with geometry created as mesh. It will be an axis-aligned capsule with dimensions encapsulating all the vertices in the geo group |
Convex Collision ¶
Group Name |
Description |
---|---|
|
Adds a convex non-rendered mesh collider |
|
Adds a convex, rendered mesh collider |
Triggers collision ¶
Group Name |
Description |
---|
Add trigger in the names above in order to convert the collider into a trigger (i.e. enable the Is Trigger toggle). Note that for Mesh Colliders, they must be convex. The geometry will be generated as a separated mesh from other geometry, and set as the mesh in the MeshCollider component.
-
convex_collision_geo_trigger
-
rendered_convex_collision_geo_trigger
-
collision_geo_simple_trigger_box
-
collision_geo_simple_trigger_sphere
-
collision_geo_simple_trigger_capsule
-
rendered_collision_geo_simple_trigger_box
-
rendered_collision_geo_simple_trigger_sphere
-
rendered_collision_geo_simple_trigger_capsule
Level of Detail ¶
|
Prefix used for defining mesh LOD level (e.g. lod0, lod1) |
Attributes Store ¶
The Attributes Store feature allows to store attribute data in a script component (HEU_OutputAttributesStore
) attached to the generated gameobject. This allows to bring in any supported attribute type (ints, floats, strings) from Houdini into Unity, to access them at a later point in time.
To use this feature for an HDA:
-
Create attributes for points, primitives, or detail for a SOP geometry inside the HDA, with name and values set.
-
Create another attribute with name
hengine_attr_store
of class Detail and type String. -
Specify the names of the attributes that you want stored, separated by commas (e.g. health,ammo,armor).
In Unity, when the HDA is cooked, the generated gameobject will have HEU_OutputAttributesStore
script component attached. It will contain a map of attributes, which can be queried via script.
You can also store Houdini native attributes such as P, rot, N, uv, etc.
Optionally, you can attach a script to be called back automatically that can query and assign values from the attribute store. Check out the example HDA provided in Assets/Plugins/HoudiniEngineUnity/HDAs/HEUInstanceAttributesStore.hda.