mirror of https://github.com/CesiumGS/obj2gltf.git
Support quantize option
This commit is contained in:
parent
1b78afd6eb
commit
d4131a956c
|
@ -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 outputPath = defaultValue(argv._[1], defaultValue(argv.o, argv.output));
|
||||||
var binary = defaultValue(defaultValue(argv.b, argv.binary), false);
|
var binary = defaultValue(defaultValue(argv.b, argv.binary), false);
|
||||||
var embed = defaultValue(defaultValue(argv.e, argv.embed), false);
|
var embed = defaultValue(defaultValue(argv.e, argv.embed), false);
|
||||||
|
var quantize = defaultValue(defaultValue(argv.q, argv.quantize), false); // Undocumented option
|
||||||
|
|
||||||
if (!defined(objFile)) {
|
if (!defined(objFile)) {
|
||||||
throw new Error('-i or --input argument is required. See --help for details.');
|
throw new Error('-i or --input argument is required. See --help for details.');
|
||||||
|
@ -29,7 +30,8 @@ console.time('Total');
|
||||||
|
|
||||||
var options = {
|
var options = {
|
||||||
binary : binary,
|
binary : binary,
|
||||||
embed : embed
|
embed : embed,
|
||||||
|
quantize : quantize
|
||||||
};
|
};
|
||||||
|
|
||||||
convert(objFile, outputPath, options, function() {
|
convert(objFile, outputPath, options, function() {
|
||||||
|
|
|
@ -12,6 +12,7 @@ module.exports = convert;
|
||||||
function convert(objFile, outputPath, options, done) {
|
function convert(objFile, outputPath, options, done) {
|
||||||
var binary = defaultValue(options.binary, false);
|
var binary = defaultValue(options.binary, false);
|
||||||
var embed = defaultValue(options.embed, true);
|
var embed = defaultValue(options.embed, true);
|
||||||
|
var quantize = defaultValue(options.quantize, false);
|
||||||
|
|
||||||
if (!defined(objFile)) {
|
if (!defined(objFile)) {
|
||||||
throw new Error('objFile is required');
|
throw new Error('objFile is required');
|
||||||
|
@ -38,6 +39,7 @@ function convert(objFile, outputPath, options, done) {
|
||||||
var options = {
|
var options = {
|
||||||
binary : binary,
|
binary : binary,
|
||||||
embed : embed,
|
embed : embed,
|
||||||
|
quantize : quantize,
|
||||||
createDirectory : false,
|
createDirectory : false,
|
||||||
basePath : inputPath
|
basePath : inputPath
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue