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

In Unreal 4.20, an additional Houdini plug-in can be used, aimed at allowing Attributes data to be used in Unreal's new particle system, Niagara.

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

Niagara_Plugin.png

This plug-in adds an additional type of asset: Houdini CSV 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.

Houdini CSV Asset

Upon activating the plug-in, Houdini CSV assets are created upon importing .csv files exported from houdini using the niagara_rop node. The string data contained in the csv file will be processed and and all values converted to floats. Currently, only values that can be converted to float will be available (integers, vectors, colors etc..).

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

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

Niagara_EditInfo.png

The source title row display the original title row of the file, whereas the expanded/parsed titles can be seen in the Column Title Array. The source title row can be edited and will cause the file to reparsed. This can be useful if your CSV used incorrect naming conventions for Special Attributes

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

Niagara_HoverInfo.png

The Parsed Column title line displays the title value after being processed, and indicates the column indexes that should be used when accessing values in the file.

Special Attributes

The first line of the CSV file contains the name of all the attributes exported, and some special names can be used to identify special attributes, so they can then be easily accessed afterwards:

  • Position values should be stored as P, Px/Py/Pz, pos or X/Y/Z.
  • Time values should be stored as T or time.
  • Point IDs should be stored as id or #
  • Normal values should be stored as N, Nx/Ny/Nz.
  • Velocity values should be stored as v or Vx/Vy/Vz.
  • Color values should be stored as Cd or color.
  • Alpha values should be stored as Alpha or A (or can be stored as the 4th component of color values).
  • Life values can be stored as life or can be calculated by using an alive attribute.
  • Type values can be stored as type.

All these special attributes will be available easily via functions in the Data Interface, but other attributes will also be accessible via their column indexes.

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

If the Asset doesn't contain Point ID values, each row of the CSV file will be considered to be a unique point.

If the asset doesn't have time values, all points in the file are considered to have a time value of 0.0.

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

  • if the asset has alive values, the spawn time is set to the first time the point is seen alive.
  • if not, the spawn time is set to the time of the first row describing the point.

The life for a given point in the file is set in the following way:

  • if the asset has life values, the life of a point is set to its life at spawn.
  • if the asset has alive value, its life is calculated by the difference between the point's spawn time and it's death.
  • if the asset has none of the above, life value will be set to -1.0.

The type for a given point is 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 cloud data contained in the Houdini CSV 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 Array Info parameter to your module/emitter/system in Niagara, and selecting a Houdini CSV Asset for it.

The Data Interface will expose the following functions:

GetFloatValue

Niagara_GetFloatValue.png

Returns the float value at a given row and column in the CSV file.
Returns 0.0 if the Row/Column index are invalid.
Row: Index of the row (ignoring the title row) to read the value from.
Column: Index of the column to read the value from.

GetVectorValue

Niagara_GetVectorValue.png

Returns a Vector3 value for a given row and column in the CSV file.
Returns { 0.0, 0.0, 0.0 } if the Row/Column index are invalid.
The returned Vector3 is converted from Houdini's coordinate system to Unreal's ( Y and Z swapped, meter > centimeters )
Row: Index of the row (ignoring the title row) to read the value from.
Column: Index of the column to read the value from.

GetVectorValueEx

Niagara_GetVectorValueEx.png

Returns a Vector3 value for a given row and column in the CSV file.
Returns { 0.0, 0.0, 0.0 } if the Row/Column index are invalid.
Allows choosing how the Vector conversion is done.
Row: Index of the row (ignoring the title row) to read the value from.
Column: Index of the column to read the value from.
DoSwap: Indicates the vector Y and Z values should be swapped.
DoScale: Indicates the vector should be scale by 100.0 to convert meter values to centimeters.

GetPosition

Niagara_GetPosition.png

Returns the position value for a given row in the CSV file.
Returns { 0.0, 0.0, 0.0 } if the Row index is invalid or if the file doesn't contain position values.
The returned Vector3 is converted from Houdini's coordinate system to Unreal's. (swapped and scaled).
Row: Index of the row (ignoring the title row) to read the value from.

GetNormal

Niagara_GetNormal.png

Returns the normal value for a given row in the CSV file
Returns { 0.0, 0.0, 0.0 } if the Row index is invalid or if the file doesn't contain normal values.
The returned Vector3 is converted from Houdini's coordinate system to Unreal's. (swapped).
Row: Index of the row (ignoring the title row) to read the value from.

GetTime

Niagara_GetTime.png

Returns the time for a given row in the CSV file.
Returns 0.0 if the Row index is invalid or if the file doesn't contain time values.
Row: Index of the row (ignoring the title row) to read the value from.

GetVelocity

Niagara_GetVelocity.png

Returns the velocity for a given row in the CSV file.
Returns { 0.0, 0.0, 0.0 } if the row index is invalid or if the file doesn't contain velocity values.
The returned Vector3 is converted from Houdini's coordinate system to Unreal's. (swapped).
Row: Index of the row (ignoring the title row) to read the value from.

GetColor

Niagara_GetColor.png

Returns a Vecor4 value representing the color value for a given row in the CSV file.
If the CSV Asset does not have Alpha values, the returned value's alpha will default to 1.0.
White will be returned if the asset does not contain color values or if the row index is invalid.
Row: Index of the row (ignoring the title row) to read the value from.

GetPositionAndTime

Niagara_GetPositionAndTime.png

Returns the position and time for a given row in the CSV file.
Functions exactly like calling GetPosition and GetTime simultaneously.
Row: Index of the row (ignoring the title row) to read the value from.

GetNumberOfPoints

Niagara_GetNumberOfPoints.png

Returns the number of different points found in the CSV file.
If the file has Point ID values, this will return the number of different point in the file.
If not, this will return the number of rows in the file, as each row of the CSV file is considered to be a unique point.

GetNumberOfRows

Niagara_GetNumberOfRows.png

Returns the number of rows (ignoring the title row) found in the CSV file.

GetNumberOfColumns

Niagara_GetNumberOfColumns.png

Returns the number of columns found in the CSV file.
This might be different than the original file's number of columns, as Vector values are expanded by the plug-in when parsing the source file.

GetLastRowIndexAtTime

Niagara_GetLastRowIndexAtTime.png

Returns the last row index for a given time value, that is, the index of the last row with a time value smaller or equal to the desired Time.
If the CSV file doesn't have time values, this function will always return the index of the last row in the Asset.
If the desired Time value is smaller than the first time value in the asset, LastRowIndex will be set to -1.
If the desired Time value is higher than the last time value of the last row in the asset, LastRowIndex will be set to the index of the last row in the file.

GetPointIDsToSpawnAtTime

Niagara_GetPointIDsToSpawnAtTime.png

Returns the Point IDs (min, max) and number of points that should be spawned for a given time Value.
If the asset doesn't have Point ID values, this will return the row Indexes of the concerned points, as each row is then considered to be a unique point.
If the asset doesn't have time values, all points in the file are considered to have a time value of 0.0.

GetRowIndexesForPointAtTime

Niagara_GetRowIndexesForPointAtTime.png

Returns the previous and next row indexes for reading values in the asset for a given point at a given time value.
These row indexes can then be used to read values in the asset and interpolate between them for the supplied time value.
If the supplied time value corresponds exactly to a time value in the asset, both indexes values will be identical and the weight value will be set to 1.0.
If the time value is too early/late, and two valid indexes for it cant be found, the weight will be set to 1.0 or 0.0 and the two indexes will be identical.

GetPointPositionAtTime

Niagara_GetPointPositionAtTime.png

Returns the interpolated position for a given point at a given time value.
Returns { 0.0, 0.0, 0.0 } if the PointID is invalid.
If the Asset doesn't contain Point ID values, row indexes can be used instead, as each row of the CSV file is then considered to be a unique point.
If the asset doesn't have time values, all points in the file are considered to have a time value of 0.0.
The returned Vector3 is converted from Houdini's coordinate system to Unreal's (swapped and scaled), and linearly interpolated between the previous and next valid values for the given time value.

GetPointValueAtTime

Niagara_GetPointValueAtTime.png

Returns a float value for a given point in a given column at a given time.
Returns 0.0 if the PointID is invalid.
If the Asset doesn't contain Point ID values, row indexes can be used instead, as each row of the CSV file is then considered to be a unique point.
If the asset doesn't have time values, all points in the file are considered to have a time value of 0.0.
The returned float value is linearly interpolated between the previous and next valid values for the given time.

GetPointVectorValueAtTime

Niagara_GetPointVectorValueAtTime.png

Returns a Vector3 value for a given point in a given column at a given time.
Returns { 0.0, 0.0, 0.0 } if the PointID or Column index is invalid.
If the Asset doesn't contain Point ID values, row indexes can be used instead, as each row of the CSV file is then considered to be a unique point.
If the asset doesn't have time values, all points in the file are considered to have a time value of 0.0.
The returned Vector3 is converted from Houdini's coordinate system to Unreal's (swapped and scaled), and linearly interpolated between the previous and next valid values for the given time value.

GetPointVectorValueAtTimeEx

Niagara_GetPointVectorValueAtTimeEx.png

Returns a Vector3 value for a given point in a given column at a given time.
Returns { 0.0, 0.0, 0.0 } if the PointID or Column index is invalid.
If the Asset doesn't contain Point ID values, row indexes can be used instead, as each row of the CSV file is then considered to be a unique point.
If the asset doesn't have time values, all points in the file are considered to have a time value of 0.0.
The returned Vector3 is linearly interpolated between the previous and next valid values for the given time value.
The DoSwap and DoScale parameters can be used to choose how the Vector conversion is done.
DoSwap: Indicates the vector Y and Z values should be swapped.
DoScale: Indicates the vector should be scale by 100.0 to convert meter values to centimeters.

GetPointLife

Niagara_GetPointLife.png

Returns the life value for a given point.
If the asset does not contain life or alive values, -1.0 will be returned.

GetPointType

Niagara_GetPointType.png

Returns the type value for a given point.
If the asset does not contain type values, -1 will be returned.