pub struct TopNode {
pub node: HoudiniNode,
}Expand description
A wrapper for HoudiniNode with methods for cooking PDG.
Fields§
§node: HoudiniNodeImplementations§
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.
Sourcepub fn cook_pdg_blocking(&self, all_outputs: bool) -> Result<()>
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()
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.