From 2d6e0d16c9fa9fe5f9634fb7f3a6afc66ab64868 Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Mon, 25 Jul 2016 19:12:41 -0700 Subject: [PATCH] Added --cesium option and bumped version number --- CHANGES.md | 5 +++++ bin/obj2gltf.js | 5 ++++- lib/convert.js | 2 ++ package.json | 4 ++-- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index d1755c2..9e979a8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,11 @@ Change Log ========== +### 0.1.2 - 2016-07-25 + +* Converted the API to now use promises instead of callbacks. [#21](https://github.com/AnalyticalGraphicsInc/OBJ2GLTF/pull/21) +* Added the ability to optimize the converted glTF for Cesium by using the sun as a default light source. + ### 0.1.1 - 2016-07-21 * Updated to use gltf-pipeline 0.1.0-alpha2. diff --git a/bin/obj2gltf.js b/bin/obj2gltf.js index 19a5ea7..e060ded 100644 --- a/bin/obj2gltf.js +++ b/bin/obj2gltf.js @@ -15,6 +15,7 @@ if (process.argv.length < 3 || defined(argv.h) || defined(argv.help)) { 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'); + console.log(' --cesium Optimize the glTF for Cesium by using the sun as a default light source.'); process.exit(0); } @@ -25,6 +26,7 @@ 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); +var optimizeForCesium = defaultValue(argv.cesium, false); if (!defined(objFile)) { throw new Error('-i or --input argument is required. See --help for details.'); @@ -37,7 +39,8 @@ var options = { embed : !separate, embedImage : !separateImage, quantize : quantize, - ao : ao + ao : ao, + optimizeForCesium : optimizeForCesium }; convert(objFile, outputPath, options) diff --git a/lib/convert.js b/lib/convert.js index 4eaea00..66a80df 100644 --- a/lib/convert.js +++ b/lib/convert.js @@ -16,6 +16,7 @@ function convert(objFile, outputPath, options) { var embedImage = defaultValue(options.embedImage, true); var quantize = defaultValue(options.quantize, false); var ao = defaultValue(options.ao, false); + var optimizeForCesium = defaultValue(options.optimizeForCesium, false); if (!defined(objFile)) { throw new Error('objFile is required'); @@ -49,6 +50,7 @@ function convert(objFile, outputPath, options) { embedImage: embedImage, quantize: quantize, aoOptions: aoOptions, + optimizeForCesium : optimizeForCesium, createDirectory: false, basePath: inputPath }; diff --git a/package.json b/package.json index 9bef28a..45c6bb5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obj2gltf", - "version": "0.1.1", + "version": "0.1.2", "description": "Convert OBJ model format to glTF", "license": "Apache-2.0", "contributors": [ @@ -31,7 +31,7 @@ "byline": "4.2.1", "cesium": "1.23.0", "fs-extra": "0.30.0", - "gltf-pipeline": "0.1.0-alpha2", + "gltf-pipeline": "0.1.0-alpha3", "yargs": "4.7.1" }, "devDependencies": {