pub struct HoudiniNode {
pub handle: NodeHandle,
pub session: Session,
pub info: Arc<NodeInfo>,
}
Expand description
Represents a Houdini node
Fields§
§handle: NodeHandle
§session: Session
§info: Arc<NodeInfo>
Implementations§
Source§impl HoudiniNode
impl HoudiniNode
Sourcepub fn to_top_node(self) -> Option<TopNode>
pub fn to_top_node(self) -> Option<TopNode>
Convert this node instance into TopNode
pub fn name(&self) -> Result<String>
Sourcepub fn path_relative(&self, to: impl Into<Option<NodeHandle>>) -> Result<String>
pub fn path_relative(&self, to: impl Into<Option<NodeHandle>>) -> Result<String>
Returns node’s path relative to another node.
Sourcepub fn cook(&self) -> Result<()>
pub fn cook(&self) -> Result<()>
Start cooking the node. This is a non-blocking call if the session is async.
Sourcepub fn cook_blocking(&self) -> Result<CookResult>
pub fn cook_blocking(&self) -> Result<CookResult>
Start cooking the node and wait until completed.
In sync mode (single threaded), the error will be available in Err(..) while
in threaded cooking mode the status will be in CookResult
Sourcepub fn cook_with_options(
&self,
options: &CookOptions,
blocking: bool,
) -> Result<CookResult>
pub fn cook_with_options( &self, options: &CookOptions, blocking: bool, ) -> Result<CookResult>
Start cooking with options and wait for result if blocking = true.
Sourcepub fn cook_count(
&self,
node_types: NodeType,
node_flags: NodeFlags,
recurse: bool,
) -> Result<i32>
pub fn cook_count( &self, node_types: NodeType, node_flags: NodeFlags, recurse: bool, ) -> Result<i32>
How many times this node has been cooked.
Sourcepub fn get_object_info(&self) -> Result<ObjectInfo<'_>>
pub fn get_object_info(&self) -> Result<ObjectInfo<'_>>
If the node is of Object type, get the information object about it.
Sourcepub fn get_objects_info(&self) -> Result<Vec<ObjectInfo<'_>>>
pub fn get_objects_info(&self) -> Result<Vec<ObjectInfo<'_>>>
Returns information objects about this node children.
Sourcepub fn find_children_by_type(
&self,
types: NodeType,
flags: NodeFlags,
recursive: bool,
) -> Result<Vec<NodeHandle>>
pub fn find_children_by_type( &self, types: NodeType, flags: NodeFlags, recursive: bool, ) -> Result<Vec<NodeHandle>>
Find all children of this node by type.
Sourcepub fn get_children(&self) -> Result<Vec<NodeHandle>>
pub fn get_children(&self) -> Result<Vec<NodeHandle>>
Get all children of the node, not recursively.
Sourcepub fn get_child_by_path(
&self,
relative_path: &str,
) -> Result<Option<HoudiniNode>>
pub fn get_child_by_path( &self, relative_path: &str, ) -> Result<Option<HoudiniNode>>
Get a child node by path.
Sourcepub fn get_instanced_object_ids(&self) -> Result<Vec<NodeHandle>>
pub fn get_instanced_object_ids(&self) -> Result<Vec<NodeHandle>>
Get the node ids for the objects being instanced by an Instance OBJ node.
Sourcepub fn find_child_node(
&self,
name: impl AsRef<str>,
recursive: bool,
) -> Result<Option<HoudiniNode>>
pub fn find_child_node( &self, name: impl AsRef<str>, recursive: bool, ) -> Result<Option<HoudiniNode>>
Search for child node by name.
Sourcepub fn get_sop_output_node(&self, index: i32) -> Result<NodeHandle>
pub fn get_sop_output_node(&self, index: i32) -> Result<NodeHandle>
Given if Self is an asset or a subnet SOP node, get its output node at index.
Sourcepub fn parent_node(&self) -> Option<NodeHandle>
pub fn parent_node(&self) -> Option<NodeHandle>
Return the node’s parent.
Sourcepub fn parameter(&self, name: &str) -> Result<Parameter>
pub fn parameter(&self, name: &str) -> Result<Parameter>
Find a parameter on the node by name. Err() means parameter not found.
Sourcepub fn parameter_with_tag(&self, tag: &str) -> Result<Option<Parameter>>
pub fn parameter_with_tag(&self, tag: &str) -> Result<Option<Parameter>>
Find a parameter with a specific tag
Sourcepub fn parameters(&self) -> Result<Vec<Parameter>>
pub fn parameters(&self) -> Result<Vec<Parameter>>
Return all node parameters.
Sourcepub fn asset_info(&self) -> Result<AssetInfo>
pub fn asset_info(&self) -> Result<AssetInfo>
If node is an HDA, return [`AssetInfo’] about it.
Sourcepub fn check_for_specific_error(&self, error_bits: i32) -> Result<ErrorCode>
pub fn check_for_specific_error(&self, error_bits: i32) -> Result<ErrorCode>
Recursively check all nodes for a specific error.
Sourcepub fn get_composed_cook_result_string(
&self,
verbosity: StatusVerbosity,
) -> Result<String>
pub fn get_composed_cook_result_string( &self, verbosity: StatusVerbosity, ) -> Result<String>
Compose the cook result (errors and warnings) of all nodes in the network into a string.
Sourcepub fn get_cook_result_string(
&self,
verbosity: StatusVerbosity,
) -> Result<String>
pub fn get_cook_result_string( &self, verbosity: StatusVerbosity, ) -> Result<String>
Get the cook errors and warnings on this node as a string
Sourcepub fn reset_simulation(&self) -> Result<()>
pub fn reset_simulation(&self) -> Result<()>
Resets the simulation cache of the asset.
Sourcepub fn input_node(&self, idx: i32) -> Result<Option<HoudiniNode>>
pub fn input_node(&self, idx: i32) -> Result<Option<HoudiniNode>>
Return a node connected to given input.
Sourcepub fn save_to_file(&self, file: impl AsRef<Path>) -> Result<()>
pub fn save_to_file(&self, file: impl AsRef<Path>) -> Result<()>
Saves the node and all its contents to file
Sourcepub fn load_from_file(
session: &Session,
parent: impl Into<Option<NodeHandle>>,
label: &str,
cook: bool,
file: impl AsRef<OsStr>,
) -> Result<HoudiniNode>
pub fn load_from_file( session: &Session, parent: impl Into<Option<NodeHandle>>, label: &str, cook: bool, file: impl AsRef<OsStr>, ) -> Result<HoudiniNode>
Loads and creates a previously saved node and all its contents from given file.
Sourcepub fn get_preset(&self, name: &str, preset_type: PresetType) -> Result<Vec<i8>>
pub fn get_preset(&self, name: &str, preset_type: PresetType) -> Result<Vec<i8>>
Returns a node preset as bytes.
Sourcepub fn set_preset(
&self,
name: &str,
preset_type: PresetType,
data: &[i8],
) -> Result<()>
pub fn set_preset( &self, name: &str, preset_type: PresetType, data: &[i8], ) -> Result<()>
Set the preset data to the node.
Sourcepub fn geometry(&self) -> Result<Option<Geometry>>
pub fn geometry(&self) -> Result<Option<Geometry>>
Return Geometry for this node if it’s a SOP node, otherwise find a child SOP node with display flag and return.
Sourcepub fn find_top_networks(&self) -> Result<Vec<HoudiniNode>>
pub fn find_top_networks(&self) -> Result<Vec<HoudiniNode>>
Search this node for TOP networks
Sourcepub fn number_of_geo_outputs(&self) -> Result<i32>
pub fn number_of_geo_outputs(&self) -> Result<i32>
How many geometry output nodes there is inside an Object or SOP node.
Sourcepub fn get_output_names(&self) -> Result<Vec<String>>
pub fn get_output_names(&self) -> Result<Vec<String>>
Get names of each HDA output
Sourcepub fn geometry_output_nodes(&self) -> Result<Vec<Geometry>>
pub fn geometry_output_nodes(&self) -> Result<Vec<Geometry>>
Return all output nodes as Geometry.
Sourcepub fn get_transform(
&self,
rst_order: Option<RSTOrder>,
relative_to: impl Into<Option<NodeHandle>>,
) -> Result<Transform>
pub fn get_transform( &self, rst_order: Option<RSTOrder>, relative_to: impl Into<Option<NodeHandle>>, ) -> Result<Transform>
If node is an Object, return it’s transform.
Sourcepub fn set_transform(&self, transform: &TransformEuler) -> Result<()>
pub fn set_transform(&self, transform: &TransformEuler) -> Result<()>
Set transform on the Object
Sourcepub fn set_transform_anim_curve(
&self,
component: TransformComponent,
keys: &[KeyFrame],
) -> Result<()>
pub fn set_transform_anim_curve( &self, component: TransformComponent, keys: &[KeyFrame], ) -> Result<()>
Set keyframes animation on the Object.
Sourcepub fn connect_input<H: Into<NodeHandle>>(
&self,
input_num: i32,
source: H,
output_num: i32,
) -> Result<()>
pub fn connect_input<H: Into<NodeHandle>>( &self, input_num: i32, source: H, output_num: i32, ) -> Result<()>
Connect output of another node into an input on this node.
Sourcepub fn output_connected_nodes(
&self,
output_index: i32,
search_subnets: bool,
) -> Result<Vec<NodeHandle>>
pub fn output_connected_nodes( &self, output_index: i32, search_subnets: bool, ) -> Result<Vec<NodeHandle>>
Get the nodes currently connected to the given node at the output index.
Sourcepub fn disconnect_input(&self, input_index: i32) -> Result<()>
pub fn disconnect_input(&self, input_index: i32) -> Result<()>
Disconnect a given input index.
Sourcepub fn disconnect_outputs(&self, output_index: i32) -> Result<()>
pub fn disconnect_outputs(&self, output_index: i32) -> Result<()>
Disconnect a given output index.
Sourcepub fn set_display_flag(&self, on: bool) -> Result<()>
pub fn set_display_flag(&self, on: bool) -> Result<()>
Set display flag on this node.
Sourcepub fn get_input_name(&self, input_index: i32) -> Result<String>
pub fn get_input_name(&self, input_index: i32) -> Result<String>
Get the name of a node’s input.
Sourcepub fn get_message_nodes(&self) -> Result<Vec<NodeHandle>>
pub fn get_message_nodes(&self) -> Result<Vec<NodeHandle>>
Get the ids of the message nodes specified in the HDA Type Properties
Trait Implementations§
Source§impl AsRef<NodeHandle> for HoudiniNode
impl AsRef<NodeHandle> for HoudiniNode
Source§fn as_ref(&self) -> &NodeHandle
fn as_ref(&self) -> &NodeHandle
Source§impl Clone for HoudiniNode
impl Clone for HoudiniNode
Source§fn clone(&self) -> HoudiniNode
fn clone(&self) -> HoudiniNode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more