Struct TopNode

Source
pub struct TopNode {
    pub node: HoudiniNode,
}
Expand description

A wrapper for HoudiniNode with methods for cooking PDG.

Fields§

§node: HoudiniNode

Implementations§

Source§

impl TopNode

Source

pub fn cook_async<F>(&self, all_outputs: bool, func: F) -> Result<()>

Start cooking a TOP node asynchronously. For each generated event, a user closure will be called with a CookStep argument.

The closure returns Result<ControlFlow<bool>> which is handled like this:

If its an Err(_) - bubble up the error. If it’s [ControlFlow::Break(bool)] then the bool is either to cancel the cooking or just break the loop and return. In case of [ControlFlow::Continue(_)] run until completion.

See the pdg_cook example in the /examples folder.

Source

pub fn cook_pdg_blocking(&self, all_outputs: bool) -> Result<()>

Trigger PDG cooking and wait for completion. If all_outputs is true and this TOP node is of topnet type, cook all network outptus. Results can then be retrieved from workitems with get_all_workitems()

Source

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

Get the graph(context) id of this node in PDG.

Source

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

Cancel cooking.

Source

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

Pause cooking process

Source

pub fn dirty_node(&self, clean_results: bool) -> Result<()>

Dirty the node, forcing the work items to regenerate.

Source

pub fn get_current_state(&self, context_id: Option<i32>) -> Result<PdgState>

Which this node current PdgState

Source

pub fn get_workitem(&self, workitem_id: WorkItemId) -> Result<PDGWorkItem<'_>>

Get the work item by id and graph(context) id.

Source

pub fn get_all_workitems(&self) -> Result<Vec<PDGWorkItem<'_>>>

Source

pub fn create_workitem( &self, name: &str, index: i32, context_id: Option<i32>, ) -> Result<PDGWorkItem<'_>>

Source

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

Trait Implementations§

Source§

impl Clone for TopNode

Source§

fn clone(&self) -> TopNode

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 TopNode

Source§

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

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

impl From<TopNode> for NodeHandle

Source§

fn from(value: TopNode) -> Self

Converts to this type from the input type.

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.