From d4131a956c1bcd06feb28b3dde841dbe3f1545e5 Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Fri, 24 Jun 2016 14:04:12 -0400 Subject: [PATCH] Support quantize option --- bin/obj2gltf.js | 4 +++- lib/convert.js | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/obj2gltf.js b/bin/obj2gltf.js index 50d00f7..00f1929 100644 --- a/bin/obj2gltf.js +++ b/bin/obj2gltf.js @@ -20,6 +20,7 @@ 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 quantize = defaultValue(defaultValue(argv.q, argv.quantize), false); // Undocumented option if (!defined(objFile)) { throw new Error('-i or --input argument is required. See --help for details.'); @@ -29,7 +30,8 @@ console.time('Total'); var options = { binary : binary, - embed : embed + embed : embed, + quantize : quantize }; convert(objFile, outputPath, options, function() { diff --git a/lib/convert.js b/lib/convert.js index b84fd46..f40245a 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 quantize = defaultValue(options.quantize, false); if (!defined(objFile)) { throw new Error('objFile is required'); @@ -38,6 +39,7 @@ function convert(objFile, outputPath, options, done) { var options = { binary : binary, embed : embed, + quantize : quantize, createDirectory : false, basePath : inputPath };