pub struct Session { /* private fields */ }
Expand description
Implementations§
Source§impl 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.
pub fn server_pid(&self) -> Option<u32>
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: StringHandle) -> Result<String>
pub fn get_string(&self, handle: StringHandle) -> Result<String>
Retrieve string data given a handle.
Sourcepub fn get_string_batch(&self, handles: &[StringHandle]) -> Result<StringArray>
pub fn get_string_batch(&self, handles: &[StringHandle]) -> Result<StringArray>
Retrieve multiple strings in batch mode.
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,
parent: Option<NodeHandle>,
) -> Result<Geometry>
pub fn create_input_node( &self, name: &str, parent: Option<NodeHandle>, ) -> Result<Geometry>
Create an input geometry node which can accept modifications
Sourcepub fn create_input_curve_node(
&self,
name: &str,
parent: Option<NodeHandle>,
) -> Result<Geometry>
pub fn create_input_curve_node( &self, name: &str, parent: Option<NodeHandle>, ) -> Result<Geometry>
Create an input geometry node with PartType
set to Curve
Sourcepub fn create_node(&self, name: impl AsRef<str>) -> Result<HoudiniNode>
pub fn create_node(&self, name: impl AsRef<str>) -> Result<HoudiniNode>
Create a node. name
must start with a network category, e.g, “Object/geo”, “Sop/box”,
in operator namespace was used, the full name may look like this: namespace::Object/mynode
If you need more creating options, see the Session::node_builder
API.
New node will not be cooked.
Sourcepub fn node_builder(&self, node_name: impl Into<String>) -> NodeBuilder<'_>
pub fn node_builder(&self, node_name: impl Into<String>) -> NodeBuilder<'_>
A builder pattern for creating a node with more options.
Sourcepub fn delete_node<H: Into<NodeHandle>>(&self, node: H) -> Result<()>
pub fn delete_node<H: Into<NodeHandle>>(&self, node: H) -> Result<()>
Delete the node from the session. See also HoudiniNode::delete
Sourcepub fn get_node_from_path(
&self,
path: impl AsRef<str>,
parent: impl Into<Option<NodeHandle>>,
) -> Result<Option<HoudiniNode>>
pub fn get_node_from_path( &self, path: impl AsRef<str>, parent: impl Into<Option<NodeHandle>>, ) -> Result<Option<HoudiniNode>>
Find a node given an absolute path. To find a child node, pass the parent
node
or use HoudiniNode::find_child_node
Sourcepub fn find_parameter_from_path(
&self,
path: impl AsRef<str>,
start: impl Into<Option<NodeHandle>>,
) -> Result<Option<Parameter>>
pub fn find_parameter_from_path( &self, path: impl AsRef<str>, start: impl Into<Option<NodeHandle>>, ) -> Result<Option<Parameter>>
Find a parameter by path, absolute or relative to a start node.
Sourcepub fn get_manager_node(&self, manager: ManagerType) -> Result<ManagerNode>
pub fn get_manager_node(&self, manager: ManagerType) -> Result<ManagerNode>
Returns a manager (root) node such as OBJ, TOP, CHOP, etc
Sourcepub fn get_composed_object_transform(
&self,
parent: impl AsRef<NodeHandle>,
rst_order: RSTOrder,
) -> Result<Vec<Transform>>
pub fn get_composed_object_transform( &self, parent: impl AsRef<NodeHandle>, rst_order: RSTOrder, ) -> Result<Vec<Transform>>
Return a list of transforms for all object nodes under a given parent node.
Sourcepub fn save_hip(&self, path: impl AsRef<Path>, lock_nodes: bool) -> Result<()>
pub fn save_hip(&self, path: impl AsRef<Path>, 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 get_hip_file_nodes(&self, hip_id: i32) -> Result<Vec<NodeHandle>>
pub fn get_hip_file_nodes(&self, hip_id: i32) -> Result<Vec<NodeHandle>>
Get node ids created by merging Session::merge_hip
a hip file.
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_loaded_asset_libraries(&self) -> Result<Vec<AssetLibrary>>
pub fn get_loaded_asset_libraries(&self) -> Result<Vec<AssetLibrary>>
Returns a list of loaded asset libraries including Houdini’s default.
Sourcepub fn get_cook_state_status(&self) -> Result<SessionState>
pub fn get_cook_state_status(&self) -> Result<SessionState>
Get session state when the server is in threaded mode.
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_use_houdini_time(&self) -> Result<bool>
pub fn get_use_houdini_time(&self) -> Result<bool>
Check if session uses 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
pub fn render_texture_to_image( &self, node: impl Into<NodeHandle>, parm_name: &str, ) -> Result<()>
pub fn extract_image_to_file( &self, node: impl Into<NodeHandle>, image_planes: &str, path: impl AsRef<Path>, ) -> Result<String>
pub fn extract_image_to_memory( &self, node: impl Into<NodeHandle>, buffer: &mut Vec<u8>, image_planes: impl AsRef<str>, format: impl AsRef<str>, ) -> Result<()>
pub fn get_image_info(&self, node: impl Into<NodeHandle>) -> Result<ImageInfo>
Sourcepub fn render_cop_to_memory(
&self,
cop_node: impl Into<NodeHandle>,
buffer: &mut Vec<u8>,
image_planes: impl AsRef<str>,
format: impl AsRef<str>,
) -> Result<()>
pub fn render_cop_to_memory( &self, cop_node: impl Into<NodeHandle>, buffer: &mut Vec<u8>, image_planes: impl AsRef<str>, format: impl AsRef<str>, ) -> Result<()>
Render a COP node to a memory buffer