document.merge(io.read(file) reads contents of file as full path
See original GitHub issueWhen trying to merge many .GLTF files together using a Document
and NodeIO
object, I encounter an issue where the NodeIO.read()
function seems to read the entirety of the file as the path to the file.
Following your advice on this SE post, I try to pass each model as a file path using a loop:
for (const file in files){
const fp = path.join(outDir, files[file])
document.merge(io.read(fp))
Throws an error:
Error: ENOENT: no such file or directory, open '/home/voodoo/Documents/Personal/Repositories/GLTF_Merger/GLTF_Out/data:application/octet-stream;base64,AACAPwAAAEAAAIC/AACAvwAAAEAAAIC/....
and so on. In an earlier post you helped me with, you mentioned this may have been a bug fixed in an earlier version. I am using version 0.12.4 of glTF-transform at this time. I can try using .GLB instead, but I’d really like to be able to allow .glTF or .GLB for this tool.
My tool is here on Github for reference, and this time around its a lot nicer to look at 😄
I am marking this as a bug for now, since it seems this is a known error that may have previously been fixed. If this is simply an issue with my implentation, please let me know!
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
Cheers, I will upgrade and take a look at changing my tool!
Glad to hear that worked! 🙂