From e76d5c2d99af1a29b649b9b3862c20aed22d521c Mon Sep 17 00:00:00 2001 From: "K. S. Ernest (iFire) Lee" Date: Sun, 28 Nov 2021 15:23:28 -0800 Subject: [PATCH] Name the gltf2 buffer uniquely. --- src/FBX2glTF.cpp | 2 +- src/gltf/GltfModel.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FBX2glTF.cpp b/src/FBX2glTF.cpp index dc480b2..3233a29 100644 --- a/src/FBX2glTF.cpp +++ b/src/FBX2glTF.cpp @@ -399,7 +399,7 @@ int main(int argc, char* argv[]) { assert(!outputFolder.empty()); - const std::string binaryPath = outputFolder + extBufferFilename; + const std::string binaryPath = outputFolder + FileUtils::GetFileBase(gltfOptions.inputPath) + extBufferFilename; FILE* fp = fopen(binaryPath.c_str(), "wb"); if (fp == nullptr) { fmt::fprintf(stderr, "ERROR:: Couldn't open file '%s' for writing.\n", binaryPath); diff --git a/src/gltf/GltfModel.hpp b/src/gltf/GltfModel.hpp index 0c4f40e..bd8cf40 100644 --- a/src/gltf/GltfModel.hpp +++ b/src/gltf/GltfModel.hpp @@ -230,6 +230,6 @@ class GltfModel { } BufferData* buildDefaultBuffer(const GltfOptions& options) { return options.outputBinary ? new BufferData(binary) - : new BufferData(extBufferFilename, binary, options.embedResources); + : new BufferData(FileUtils::GetFileBase(options.inputPath) + extBufferFilename, binary, options.embedResources); } };