Set binary output based on extension, fixed optional value check
This commit is contained in:
parent
c450ed53a1
commit
10439bd40a
|
@ -291,14 +291,21 @@ int main(int argc, char* argv[]) {
|
|||
// the path of the actual .glb or .gltf file
|
||||
std::string modelPath;
|
||||
const auto& suffix = FileUtils::GetFileSuffix(outputPath);
|
||||
if (gltfOptions.outputBinary || suffix.value() == "glb") {
|
||||
|
||||
// set to binary output to true if extension is glb
|
||||
if (suffix.has_value() && suffix.value() == "glb") {
|
||||
gltfOptions.outputBinary = true;
|
||||
}
|
||||
|
||||
if (gltfOptions.outputBinary) {
|
||||
// add .glb to output path, unless it already ends in exactly that
|
||||
if (suffix.has_value() && suffix.value() == "glb") {
|
||||
modelPath = outputPath;
|
||||
} else {
|
||||
modelPath = outputPath + ".glb";
|
||||
}
|
||||
} else if(suffix.value() == "gltf") {
|
||||
// if the extension is gltf set the output folder to the parent directory
|
||||
} else if(suffix.has_value() && suffix.value() == "gltf") {
|
||||
modelPath = outputPath;
|
||||
outputFolder = FileUtils::getFolder(outputPath) + "/";
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue