HEGoAssetNode
Inherits: HEGoTransformableInputReceiverNode < HEGoTransformableNode < HEGoBaseNode < HEGoTrackableNode < RefCounted
Represents an instantiated Houdini Digital Asset (HDA) node.
Description
Use this class to instantiate an HDA by operator name, set parameters, cook, and fetch output data.
Call HEGoBaseNode.instantiate() after assigning op_name. Most data-access methods require a valid instantiated node; when called before instantiation they log an error and return an empty value.
fetch_points() expects a resource compatible with HEGoFetchPointsConfig. fetch_surfaces() expects a resource compatible with HEGoFetchSurfacesConfig.
Properties
|
|
Methods
void |
|
void |
cook() |
|
|
|
fetch_curves(read_prim_attribs: |
|
fetch_heightfield_layer_image(part_id: |
|
|
|
fetch_points(fetch_point_config: |
|
fetch_surfaces(fetch_surface_config: |
|
get_heightfield_layers(read_prim_attribs: |
|
|
|
|
|
|
void |
insert_multiparm_instance(parm_id: |
void |
remove_multiparm_instance(parm_id: |
void |
set_parm(parm_name: |
void |
set_preset(preset: |
Property Descriptions
String op_name = "" 🔗
void set_op_name(value:
String)Stringget_op_name()
Houdini operator name used by HEGoBaseNode.instantiate() to create the asset node.
Method Descriptions
void instantiate() 🔗
Instantiates the HDA node from op_name.
If op_name is empty, the call logs an error and does not create a node.
On success, the created node id is stored and this wrapper is registered in the session manager. On failure, the node remains invalid and an error is logged.
void cook() 🔗
Cooks the asset node and waits until cooking is finished.
Use this when auto_cook is disabled on fetch calls and you want explicit cook control.
int cook_async() 🔗
Starts cooking the asset node without blocking.
Because the HAPI session is initialized with use_cooking_thread=true, this call returns immediately (returns 0 on success, -1 on error). Houdini performs the actual cook in its own internal thread.
Poll HEGoAPI.poll_cook_state() once per frame to detect completion:
hego_asset_node.cook_async()
while HEGoAPI.get_singleton().poll_cook_state() > 3:
await get_tree().process_frame
Array fetch_curves(read_prim_attribs: PackedStringArray = PackedStringArray(), read_point_attribs: PackedStringArray = PackedStringArray(), auto_cook: bool = true) 🔗
Fetches all curve parts from the cooked asset as an Array of Dictionary entries.
Each curve entry contains:
type: curve type, one of CURVE_TYPE_BEZIER, CURVE_TYPE_NURBS, or CURVE_TYPE_LINEAR.
order: curve order.
positions: PackedVector3Array of control point positions for this curve.
knots: PackedFloat32Array of knot values, present only when the curve has knots.
prim_attribs: Array of {name, value} dictionaries for each attribute listed in read_prim_attribs.
point_attribs: Array of {name, value} dictionaries for each attribute listed in read_point_attribs.
If auto_cook is true, the node is cooked before reading.
Returns an empty array when the node is not instantiated, the session is invalid, or geometry cannot be read.
Image fetch_heightfield_layer_image(part_id: int, auto_cook: bool = true) 🔗
Fetches one heightfield layer as an Image from the specified part id.
If auto_cook is true, the node is cooked before reading.
Returns an invalid image reference when the node is not instantiated or the requested part cannot be read.
Array fetch_output() 🔗
Returns cooked output geometry data.
Note: in the current C++ implementation this method returns an empty Array placeholder.
Dictionary fetch_points(fetch_point_config: Resource, auto_cook: bool = true) 🔗
Fetches point data using a point-fetch configuration resource.
Config fields are interpreted as follows:
only_loose_points: when true, points referenced by mesh vertices are excluded.
filter_attribs and filter_attrib_values: paired by index; a point is kept only if all point_attr == filter_value checks pass.
filter_attribs and filter_attrib_values should have the same length.
read_attribs: extra point attributes to fetch at leaf level (in addition to P, which is always included).
split_attribs: point attributes used to build nested dictionary groups.
The method reads from the display mesh part of the cooked node. If auto_cook is true, the node is cooked first.
Output structure:
If split_attribs is empty, the result is a flat dictionary with leaf keys.
If split_attribs is non-empty, each split attribute adds one nesting level keyed by that attribute’s value.
Leaf dictionaries contain:
ids: filtered point indices in the source point array.
P: Array of Vector3 positions.
Additional keys from read_attribs, each mapped to an Array aligned with ids.
Returns an empty dictionary when no points pass filters, when no mesh part exists, or when geometry query or cook fails.
Dictionary fetch_surfaces(fetch_surface_config: Resource, auto_cook: bool = true) 🔗
Fetches surface data using a surface-fetch configuration resource.
Config fields are interpreted as follows:
normal, color, uv, uv2, tangents: toggles for point-derived channels included in generated Godot surface arrays.
read_attribs, filter_attribs, filter_attrib_values, split_attribs: primitive-attribute lists used for metadata readback, filtering, and grouping.
filter_attribs and filter_attrib_values are paired by index.
filter_attribs and filter_attrib_values should have the same length.
The method reads the display mesh part. If auto_cook is true, it cooks before reading.
Output structure:
If split_attribs is empty, the root is a single leaf dictionary.
If split_attribs is non-empty, result is nested by split attribute values.
Each leaf contains:
surface_array: a Godot Mesh.ARRAY_MAX-sized array usable with ArrayMesh.add_surface_from_arrays(), including at minimum vertices and indices; optional channels are present depending on config and source attributes.
ids: filtered primitive ids local to the current filtered set.
Any primitive attributes requested through read_attribs, each as an Array aligned with ids.
Returns an empty dictionary when no mesh part exists, no faces are available, no elements pass filters, or when geometry query or cook fails.
Array get_heightfield_layers(read_prim_attribs: PackedStringArray = PackedStringArray(), auto_cook: bool = true) 🔗
Returns available heightfield layers from the cooked asset.
Use read_prim_attribs to request primitive attributes that should be included in each returned layer entry.
Each returned array entry is a dictionary-like payload from HEGo heightfield utilities and can include metadata and image data depending on utility behavior.
PackedStringArray get_input_names() 🔗
Returns the input names defined on this HDA node.
This is useful for mapping script-side inputs to operator input slots.
Dictionary get_parms_dict() 🔗
Returns a dictionary describing the current parameter values.
The dictionary is intended for inspection and tooling workflows and mirrors parameter state read from HAPI.
PackedByteArray get_preset() 🔗
Serializes current parameter state as a Houdini preset blob.
Use together with set_preset() to save and restore HDA parameter setups.
void insert_multiparm_instance(parm_id: int, index: int) 🔗
Inserts one multiparm instance at index for the parameter id.
Use this to grow multiparm blocks before setting values on newly created entries.
void remove_multiparm_instance(parm_id: int, index: int) 🔗
Removes one multiparm instance at index for the parameter id.
Indices follow Houdini multiparm ordering.
void set_parm(parm_name: String, value: Variant) 🔗
Sets a parameter by name.
The Variant value type is converted to the matching Houdini parameter storage type when possible.
Call after HEGoBaseNode.instantiate(). Invalid node state is logged and ignored.
void set_preset(preset: PackedByteArray) 🔗
Applies a serialized Houdini parameter preset to this asset.
The preset payload should come from get_preset() or a compatible Houdini preset source.
Class Registration
Kind: Concrete