Module hapi_rs::parameter

source ·
Expand description

Reading and setting node parameters, setting expressions and keyframes.

Different parameter types are modeled with a Parameter enum, to get to a concrete type, use pattern matching:

use hapi_rs::session::new_in_process;
use hapi_rs::parameter::*;
let session = new_in_process(None).unwrap();
let lib = session.load_asset_file("otls/hapi_parms.hda").unwrap();
let node = lib.try_create_first().unwrap();
if let Parameter::String(p) = node.parameter("single_string").unwrap() {
    assert_eq!(p.get(0).unwrap(), "hello");
    assert!(p.set(0, "world").is_ok());
}

Extra parameter features are available in ParmBaseTrait

Structs

Represents float parameters, including Color type.
Represents integer parameters, including Button type
For parameter animation
An internal handle to a parameter
Represents string parameters of many different types.

Enums

Enum of different parameter types.

Traits

Common trait for parameters