Houdini Engine for Unreal
 All Files Pages
Instancers

Input

In version 2, instancers can be imported to Houdini when the Actor owning the Instanced Static Mesh Components is selected via a World Outliner Inputs.

The instanced mesh will be imported as a packed primitive, copied on each of the instanced points.

Foliage instances can be imported in a similar way, and will have the unreal_foliage attribute set.

Alternatively, you can decide to import a Static Mesh as a single attribute instance when checking the Import as reference checkbox.

Output

The plug-in supports outputting instances from an asset in different ways: by using Packed Primitives, Object Instancers or Attribute Instancers.

Instanced geometries are represented in Unreal as InstancedStaticMeshComponents by default, or HierarchicalInstancedStaticMeshComponents if the geometry instanced has multiple Level of Details . If you want to force the creation of HierarchicalInstancedStaticMeshComponents, even without LODs, you can add the unreal_hierarchical_instancer attribute and set its value to 1.

Instanced geometry or uassets will appear as instancers in the Houdini Outputs section of the Detail Panel, as shown below:

Unreal_InstancingInput.png

The geometry used by each instanced output can be replaced in Unreal, and can have a position, rotation and/or scale offset applied to it via the corresponding controls in the detail panel.

Packed Primitives

The recommended way to create instances via the plug-in is by using Packed primitives.

A simple way to use this method is to use a Copy To Points SOP with the Pack and Instance option enabled. You also have the option to use Pack Geometry Before Merging on Inputs.

Note
In version 2, an instancer will be created for packed primitives only if that packed primitive is copied more than once. "Single instance instancers" only create Static Mesh Components.

Object Instancers

Instancers can also be created by using the instance Object node.

In previous versions of Houdini Engine, object instancer was the only way to output instances. However, since support for packed primitives was added, using them is the recommended way to output instances over this.

Attribute Instancers

Besides instancing geometry generated by the HDA, instances can also be created from pre-existing Unreal assets.

This can be achieved using the unreal_instance attribute, and setting the attribute value to the asset's reference.

You are not limited to using only static meshes in this case, but the instanced asset must be convertible to a native Actor type. In that case, multiple instances of that Actor type will be created, and the generated instancer component will be a HoudiniInstancedActorComponent. This can be used to spawn pre-existing assets in the level using the generated instancer's point cloud.

In version 2, you also have the possibility to instantiate classes directly by using attribute instancers.

This is especially useful if you want to create instances of a class that cannot be saved as a uasset in the Content Browser, but can be instaniated as an Actor(for example, Lights, Volumes etc.. ). To do so, simply set the unreal_instance value to the name of the class you want to instantiate as Actor (unreal_instance = "PointLight").

Note
In order to be detected properly, attribute instancers need to be in a separate Part of the Geometry. Attribute instancer won't be detected if the points that they are assigned to is part of the main geometry.

In version 2, when an asset referenced by an attribute instancer could not be found, the plugin will create a default "asset not found" box mesh (hidden in-game by default) instead of ignoring the instancer. This can be enabled/disabled in the plugin settings via the Show default Mesh checkbox.

Splitting Instancers

There are some cases where you may want to split instancer outputs to multiple components. This could be to assign different materials to each instancer, or to get a finer grain control on the actors generated when baking.

In version 2, this can be achieved by using the unreal_split_attr string attribute. This attribute's value should be set to the name of another attribute, whose values will be used to control the splitting. (a separate instancer component will be created for each individual value of that attribute).

As an example, using the unreal_material attribute as the unreal_split_attr attribute (unreal_split_attr = "unreal_material") will create an instancer component for each material on the second attribute. If three different materials are used, the instancer will be split to three different instancer components.

Alternatively, you can use the unreal_split_instances attribute to create individual StaticMeshComponents instead of the instanced one. The unreal_instance_color primitive attribute can then be used to specify an override vertex-color to apply to each component that is created this way. This can be used to add some variation to the instances via the material.

Overriding

The geometry that is instanced is shown in a thumbnail picker. Overriding what is instanced can be done by pressing the drop down asset chooser to pick an asset from the list, or by dragging and dropping an asset from the content browser over the thumbnail.

If the geometry used by an instancer output is overridden with something other than a static mesh, or visa-versa, the corresponding component will be changed accordingly. For example you can choose a ParticleSystem asset, which results in AEmitter objects spawned at instance points. Likewise choosing a Blueprint asset will spawn Actor instances of that Blueprint.

Variations

Sometimes it is desirable to have random variations of instanced elements. For example if you have scattered rocks around a scene, you may want a few variations to add visual interest.

Variations can be added by pressing the **+** icon next to the instance thumbnail, this will result in an even probability distribution of instances between the two instanced inputs.

Multiple instance variations are displayed as Instancer output rows with a square bracket suffix.