Expand description
Geometry attributes access and iterators
Geometry attributes of different types are represented as trait objects and need to be downcast to concrete types
use hapi_rs::session::new_in_process;
use hapi_rs::geometry::*;
use hapi_rs::attribute::*;
let session = new_in_process(None).unwrap();
let lib = session.load_asset_file("otls/hapi_geo.hda").unwrap();
let node = lib.try_create_first().unwrap();
node.cook(None).unwrap();
let geo = node.geometry().unwrap().unwrap();
geo.node.cook_blocking(None).unwrap();
let attr_p = geo.get_attribute(0, AttributeOwner::Point, "P").unwrap().expect("P exists");
let attr_p = attr_p.downcast::<NumericAttr<f32>>().unwrap();
attr_p.get(0).expect("read_attribute");