Closed lilleyse closed 7 years ago
Is there any way this could remove the wrong file, or any way that the two bin filenames could both end up as the same filename?
gltf-pipeline currently saves out the bin as the id of the buffer, which will usually be called buffer
. obj2gltf
at least names the id buffer
before sending it across.
Meanwhile the intermediary step in obj2gltf
saves it as [filename].bin
. The one situation that would fail is if the model is buffer.obj
.
I was contemplating having gltf-pipeline
write [filename].bin
but there was too much extra work to make that happen, this seemed like the easier fix.
The correct solution is that any temporary/intermediate files should be written as random temp filenames in the operating system's temp location. We should not use the output directory as a temporary output location.
Updated to use a temp directory instead.
This is ready for further review/testing. Would like to get this in with the next publish. @emackey @mramato
This all looks good to me. I don't think either me or @emackey have commit access her.
@likangning93 can you do a quick review and merge?
I did some test cleanup inspired by https://github.com/AnalyticalGraphicsInc/obj2gltf/pull/62#discussion_r113226732. @likangning93 ready to review now.
@likangning93 no need to review, but can you merge this?
@emackey you have commit access now, feel free to merge.
Thanks!
Thanks for the report @emackey
As of now, the bins are guaranteed to have different names, so removing the first won't be an issue.