Module 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§

FloatParameter
Represents float parameters, including Color type.
IntParameter
Represents integer parameters, including Button type
KeyFrame
For parameter animation
ParmHandle
An internal handle to a parameter
ParmInfo
Documentation
StringParameter
Represents string parameters of many different types.

Enums§

Parameter
Enum of different parameter types.
ParmType

Traits§

ParmBaseTrait
Common trait for parameters