Module session

Source
Expand description

Session is responsible for communicating with HAPI

The Engine promises to be thread-safe when accessing a single Session from multiple threads. hapi-rs relies on this promise and the Session struct holds only an Arc pointer to the session, and does not protect the session with Mutex, although there is a ReentrantMutex private member which is used internally in a few cases where API calls must be sequential.

When the last instance of the Session is about to get dropped, it’ll be cleaned up (if SessionOptions::cleanup was set) and automatically closed.

The Engine process (pipe or socket) can be auto-terminated as well if told so when starting the server: See start_engine_pipe_server and start_engine_socket_server

quick_session terminates the server by default. This is useful for quick one-off jobs.

Re-exports§

pub use crate::asset::AssetLibrary;
pub use crate::node::HoudiniNode;
pub use crate::node::ManagerNode;
pub use crate::node::ManagerType;
pub use crate::node::NodeHandle;
pub use crate::node::NodeType;
pub use crate::node::Transform;
pub use crate::parameter::Parameter;
pub use crate::stringhandle::StringArray;

Structs§

CompositorOptions
CookOptions
Documentation
HapiError
Error type returned by all APIs
ImageFileFormat
NodeBuilder
Builder struct for Session::node_builder API
Session
Session represents a unique connection to the Engine instance and all API calls require a valid session. It implements Clone and is Send and Sync
SessionInfo
Configurations for sessions
SessionOptions
Session options passed to session create functions like connect_to_pipe
SessionOptionsBuilder
A build for SessionOptions.
SessionSyncInfo
ThriftServerOptions
Options to configure a Thrift server being started from HARC.
TimelineOptions
Viewport

Enums§

AttributeOwner
AttributeTypeInfo
CacheProperty
ChoiceListType
ConnectionType
By which means the session communicates with the server.
CookResult
Result of async cook operation Session::cook
CurveOrders
CurveType
EnvIntType
GeoType
GroupType
HapiResult
HeightFieldSampling
ImageDataFormat
ImagePacking
InputType
JobStatus
Kind
License
PackedPrimInstancingMode
ParmType
PartType
PdgEventType
PdgState
PdgWorkItemState
Permissions
PresetType
PrmScriptType
RSTOrder
RampType
SessionEnvIntType
SessionType
State
StatusType
StatusVerbosity
StorageType
TransformComponent
VolumeType
VolumeVisualType
XYZOrder

Traits§

EnvVariable
Trait bound for Session::get_server_var() and Session::set_server_var()

Functions§

connect_to_memory_server
connect_to_pipe
Connect to the engine process via a pipe file. If timeout is Some, function will try to connect to the server multiple times every 100ms until timeout is reached. Note: Default SessionOptions create a blocking session, non-threaded session, use SessionOptionsBuilder to configure this.
connect_to_socket
Connect to the engine process via a Unix socket
new_in_process
Create in-process session
quick_session
A quick drop-in session, useful for on-off jobs It starts a single-threaded shared memory server and initialize a session with default options
start_engine_pipe_server
Spawn a new pipe Engine process and return its PID
start_engine_socket_server
Spawn a new socket Engine server and return its PID
start_houdini_server
Start an interactive Houdini session with engine server embedded.
start_shared_memory_server
Spawn a new Engine server utilizing shared memory to transfer data.

Type Aliases§

Result
SessionState