Struct 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§

Source§

impl HoudiniNode

Source

pub fn to_top_node(self) -> Option<TopNode>

Convert this node instance into TopNode

Source

pub fn delete(self) -> Result<()>

Delete the node in this session.

Source

pub fn is_valid(&self) -> Result<bool>

Checks if the node valid (not deleted).

Source

pub fn name(&self) -> Result<String>

Source

pub fn path(&self) -> Result<String>

Returns node’s internal path.

Source

pub fn path_relative(&self, to: impl Into<Option<NodeHandle>>) -> Result<String>

Returns node’s path relative to another node.

Source

pub fn cook(&self) -> Result<()>

Start cooking the node. This is a non-blocking call if the session is async.

Source

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

Source

pub fn cook_with_options( &self, options: &CookOptions, blocking: bool, ) -> Result<CookResult>

Start cooking with options and wait for result if blocking = true.

Source

pub fn cook_count( &self, node_types: NodeType, node_flags: NodeFlags, recurse: bool, ) -> Result<i32>

How many times this node has been cooked.

Source

pub fn get_object_info(&self) -> Result<ObjectInfo<'_>>

If the node is of Object type, get the information object about it.

Source

pub fn get_info(&self) -> Result<NodeInfo>

Get a new NodeInfo even for this node.

Source

pub fn get_objects_info(&self) -> Result<Vec<ObjectInfo<'_>>>

Returns information objects about this node children.

Source

pub fn find_children_by_type( &self, types: NodeType, flags: NodeFlags, recursive: bool, ) -> Result<Vec<NodeHandle>>

Find all children of this node by type.

Source

pub fn get_children(&self) -> Result<Vec<NodeHandle>>

Get all children of the node, not recursively.

Source

pub fn get_child_by_path( &self, relative_path: &str, ) -> Result<Option<HoudiniNode>>

Get a child node by path.

Source

pub fn get_instanced_object_ids(&self) -> Result<Vec<NodeHandle>>

Get the node ids for the objects being instanced by an Instance OBJ node.

Source

pub fn find_child_node( &self, name: impl AsRef<str>, recursive: bool, ) -> Result<Option<HoudiniNode>>

Search for child node by name.

Source

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.

Source

pub fn parent_node(&self) -> Option<NodeHandle>

Return the node’s parent.

Source

pub fn parameter(&self, name: &str) -> Result<Parameter>

Find a parameter on the node by name. Err() means parameter not found.

Source

pub fn parameter_with_tag(&self, tag: &str) -> Result<Option<Parameter>>

Find a parameter with a specific tag

Source

pub fn parameters(&self) -> Result<Vec<Parameter>>

Return all node parameters.

Source

pub fn asset_info(&self) -> Result<AssetInfo>

If node is an HDA, return [`AssetInfo’] about it.

Source

pub fn check_for_specific_error(&self, error_bits: i32) -> Result<ErrorCode>

Recursively check all nodes for a specific error.

Source

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.

Source

pub fn get_cook_result_string( &self, verbosity: StatusVerbosity, ) -> Result<String>

Get the cook errors and warnings on this node as a string

Source

pub fn reset_simulation(&self) -> Result<()>

Resets the simulation cache of the asset.

Source

pub fn input_node(&self, idx: i32) -> Result<Option<HoudiniNode>>

Return a node connected to given input.

Source

pub fn rename(&self, new_name: impl AsRef<str>) -> Result<()>

Give the node a new name.

Source

pub fn save_to_file(&self, file: impl AsRef<Path>) -> Result<()>

Saves the node and all its contents to file

Source

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.

Source

pub fn get_preset(&self, name: &str, preset_type: PresetType) -> Result<Vec<i8>>

Returns a node preset as bytes.

Source

pub fn set_preset( &self, name: &str, preset_type: PresetType, data: &[i8], ) -> Result<()>

Set the preset data to the node.

Source

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.

Source

pub fn find_top_networks(&self) -> Result<Vec<HoudiniNode>>

Search this node for TOP networks

Source

pub fn number_of_geo_outputs(&self) -> Result<i32>

How many geometry output nodes there is inside an Object or SOP node.

Source

pub fn get_output_names(&self) -> Result<Vec<String>>

Get names of each HDA output

Source

pub fn geometry_output_nodes(&self) -> Result<Vec<Geometry>>

Return all output nodes as Geometry.

Source

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.

Source

pub fn set_transform(&self, transform: &TransformEuler) -> Result<()>

Set transform on the Object

Source

pub fn set_transform_anim_curve( &self, component: TransformComponent, keys: &[KeyFrame], ) -> Result<()>

Set keyframes animation on the Object.

Source

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.

Source

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.

Source

pub fn disconnect_input(&self, input_index: i32) -> Result<()>

Disconnect a given input index.

Source

pub fn disconnect_outputs(&self, output_index: i32) -> Result<()>

Disconnect a given output index.

Source

pub fn set_display_flag(&self, on: bool) -> Result<()>

Set display flag on this node.

Source

pub fn get_input_name(&self, input_index: i32) -> Result<String>

Get the name of a node’s input.

Source

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

Source§

fn as_ref(&self) -> &NodeHandle

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for HoudiniNode

Source§

fn clone(&self) -> HoudiniNode

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HoudiniNode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&HoudiniNode> for NodeHandle

Source§

fn from(n: &HoudiniNode) -> Self

Converts to this type from the input type.
Source§

impl From<&HoudiniNode> for Option<NodeHandle>

Source§

fn from(n: &HoudiniNode) -> Self

Converts to this type from the input type.
Source§

impl From<HoudiniNode> for NodeHandle

Source§

fn from(n: HoudiniNode) -> Self

Converts to this type from the input type.
Source§

impl From<HoudiniNode> for Option<NodeHandle>

Source§

fn from(n: HoudiniNode) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for HoudiniNode

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.