kvark / obj

Basic Wavefront OBJ loader
Apache License 2.0
29 stars 12 forks source link

Add `Obj::load_mtls_fn` #13

Closed cwfitzgerald closed 4 years ago

cwfitzgerald commented 4 years ago

Depends on #12. Only the last commit is relevant to this PR, will rebase once #12 is merged.

For complicated reasons, I need to be able to preprocess MTL files before the OBJ loader loads them. These files may also be at a different location than the obj loader expects. To facilitate this, I added a function Obj::load_mtls_fn that takes a callback which takes the base_path for the obj and the name of the mtl and returns something that implements io::BufRead

I don't think this should be a breaking change as the semantics and api of Obj::load_mtls should be identical (same code, just run with a layer of indirection) and adding a function is not a breaking change.

cwfitzgerald commented 4 years ago

Rebased onto master.

kvark commented 4 years ago

The merged PR came with failures, unfortunately - https://travis-ci.org/github/kvark/obj/jobs/676781512 Could we address them here?

cwfitzgerald commented 4 years ago

Eh that's what I get for not running tests with all features. Fixed.