pub struct Mtl {
pub filename: String,
pub materials: Vec<Arc<Material>>,
}
Expand description
The data represented by the mtllib
command.
The material name is replaced by the actual material data when the material libraries are laoded if a match is found.
Fields§
§filename: String
Name of the .mtl file.
materials: Vec<Arc<Material>>
A list of loaded materials.
The individual materials are wrapped into an Arc
to facilitate referencing this data
where these materials are assigned in the .obj
file.
Implementations§
Source§impl Mtl
impl Mtl
Sourcepub fn reload_with<R, F>(
&mut self,
obj_dir: impl AsRef<Path>,
resolve: F,
) -> Result<&mut Self, MtlError>
pub fn reload_with<R, F>( &mut self, obj_dir: impl AsRef<Path>, resolve: F, ) -> Result<&mut Self, MtlError>
Load the mtl library from the input buffer generated by the given closure.
This function overwrites the contents of this library if it has already been loaded.
Sourcepub fn reload(&mut self, input: impl Read) -> Result<&mut Self, MtlError>
pub fn reload(&mut self, input: impl Read) -> Result<&mut Self, MtlError>
Load the mtl library from the given input buffer.
This function overwrites the contents of this library if it has already been loaded.
pub fn write_to_buf(&self, out: &mut impl Write) -> Result<(), Error>
Trait Implementations§
impl StructuralPartialEq for Mtl
Auto Trait Implementations§
impl Freeze for Mtl
impl RefUnwindSafe for Mtl
impl Send for Mtl
impl Sync for Mtl
impl Unpin for Mtl
impl UnwindSafe for Mtl
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more