Struct hapi_rs::node::HoudiniNode
source · 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
sourceimpl<'session> HoudiniNode
impl<'session> 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: Option<NodeHandle>) -> Result<String>
pub fn path_relative(&self, to: Option<NodeHandle>) -> Result<String>
Returns node’s path relative to another node.
sourcepub fn cook(&self, options: Option<&CookOptions>) -> Result<()>
pub fn cook(&self, options: Option<&CookOptions>) -> Result<()>
Start cooking the node. This is a non-blocking call if the session is async.
sourcepub fn cook_blocking(&self, options: Option<&CookOptions>) -> Result<CookResult>
pub fn cook_blocking(&self, options: Option<&CookOptions>) -> 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_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 the node has been cooked.
sourcepub fn create<H: Into<NodeHandle>>(
name: &str,
label: Option<&str>,
parent: Option<H>,
session: Session,
cook: bool
) -> Result<HoudiniNode>
pub fn create<H: Into<NodeHandle>>(
name: &str,
label: Option<&str>,
parent: Option<H>,
session: Session,
cook: bool
) -> Result<HoudiniNode>
Create a node in the session.
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 find_child_by_path(&self, relative_path: &str) -> Result<HoudiniNode>
pub fn find_child_by_path(&self, relative_path: &str) -> Result<HoudiniNode>
Get a child node by path.
sourcepub fn find_child_by_name(
&self,
name: impl AsRef<str>,
node_type: NodeType,
recursive: bool
) -> Result<Option<HoudiniNode>>
pub fn find_child_by_name(
&self,
name: impl AsRef<str>,
node_type: NodeType,
recursive: bool
) -> Result<Option<HoudiniNode>>
Search for child node by name.
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 parameters(&self) -> Result<Vec<Parameter>>
pub fn parameters(&self) -> Result<Vec<Parameter>>
Return all node parameters.
sourcepub fn asset_info(&'session self) -> Result<AssetInfo<'session>>
pub fn asset_info(&'session self) -> Result<AssetInfo<'session>>
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 cook_result(&self, verbosity: StatusVerbosity) -> Result<String>
pub fn cook_result(&self, verbosity: StatusVerbosity) -> Result<String>
Compose the cook result string (errors and warnings).
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: Option<NodeHandle>,
label: &str,
cook: bool,
file: impl AsRef<Path>
) -> Result<HoudiniNode>
pub fn load_from_file(
session: &Session,
parent: Option<NodeHandle>,
label: &str,
cook: bool,
file: impl AsRef<Path>
) -> 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 geometry_outputs(&self) -> Result<Vec<Geometry>>
pub fn geometry_outputs(&self) -> Result<Vec<Geometry>>
Return all output nodes as Geometry.
sourcepub fn get_transform(
&self,
rst_order: Option<RSTOrder>,
relative_to: Option<NodeHandle>
) -> Result<Transform>
pub fn get_transform(
&self,
rst_order: Option<RSTOrder>,
relative_to: 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.
Trait Implementations
sourceimpl Clone for HoudiniNode
impl Clone for HoudiniNode
sourcefn clone(&self) -> HoudiniNode
fn clone(&self) -> HoudiniNode
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more