inspect_node_shape_file.py¶
Utility functions for inspecting and loading Houdini node shape files.
This module provides functionality to read, parse, and apply node shape data from JSON files. It handles:
- Loading shape files
- Applying shape data to nodes
- Generating shape statistics
- Parameter management
Functions:
Name | Description |
---|---|
clear_parameters |
Reset shape parameters |
generate_statistics |
Calculate shape bounds |
fill_node_shape_parameters |
Apply shape data to node |
clear_parameters(kwargs)
¶
Clear node shape parameters to default values.
Resets all node shape parameters back to their original default values, including size, path, and curve parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kwargs
|
Dict[str, Any]
|
Node callback kwargs containing: - node: The HDA node instance whose parameters should be cleared |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Raises:
Type | Description |
---|---|
KeyError
|
If required kwargs are missing |
RuntimeError
|
If parameters cannot be reset |
Example
on_clear_parameters({'node': hou.node('/obj/myHDA')})
Source code in nodes/inspect_node_shape_file.py
fill_node_shape_parameters(kwargs)
¶
Fill node parameters based on JSON shape file contents.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kwargs
|
Dict[str, Any]
|
Node callback kwargs containing target node |
required |
Notes
- Clears existing parameters first
- Handles flags, outline, inputs/outputs
- Sets proper node name and comment
- Maintains proper parameter organization
- Updates statistics after loading
Example
fill_node_shape_parameters({"node": node})
Raises:
Type | Description |
---|---|
ValueError
|
If shape file is invalid or missing required data |
Source code in nodes/inspect_node_shape_file.py
generate_statistics(kwargs)
¶
Calculate and display shape element bounds statistics.
Analyzes the geometric bounds of various shape elements and updates label parameters with the information.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kwargs
|
Dict[str, Any]
|
Node callback kwargs containing node to analyze |
required |
Notes
- Calculates bounds for shapes, inputs/outputs, icons
- Updates label parameters with formatted information
- Uses node's digit precision setting
- Handles different geometry types appropriately
Example
generate_statistics({"node": shape_node})