Struct hapi_rs::asset::AssetLibrary
source · [−]pub struct AssetLibrary { /* private fields */ }
Expand description
A handle to a loaded HDA file
Implementations
sourceimpl AssetLibrary
impl AssetLibrary
sourcepub fn from_file(
session: Session,
file: impl AsRef<str>
) -> Result<AssetLibrary>
pub fn from_file(
session: Session,
file: impl AsRef<str>
) -> Result<AssetLibrary>
Load an asset from file
sourcepub fn get_asset_count(&self) -> Result<i32>
pub fn get_asset_count(&self) -> Result<i32>
Get number of assets defined in the current library
sourcepub fn get_asset_names(&self) -> Result<Vec<String>>
pub fn get_asset_names(&self) -> Result<Vec<String>>
Get asset names this library contains
sourcepub fn get_first_name(&self) -> Result<Option<String>>
pub fn get_first_name(&self) -> Result<Option<String>>
Returns the name of first asset in the library
sourcepub fn try_create_first(&self) -> Result<HoudiniNode>
pub fn try_create_first(&self) -> Result<HoudiniNode>
Try to create the first available asset in the library. This is a convenience function for:
ⓘ
let names = lib.get_asset_names()?;
session.create_node(names[0], None, None)?
sourcepub fn get_asset_parms(&self, asset: impl AsRef<str>) -> Result<AssetParameters>
pub fn get_asset_parms(&self, asset: impl AsRef<str>) -> Result<AssetParameters>
Returns a struct holding the asset parameter information and vlaues
Trait Implementations
sourceimpl Clone for AssetLibrary
impl Clone for AssetLibrary
sourcefn clone(&self) -> AssetLibrary
fn clone(&self) -> AssetLibrary
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl !RefUnwindSafe for AssetLibrary
impl Send for AssetLibrary
impl Sync for AssetLibrary
impl Unpin for AssetLibrary
impl !UnwindSafe for AssetLibrary
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more