Houdini Engine for Unreal
|
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.
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.
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:
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:
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.
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:
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:
The life for a given point in the file is set in the following way:
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.
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:
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Returns the number of rows (ignoring the title row) found in the CSV file.
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.
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.
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.
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.
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.
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.
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.
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.
Returns the life value for a given point.
If the asset does not contain life or alive values, -1.0 will be returned.
Returns the type value for a given point.
If the asset does not contain type values, -1 will be returned.