Added --cesium option and bumped version number

This commit is contained in:
Sean Lilley 2016-07-25 19:12:41 -07:00
parent 60ba99d4ec
commit 2d6e0d16c9
4 changed files with 13 additions and 3 deletions

View File

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

View File

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

View File

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

View File

@ -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": {