Houdini Engine for Unreal
 All Files Pages
Houdini-Niagara Plug in

As of Unreal 4.25, the Houdini Niagara plugin should be downloaded from the SideFX Houdini Niagara GitHub page. The latest version of the plugin will only work with 4.25 and above.

That plug-in can be found under the FX category, and requires the Niagara plug-in to be activated.

This plug-in adds an additional type of asset: Houdini Point Cache Assets, containing various point attributes exported from Houdini, and also provides the custom Houdini-Niagara Data interface for parsing and processing those assets in Niagara.

Installation

  1. Download the latest release from GitHUb.
  2. Unzip the downloaded file.
  3. Copy the HoudiniNiagara folder into Your_Unreal_Project/Plugins folder.
  4. You can confirm v2.0 of the plugin has been installed by loading your project and navigating to Edit > Plugins and searching for "Houdini Niagara" in the Project section of the Plugins window.
Niagara_Plugin_v2.png

You can also build the plugin from source by following the instructions on the GitHub page.

Getting Started

The plugin includes a configured emitter, HoudiniNiagaraBasic, that can be used as the basis for most Niagara Systems that utilise an Houdini Point Cache. The required modules for reading an Houdinin Point Cache can be found below.

For a quick introduction to the workflow and various assets:

Modules

Init Houdini Point Cache

Emitter Spawn Group - This module tracks spawning info and ensures unique point ID's for each emitter.

Spawn Particles from Houdini Point Cache

Emitter Update Group - This module reads an Houdini Point Cache and spawns particles based on their age attribute relative to Emitter.LoopedAge.
SpawnGroup can be set if multiple caches need to be accessed in the same emitter.

Sample Spawned Houdini Point Cache

Particle Spawn Group - This module reads an Houdini Point Cache and sets the default attributes in the Houdini namespace. This module will only set the attribute for each particle once at spawn time. The Set Parameter module can then be used to set attributes like Particles.Position from Particles.Houdini.Position
SetLifetime sets Particles.Lifetime based on the 'life' attribute (if it exists).
SetVelocity sets Particles.Houdini.Velocity based on the 'v' attribute (if it exists).

Sample Houdini Point Cache

Particle Update Group - This module reads an Houdini Point Cache and updates the default attributes in the Houdini namespace based on Emitter.LoopedAge.
The Set Parameter module can then be used to set attributes like Particles.Position from Particles.Houdini.Position.
UseCustomAge, when enabled, allows the user to specify a custom attribute to control the time index used for reading point cache attributes.

Default Attributes

The sample modules will attempt to read the following attributes from an Houdini Point Cache. If an attribute does not exist the particle attribute will be set to 0.

  • Particles.Houdini.Position is set from P.
  • Particles.Houdini.Normal is set from N.
  • Particles.Lifetime is set from life.
  • Particles.Houdini.Color is set from Cd.
  • Particles.Houdini.Alpha is set from Alpha.
  • Particles.Houdini.Impulse is set from impulse.
  • Particles.Houdini.Force is set from force.
  • Particles.Houdini.Type is set from type.
  • Particles.Houdini.Velocity is set from v.
  • Particles.Houdini.Pscale is set from pscale.
  • Particles.Houdini.Orient is set from orient.

Custom Attributes

Custom attributes can be read by creating your own module.

This video shows how to do that.

Houdini Point Cache Asset

After the plugin has been enabled you can import .hbjson, .hjson and .hcsv files generated by the Niagara ROP in Houdini. hcsv has been deprecated in favor of the ascii and binary json file formats. The plugin supports float, vector (including color) and int values.

If vector or tuple values are exported, they will be expanded upon being parsed by the plug-in (so P will become P.x, P.y, P.z etc.).

Double clicking on a Houdini Point Cache Asset will show you the following properties on the file:

Niagara_EditInfo.png

This can be useful for checking the header info of the file - number of points, number of frames, etc. It will also list the array of attributes stored in the file.

Hovering your mouse on a Houdini Point Cache Asset in the Content Browser will display the following information on the available data:

Niagara_HoverInfo_v2.png

Special Attributes

The header of the point cache file contains the names of all the attributes exported. Certain attributes have built-in functions for getting their values:

  • Position values should be stored as P.
  • Time values should be stored as time. The Niagara ROP will add this attribute automatically or it can be set by the user.
  • Point IDs should be stored as id.
  • Normal values should be stored as N.
  • Velocity values should be stored as v.
  • Color values should be stored as Cd.
  • Alpha values should be stored as Alpha.
  • Life values should be stored as life.
  • Type values can be stored as type.
  • Impulse values should be stored as impulse.

If you want to update point position over time, Point IDs and time values are required.

The spawn time for a given point in the file is calculated in the following way:

  • if the asset has an age attribute, the spawn time is calculated by comparing age to time.
  • if the asset does not have age, when time==0, a particle will be spawned.

If the asset has a life attribute, this will directly set the lifetime of a particle. This can be disabled on the sample modules and set in the Emitter stack as well.

The type for a given point is set to its first type value. If the file doesn't contain type values, all points will have a type set to 0.

Houdini-Niagara Data Interface

In order to access the point cache data contained in the Houdini Point Cache Asset, the custom Houdini-Niagara Data Interface provided by the plug-in should be used.

The Data Interface can be accessed by adding a Houdini Point Cache Info parameter to your module/emitter/system in Niagara, and selecting a Houdini Point Cache Asset for it.

All the functions that get attributes from an Houdini Point Cache Asset require:
Houdini Point Cache Info - A reference to the Houdini Point Cache Asset.
PointID - A unique particle ID, usually Particles.Houdini.NID.
SampleIndex - An integer value of the index in a series of attribute values over time. Use the Get Sample Indexes for Point at Time or Get Last Sample Index function to get this value.
Time - The current time of the emitter, usually Emitter.LoopedAge.

The Data Interface will expose the following functions:

Get Sample Indexes for Point at Time

Returns the sample indexes for a given point at a given time. The previous index, next index and weight can then be used to Lerp between values.

Niagara_GetSampleIndexesForPointAtTime.png

Get Last Sample Index at Time

Returns the index of the last sample in the point cache that has a time value lesser or equal to the Time parameter.

Niagara_GetLastSampleIndexAtTime.png

Get Point IDs to Spawn at Time.

Returns the count and point IDs of the points that should spawn for a given time value. Refer to the Spawn Particles From Houdini Point Cache module for an implementation.

Niagara_GetPointIDsToSpawnAtTime_v2.png

Get Number Of Attributes

Return the number of attributes in the cache.

Get Number Of Points

Return the number of points in the cache.

Get Numberf Of Samples

Return the number of samples in the cache.

Get Color

Returns the color value for a given Sample Index in the point cache.

Niagara_GetColor.png

Get Float Value

Returns the float value in the point cache for a given Sample Index and Attribute Index.

Niagara_GetFloatValue.png

Get Float Value by String

Returns the float value in the point cache for a given Sample Index and Attribute name.

Niagara_GetFloatValueByString.png

Get Impulse

Return the impulse value for a given Sample Index in the point cache.

Niagara_GetImpulse.png

Get Normal

Return the normal value for a given Sample Index in the point cache. The returned Normal vector is converted from Houdini's coordinate system to Unreal's.

Niagara_GetNormal.png

Get Point Alpha at Time

Returns the linearly interpolated alpha for a given point at a given time.

Niagara_GetPointAlphaAtTime.png

Get Point Color at Time

Returns the linearly interpolated color for a given point at a given time.

Niagara_GetPointColorAtTime.png

Get Point Impulse at Time

Returns the linearly interpolated impulse for a given point at a given time.

Niagara_GetPointImpulseAtTime.png

Get Point Life

Returns the life value for a given point when spawned. The life value is either calculated from the alive attribute or is the life attribute at spawn time.

Niagara_GetPointLife.png

Get Point Life at Time

Returns the remaining life for a given point in the point cache at a given time.

Niagara_GetPointLifeAtTime.png

Get Point Normal at Time

Returns the linearly interpolated normal for a given point at a given time. The returned vector is converted from Houdini's coordinate system to Unreal's.

Niagara_GetPointNormalAtTime.png

Get Point Position at Time

Returns the linearly interpolated position for a given point at a given time. The returned Position vector is converted from Houdini's coordinate system to Unreal's.

Niagara_GetPointPositionAtTime.png

Get Point Quat Value at Time

Returns the linearly interpolated quaterion value in the specified attribute index for a given point at a given time.
The DoHoudiniToUnrealConversion parameter indicates if the vector4 should be converted from Houdini's coordinate system to Unreal's.

Niagara_GetPointQuatValueAtTime.png

Get Point Quat Value at Time by String

Returns the linearly interpolated Quat value in the specified attribute (by name) for a given point at a given time. The DoHoudiniToUnrealConversion parameter indicates if the vector should be converted from Houdini's coordinate system to Unreal's.

Niagara_GetPointQuatValueAtTimeByString.png

Get Point Type

Returns the integer type value for a given point when spawned.

Niagara_GetPointType.png

Get Point Type at Time

Returns the integer type value for a given point at a given time.

Niagara_GetPointTypeAtTime.png

Get Point Value at Time by String

Returns the linearly interpolated float value in the specified attribute (by name) for a given point at a given time.

Niagara_GetPointValueAtTimeByString.png

Get Point Vector4 Value at Time

Returns the linearly interpolated Vector4 value in the specified Attribute Index for a given point at a given time. The returned Vector is converted from Houdini's coordinate system to Unreal's.

Niagara_GetPointVector4ValueAtTime.png

Get Point Vector4 Value at Time by String

Returns the linearly interpolated Vector4 value in the specified attribute (by name) for a given point at a given time. The returned Vector is converted from Houdini's coordinate system to Unreal's.

Niagara_GetPointVector4ValueAtTimeByString.png

Get Point Vector Value at Time

Returns the linearly interpolated Vector value in the specified Attribute Index for a given point at a given time. returned Vector is converted from Houdini's coordinate system to Unreal's.

Niagara_GetPointVectorValueAtTime.png

Get Point Vector Value at Time by String

Returns the linearly interpolated Vector value in the specified attribute (by name) for a given point at a given time. The returned Vector is converted from Houdini's coordinate system to Unreal's.

Niagara_GetPointVectorValueAtTimeByString.png

Get Point Vector Value at Time Ex

Returns the linearly interpolated Vector value in the specified attribute index for a given point at a given time.
The DoSwap parameter indicates if the vector should be converted from Houdini's coordinate system to Unreal's.
The DoScale parameter decides if the Vector value should be converted from meters (Houdini) to centimeters (Unreal).

Niagara_GetPointVectorValueAtTimeEx.png

Get Point Vector Value at Time Ex by String

Returns the linearly interpolated Vector value in the specified attribute (by name) for a given point at a given time.
The DoSwap parameter indicates if the vector should be converted from Houdini's coordinate system to Unreal's.
The DoScale parameter decides if the Vector value should be converted from meters (Houdini) to centimeters (Unreal).

Niagara_GetPointVectorValueAtTimeExByString.png

Get Point Velocity at Time

Returns the linearly interpolated velocity for a given point at a given time. The returned vector is converted from Houdini's coordinate system to Unreal's.

Niagara_GetPointVelocityAtTime.png

Get Position

Returns the position value for a given sample index in the point cache file. The returned Position vector is converted from Houdini's coordinate system to Unreal's.

Niagara_GetPosition.png

Get Position and Time

Returns the position and time values for a given Sample Index in the point cache. The returned Position vector is converted from Houdini's coordinate system to Unreal's.

Niagara_GetPositionAndTime.png

Get Quat Value

Returns a Quat in the point cache for a given Sample Index and Attribute Index.
The DoHoudiniToUnrealConversion parameter indicates if the vector should be converted from Houdini's coordinate system to Unreal's.

Niagara_GetQuatValue.png

Get Quat Value by String

Returns a Quat in the point cache for a given Sample Index and Attribute Name.
The DoHoudiniToUnrealConversion parameter indicates if the vector should be converted from Houdini's coordinate system to Unreal's.

Niagara_GetQuatValueByString.png

Get Time

Returns the time value for a given Sample Index in the point cache.

Niagara_GetTime.png

Get Vector4 Value

Returns a Vector4 in the point cache for a given Sample Index and Attribute Index. The returned Vector is converted from Houdini's coordinate system to Unreal's.

Niagara_GetVector4Value.png

Get Vector4 Value by String

Returns a Vector4 in the point cache for a given Sample Index and Attribute name. The returned Vector is converted from Houdini's coordinate system to Unreal's.

Niagara_GetVector4ValueByString.png

Get Vector Value

Returns a Vector in the point cache for a given Sample Index and Attribute Index. The returned Vector is converted from Houdini's coordinate system to Unreal's.

Niagara_GetVectorValue.png

Get Vector Value by String

Returns a Vector in the point cache for a given Sample Index and Attribute name. The returned Vector is converted from Houdini's coordinate system to Unreal's.

Niagara_GetVectorValueByString.png

Get Vector Value Ex

Returns a Vector3 in the point cache for a given Sample Index and Attribute Index.
The DoSwap parameter indicates if the vector should be converted from Houdini's coordinate system to Unreal's.
The DoScale parameter decides if the Vector value should be converted from meters (Houdini) to centimeters (Unreal).

Niagara_GetVectorValueEx.png

Get Vector Value by String

Returns a Vector3 in the point cache for a given Sample Index and Attribute name.
The DoSwap parameter indicates if the vector should be converted from Houdini's coordinate system to Unreal's.
The DoScale parameter decides if the Vector value should be converted from meters (Houdini) to centimeters (Unreal).

Niagara_GetVectorValueExByString.png

Get Velocity

Returns a Vector3 in the point cache for a given Sample Index and Attribute name.
Returns the velocity value for a given Sample Index in the point cache. The returned velocity vector is converted from Houdini's coordinate system to Unreal's.

Niagara_GetVelocity.png