Closed expenses closed 3 months ago
Thank you very much for this report! This is an oversight, and your proposed solution makes sense. Will implement it soon-ish!
Additionally, I think you want to return relative paths for existing on-disk assets. At the moment you get absolute paths like @/home/ashley/projects/glTF-Sample-Models/2.0/DamagedHelmet/glTF/Default_normal.jpg@
which a HTTP resolver isn't going to be able to resolve if the anchor path looks like http://localhost:8000/DamagedHelmet.gltf
. I haven't done a deep dive into how the internals work yet, so I'm not sure how the the images embedded in a binary file like http://localhost:8000/DamagedHelmet.glb
should be resolved. Presumably just extracted to a temporary directory?
Hi, I just implemented the feature in this branch. I have yet to test it with an actual custom resolver.
EDIT: it's now in dev and will be released soon.
This is now implemented in v0.4, thanks for the patience!
Hi! I tried to get guc working with the custom resolver I've been working on but unfortunately it fails upon trying to load the file:
Failed to open "iroh://doc/pajzuzssv2l7wg7iruxixkbc7nfcm42gqfqbmzz5hux4im4v2yea/m5wfirrpirqw2ylhmvseqzlmnvsxilthnr2gmaa.gltf" - unable to parse glTF file: file not found
The problem is that this code assumes that
resolvedPath
is on the local filesystem:https://github.com/pablode/guc/blob/0fb7f767786de6bb14076eb69f3998e3b79115d9/src/libguc/src/fileFormat.cpp#L97-L106
Ideally you'd call something like
ArGetResolver().OpenAsset(resolvedPath)
to get anArAsset
and then use the bytes fromArAsset::GetBuffer
to load the glTF data. This is a bit of a hastle not gonna lie, but it would mean that assets using custom URI schemas (iroh://
for me, but alsohttp://
) would load perfectly.