From 3169452ca077dfe869d4735596f9f2146732550f Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Wed, 20 Jul 2016 14:23:27 -0400 Subject: [PATCH] Instead of -e command line flag, use -s or -t --- .idea/modules.xml | 2 +- bin/obj2gltf.js | 9 ++++++--- lib/convert.js | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.idea/modules.xml b/.idea/modules.xml index 662b990..eb8cfab 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/bin/obj2gltf.js b/bin/obj2gltf.js index e681d18..947fb91 100644 --- a/bin/obj2gltf.js +++ b/bin/obj2gltf.js @@ -11,7 +11,8 @@ if (process.argv.length < 3 || defined(argv.h) || defined(argv.help)) { console.log(' -i, --input Path to obj file'); console.log(' -o, --output Directory or filename for the exported glTF file'); console.log(' -b, --binary Output binary glTF'); - console.log(' -e, --embed Embed glTF resources into a single file'); + console.log(' -s --separate Writes out separate geometry/animation data files, shader files, and textures instead of embedding them in the glTF file.'); + console.log(' -t --separateImage Write out separate textures only.'); console.log(' -h, --help Display this help'); console.log(' --ao Apply ambient occlusion to the converted model'); process.exit(0); @@ -20,7 +21,8 @@ if (process.argv.length < 3 || defined(argv.h) || defined(argv.help)) { var objFile = defaultValue(argv._[0], defaultValue(argv.i, argv.input)); var outputPath = defaultValue(argv._[1], defaultValue(argv.o, argv.output)); var binary = defaultValue(defaultValue(argv.b, argv.binary), false); -var embed = defaultValue(defaultValue(argv.e, argv.embed), false); +var separate = defaultValue(defaultValue(argv.s, argv.separate), false); +var separateImage = defaultValue(defaultValue(argv.t, argv.separateImage), false); var quantize = defaultValue(defaultValue(argv.q, argv.quantize), false); // Undocumented option var ao = defaultValue(argv.ao, false); @@ -32,7 +34,8 @@ console.time('Total'); var options = { binary : binary, - embed : embed, + embed : !separate, + embedImage : !separateImage, quantize : quantize, ao : ao }; diff --git a/lib/convert.js b/lib/convert.js index 8ed515a..5d91367 100644 --- a/lib/convert.js +++ b/lib/convert.js @@ -12,6 +12,7 @@ module.exports = convert; function convert(objFile, outputPath, options, done) { var binary = defaultValue(options.binary, false); var embed = defaultValue(options.embed, true); + var embedImage = defaultValue(options.embedImage, true); var quantize = defaultValue(options.quantize, false); var ao = defaultValue(options.ao, false); @@ -41,6 +42,7 @@ function convert(objFile, outputPath, options, done) { var options = { binary : binary, embed : embed, + embedImage : embedImage, quantize : quantize, aoOptions : aoOptions, createDirectory : false,