HEGoHeightfieldInputNode
Inherits: HEGoBaseInputNode < HEGoTransformableNamedNode < HEGoTransformableNode < HEGoBaseNode < HEGoTrackableNode < RefCounted
Builds Houdini HeightField input layers from Godot images.
Description
This node creates or recreates a HeightField input network and writes voxel data for height, mask, and any additional named layers.
Each layer entry in the input dictionary is expected to be a dictionary with optional image (Image) and attrs (Dictionary) keys. The first valid image determines resolution. Missing height or mask layers are auto-generated as zero-filled layers.
Layer names are normalized to lowercase and trimmed before processing.
Calling set_layers() rebuilds the internal heightfield input node network for the new layer payload.
Methods
void |
|
void |
set_layers(layers: |
Method Descriptions
void instantiate() 🔗
Creates a Houdini HeightField input network for this wrapper.
If the node is already instantiated, the call returns immediately.
The method requires an active Houdini session. On success, it stores the main node id plus internal height, mask, and merge node ids, then registers this wrapper with the session manager.
On failure, all stored ids are reset to invalid values and an error is logged.
void set_layers(layers: Dictionary, voxel_size: float = 1.0, height_scale: float = 1.0) 🔗
Uploads all supplied layers into a newly created HeightField input node.
voxel_size must be greater than 0 and controls XY world scale. height_scale must be greater than 0 and is applied only to the height layer values.
Expected layers structure:
{
"height": {
"image": Image, # optional but usually provided
"attrs": { # optional primitive attributes
"name": Variant
}
},
"mask": {
"image": Image,
"attrs": {}
},
"water": {
"image": Image,
"attrs": {
"hego_material": "Mud",
"hego_lod": 1
}
}
}
How entries are interpreted:
Top-level keys are layer names (for example
height,mask,water).Each top-level value should be a
Dictionary. Non-dictionary entries are skipped.imageshould be anImage. If present, it is sampled to voxel values.attrsis optional primitive metadata written onto that layer volume.
Resolution and defaults:
The first valid
imagefound across all layers sets the heightfield resolution.If no valid image exists in any layer, the call logs an error and returns without writing layers.
If
heightand/ormaskare missing, they are created as zero-filled layers.Extra layers beyond
heightandmaskare created as additional heightfield volume nodes.
Notes on values:
height_scaleaffects only theheightlayer.Layer images are converted or resized as needed to match the final resolution.
Primitive
attrsvalues are expected to bebool,int,float,String, orVector3.
Failure behavior:
If
voxel_sizeorheight_scaleis less than or equal to0, the call is rejected.If no active Houdini session exists, layer upload cannot proceed.
Any HAPI node creation or write failure logs an error and aborts the current layer build.
Class Registration
Kind: Concrete