Skip to main content

parse_obj_from_path

Function parse_obj_from_path 

Source
pub fn parse_obj_from_path<P: AsRef<Path>>(path: P) -> Result<Scene3D>
Expand description

Parse an OBJ document at path, resolving mtllib references against the OBJ file’s parent directory.

Convenience wrapper around parse_obj_with_resolver for the overwhelmingly common case of “I have a path, please load it and follow the MTL references”. Each mtllib foo.mtl directive becomes a sibling-file read; missing libraries surface the underlying std::io::Error (wrapped in Error::invalid) rather than silently dropping. If you want lenient missing-MTL handling, use parse_obj_with_resolver directly.