Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Absolute URIs and document merging #2130

Closed
mtaylor-tbpm opened this issue Mar 7, 2022 · 5 comments
Closed

Absolute URIs and document merging #2130

mtaylor-tbpm opened this issue Mar 7, 2022 · 5 comments

Comments

@mtaylor-tbpm
Copy link

I see that absolute URIs are allowed for buffers and images in GLTFs - #1744

When I try to merge several documents using absolute URIs I receive an error similar to below. Are absolute URIs not supported when merging? Works fine when bin and image files are local

ENOENT: no such file or directory, open '/private/var/folders/cj/_hjswxvd1t96yq12dxfjy1040000gn/T/3D/c2d67310-a647-4d27-abe2-6c422daa85e8/https:/tbpmdatastorestaging.blob.core.windows.net/assets/ki/nodes/gladly/gd261/3d/gd261_root-legs-ml_fram1.bin'

Note - the error message is pre-pending the GLTF path and removing one of the forward slashes after https: The URIs in the GLTFs are correctly formatted.

@donmccurdy
Copy link
Contributor

Hi @mtaylor-tbpm! This repository tracks development of the glTF specification and extensions, but not any particular software. What software are you using when attempting to merge these documents? It may be necessary to file an issue with that software rather than here. There's nothing in the specification that would the merge from working.

@mtaylor-tbpm
Copy link
Author

I'm only using gltf-transform/core in NodeJS. I'm saving multiple GLTFs locally that use remote URIs, ultimately to merge then write a GLB

for (const gltfFile of gltfFiles) {
  let gltfPath = path.join(workingFolder, gltfFile);
  document.merge(io.read(gltfPath));    <--- FAILS HERE
}

@donmccurdy
Copy link
Contributor

Ok! Could you open a discussion at https://github.com/donmccurdy/glTF-Transform/discussions? Note that you'll need to update to glTF Transform v2.x to load remote URLs with NodeIO.

@mtaylor-tbpm
Copy link
Author

Ah, I was using a 1.x version. Now I'm getting the error below after upgrading to 2.0.5 and to the latest NodeJS version (v17.6.0). Does 2.0.5 require a specific NodeJS version?

Also figured out I had to allow HTTP...

const fetch = require("node-fetch");
const io = new NodeIO(fetch)
.registerExtensions(KHRONOS_EXTENSIONS)
.setAllowHTTP(true);

Let me know if I should still open a discussion. Thank you!

TypeError: t.getRoot is not a function
at it.merge (/projects/nodejs/3d-api/node_modules/@gltf-transform/core/dist/core.js:1:30603)

@mtaylor-tbpm
Copy link
Author

Never mind, I figured it out. Was missing an await on io.read. Thanks again for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants