pub struct TopNode {
pub node: HoudiniNode,
}
Expand description
A wrapper for HoudiniNode
with methods for cooking PDG.
Fields§
§node: HoudiniNode
Implementations§
source§impl TopNode
impl TopNode
sourcepub fn cook_async<F>(&self, all_outputs: bool, func: F) -> Result<()>
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.
pub fn cook_pdg_blocking(&self) -> Result<()>
sourcepub fn get_context_id(&self) -> Result<i32>
pub fn get_context_id(&self) -> Result<i32>
Get the graph(context) id of this node in PDG.
sourcepub fn cancel_cooking(&self) -> Result<()>
pub fn cancel_cooking(&self) -> Result<()>
Cancel cooking.
sourcepub fn pause_cooking(&self) -> Result<()>
pub fn pause_cooking(&self) -> Result<()>
Pause cooking process
sourcepub fn dirty_node(&self, clean_results: bool) -> Result<()>
pub fn dirty_node(&self, clean_results: bool) -> Result<()>
Dirty the node, forcing the work items to regenerate.
sourcepub fn get_current_state(&self, context_id: Option<i32>) -> Result<PdgState>
pub fn get_current_state(&self, context_id: Option<i32>) -> Result<PdgState>
Which this node current PdgState
sourcepub fn get_workitem(&self, workitem_id: WorkItemId) -> Result<PDGWorkItem<'_>>
pub fn get_workitem(&self, workitem_id: WorkItemId) -> Result<PDGWorkItem<'_>>
Get the work item by id and graph(context) id.
pub fn get_all_workitems(&self) -> Result<Vec<PDGWorkItem<'_>>>
pub fn create_workitem( &self, name: &str, index: i32, context_id: Option<i32> ) -> Result<PDGWorkItem<'_>>
pub fn commit_workitems(&self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for TopNode
impl Send for TopNode
impl Sync for TopNode
impl Unpin for TopNode
impl !UnwindSafe for TopNode
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more