Instead of -e command line flag, use -s or -t

This commit is contained in:
Sean Lilley 2016-07-20 14:23:27 -04:00
parent 0ec8b1c058
commit 3169452ca0
3 changed files with 9 additions and 4 deletions

View File

@ -2,7 +2,7 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/obj2gltf.iml" filepath="$PROJECT_DIR$/.idea/obj2gltf.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/OBJ2GLTF.iml" filepath="$PROJECT_DIR$/.idea/OBJ2GLTF.iml" />
</modules>
</component>
</project>

View File

@ -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
};

View File

@ -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,