pub struct Session { /* private fields */ }
Expand description
Implementations
sourceimpl Session
impl Session
sourcepub fn session_type(&self) -> SessionType
pub fn session_type(&self) -> SessionType
Return SessionType
current session is initialized with.
sourcepub fn connection_type(&self) -> &ConnectionType
pub fn connection_type(&self) -> &ConnectionType
Return enum with extra connection data such as pipe file or socket.
sourcepub fn set_server_var<T: EnvVariable + ?Sized>(
&self,
key: &str,
value: &T::Type
) -> Result<()>
pub fn set_server_var<T: EnvVariable + ?Sized>(
&self,
key: &str,
value: &T::Type
) -> Result<()>
Set environment variable on the server
sourcepub fn get_server_var<T: EnvVariable + ?Sized>(
&self,
key: &str
) -> Result<<T::Type as ToOwned>::Owned>
pub fn get_server_var<T: EnvVariable + ?Sized>(
&self,
key: &str
) -> Result<<T::Type as ToOwned>::Owned>
Get environment variable from the server
sourcepub fn get_server_variables(&self) -> Result<StringArray>
pub fn get_server_variables(&self) -> Result<StringArray>
Retrieve all server variables
sourcepub fn get_string(&self, handle: i32) -> Result<String>
pub fn get_string(&self, handle: i32) -> Result<String>
Retrieve string data given a handle.
sourcepub fn cleanup(&self) -> Result<()>
pub fn cleanup(&self) -> Result<()>
Cleanup the session. Session will not be valid after this call and needs to be initialized again
sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Check if session is initialized
sourcepub fn create_input_node(&self, name: &str) -> Result<Geometry>
pub fn create_input_node(&self, name: &str) -> Result<Geometry>
Create an input geometry node which can accept modifications
sourcepub fn create_input_curve_node(&self, name: &str) -> Result<Geometry>
pub fn create_input_curve_node(&self, name: &str) -> Result<Geometry>
Create an input geometry node with crate::enums::PartType
set to Curve
sourcepub fn create_node<'a>(
&self,
name: impl AsRef<str>,
label: impl Into<Option<&'a str>>,
parent: Option<NodeHandle>
) -> Result<HoudiniNode>
pub fn create_node<'a>(
&self,
name: impl AsRef<str>,
label: impl Into<Option<&'a str>>,
parent: Option<NodeHandle>
) -> Result<HoudiniNode>
Create a node. name
must start with a network category, e.g, “Object/geo”, “Sop/box”
New node will not be cooked.
sourcepub fn find_node_from_path(
&self,
path: impl AsRef<str>,
parent: Option<NodeHandle>
) -> Result<HoudiniNode>
pub fn find_node_from_path(
&self,
path: impl AsRef<str>,
parent: Option<NodeHandle>
) -> Result<HoudiniNode>
Find a node given an absolute path. To find a child node, pass the parent
node
or use HoudiniNode::find_child_by_path
sourcepub fn find_parameter_from_path(
&self,
path: impl AsRef<str>
) -> Result<Option<Parameter>>
pub fn find_parameter_from_path(
&self,
path: impl AsRef<str>
) -> Result<Option<Parameter>>
Find a parameter by its absolute path
sourcepub fn get_manager_node(&self, node_type: NodeType) -> Result<ManagerNode>
pub fn get_manager_node(&self, node_type: NodeType) -> Result<ManagerNode>
Returns a manager (root) node such as OBJ, TOP, CHOP, etc
sourcepub fn save_hip(&self, name: &str, lock_nodes: bool) -> Result<()>
pub fn save_hip(&self, name: &str, lock_nodes: bool) -> Result<()>
Save current session to hip file
sourcepub fn load_hip(&self, path: impl AsRef<Path>, cook: bool) -> Result<()>
pub fn load_hip(&self, path: impl AsRef<Path>, cook: bool) -> Result<()>
Load a hip file into current session
sourcepub fn merge_hip(&self, name: &str, cook: bool) -> Result<i32>
pub fn merge_hip(&self, name: &str, cook: bool) -> Result<i32>
Merge a hip file into current session
sourcepub fn load_asset_file(&self, file: impl AsRef<Path>) -> Result<AssetLibrary>
pub fn load_asset_file(&self, file: impl AsRef<Path>) -> Result<AssetLibrary>
Load an HDA file into current session
sourcepub fn get_status(&self, flag: StatusType) -> Result<State>
pub fn get_status(&self, flag: StatusType) -> Result<State>
Get session state of a requested crate::enums::StatusType
sourcepub fn is_cooking(&self) -> Result<bool>
pub fn is_cooking(&self) -> Result<bool>
Is session currently cooking. In non-threaded mode always returns false
sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Explicit check if the session is valid. Many APIs do this check in the debug build.
sourcepub fn get_status_string(
&self,
status: StatusType,
verbosity: StatusVerbosity
) -> Result<String>
pub fn get_status_string(
&self,
status: StatusType,
verbosity: StatusVerbosity
) -> Result<String>
Get the status message given a type and verbosity
sourcepub fn get_cook_result_string(
&self,
verbosity: StatusVerbosity
) -> Result<String>
pub fn get_cook_result_string(
&self,
verbosity: StatusVerbosity
) -> Result<String>
Get session cook result status as string
sourcepub fn cooking_total_count(&self) -> Result<i32>
pub fn cooking_total_count(&self) -> Result<i32>
How many nodes need to cook
sourcepub fn cooking_current_count(&self) -> Result<i32>
pub fn cooking_current_count(&self) -> Result<i32>
How many nodes have already cooked
sourcepub fn cook(&self) -> Result<CookResult>
pub fn cook(&self) -> Result<CookResult>
In threaded mode wait for Session finishes cooking. In single-thread mode, immediately return See Documentation
sourcepub fn get_connection_error(&self, clear: bool) -> Result<String>
pub fn get_connection_error(&self, clear: bool) -> Result<String>
Retrieve connection error if could not connect to engine instance
sourcepub fn lock(&self) -> ReentrantMutexGuard<'_, ()>
pub fn lock(&self) -> ReentrantMutexGuard<'_, ()>
Lock the internal reentrant mutex. Should not be used in general, but may be useful in certain situations when a series of API calls must be done in sequence
sourcepub fn set_timeline_options(&self, options: TimelineOptions) -> Result<()>
pub fn set_timeline_options(&self, options: TimelineOptions) -> Result<()>
Set Houdini timeline options
sourcepub fn get_timeline_options(&self) -> Result<TimelineOptions>
pub fn get_timeline_options(&self) -> Result<TimelineOptions>
Get Houdini timeline options
sourcepub fn set_use_houdini_time(&self, do_use: bool) -> Result<()>
pub fn set_use_houdini_time(&self, do_use: bool) -> Result<()>
Set session to use Houdini time
sourcepub fn get_viewport(&self) -> Result<Viewport>
pub fn get_viewport(&self) -> Result<Viewport>
Get the viewport(camera) position
sourcepub fn set_viewport(&self, viewport: &Viewport) -> Result<()>
pub fn set_viewport(&self, viewport: &Viewport) -> Result<()>
Set the viewport(camera) position
sourcepub fn get_sync_info(&self) -> Result<SessionSyncInfo>
pub fn get_sync_info(&self) -> Result<SessionSyncInfo>
Get session sync info
sourcepub fn set_sync_info(&self, info: &SessionSyncInfo) -> Result<()>
pub fn set_sync_info(&self, info: &SessionSyncInfo) -> Result<()>
Set session sync info
sourcepub fn get_license_type(&self) -> Result<License>
pub fn get_license_type(&self) -> Result<License>
Get license type used by this session
sourcepub fn render_cop_to_image(
&self,
cop_node: impl Into<NodeHandle>,
image_planes: impl AsRef<str>,
path: impl AsRef<Path>
) -> Result<String>
pub fn render_cop_to_image(
&self,
cop_node: impl Into<NodeHandle>,
image_planes: impl AsRef<str>,
path: impl AsRef<Path>
) -> Result<String>
Render a COP node to an image file