Remove occurences of khr_materials_common for code (not tests yet)

This commit is contained in:
Sean Lilley 2017-04-20 10:23:00 -04:00
parent d0e8b90566
commit d6d0d392c6
4 changed files with 3 additions and 23 deletions

View File

@ -42,8 +42,7 @@ Using obj2gltf as a command-line tool:
|`-n`, `--generateNormals`|Generate normals if they are missing.|No, default `false`| |`-n`, `--generateNormals`|Generate normals if they are missing.|No, default `false`|
|`--optimizeForCesium`|Optimize the glTF for Cesium by using the sun as a default light source.|No, default `false`| |`--optimizeForCesium`|Optimize the glTF for Cesium by using the sun as a default light source.|No, default `false`|
|`--ao`|Apply ambient occlusion to the converted model.|No, default `false`| |`--ao`|Apply ambient occlusion to the converted model.|No, default `false`|
|`--kmc`|Output glTF with the KHR_materials_common extension.|No, default `false`| |`--bypassPipeline`|Bypass the gltf-pipeline for debugging purposes. This option overrides many of the options above.|No, default `false`|
|`--bypassPipeline`|Bypass the gltf-pipeline for debugging purposes. This option overrides many of the options above and will save the glTF with the KHR_materials_common extension.|No, default `false`|
|`--checkTransparency`|Do a more exhaustive check for texture transparency by looking at the alpha channel of each pixel. By default textures are considered to be opaque.|No, default `false`| |`--checkTransparency`|Do a more exhaustive check for texture transparency by looking at the alpha channel of each pixel. By default textures are considered to be opaque.|No, default `false`|
|`--secure`|Prevent the converter from reading image or mtl files outside of the input obj directory.|No, default `false`| |`--secure`|Prevent the converter from reading image or mtl files outside of the input obj directory.|No, default `false`|

View File

@ -76,13 +76,8 @@ var argv = yargs
type: 'boolean', type: 'boolean',
default: defaults.ao default: defaults.ao
}, },
kmc : {
describe: 'Output glTF with the KHR_materials_common extension.',
type: 'boolean',
default: defaults.kmc
},
bypassPipeline : { bypassPipeline : {
describe: 'Bypass the gltf-pipeline for debugging purposes. This option overrides many of the options above and will save the glTF with the KHR_materials_common extension.', describe: 'Bypass the gltf-pipeline for debugging purposes. This option overrides many of the options above.',
type: 'boolean', type: 'boolean',
default: defaults.bypassPipeline default: defaults.bypassPipeline
}, },
@ -116,7 +111,6 @@ var options = {
optimizeForCesium : argv.optimizeForCesium, optimizeForCesium : argv.optimizeForCesium,
generateNormals : argv.generateNormals, generateNormals : argv.generateNormals,
ao : argv.ao, ao : argv.ao,
kmc : argv.kmc,
bypassPipeline : argv.bypassPipeline, bypassPipeline : argv.bypassPipeline,
checkTransparency : argv.checkTransparency, checkTransparency : argv.checkTransparency,
secure : argv.secure secure : argv.secure

View File

@ -31,9 +31,8 @@ module.exports = obj2gltf;
* @param {Boolean} [options.optimizeForCesium=false] Optimize the glTF for Cesium by using the sun as a default light source. * @param {Boolean} [options.optimizeForCesium=false] Optimize the glTF for Cesium by using the sun as a default light source.
* @param {Boolean} [options.generateNormals=false] Generate normals if they are missing. * @param {Boolean} [options.generateNormals=false] Generate normals if they are missing.
* @param {Boolean} [options.ao=false] Apply ambient occlusion to the converted model. * @param {Boolean} [options.ao=false] Apply ambient occlusion to the converted model.
* @param {Boolean} [options.kmc=false] Output glTF with the KHR_materials_common extension.
* @param {Boolean} [options.textureCompressionOptions] Options sent to the compressTextures stage of gltf-pipeline. * @param {Boolean} [options.textureCompressionOptions] Options sent to the compressTextures stage of gltf-pipeline.
* @param {Boolean} [options.bypassPipeline=false] Bypass the gltf-pipeline for debugging purposes. This option overrides many of the options above and will save the glTF with the KHR_materials_common extension. * @param {Boolean} [options.bypassPipeline=false] Bypass the gltf-pipeline for debugging purposes. This option overrides many of the options above.
* @param {Boolean} [options.checkTransparency=false] Do a more exhaustive check for texture transparency by looking at the alpha channel of each pixel. * @param {Boolean} [options.checkTransparency=false] Do a more exhaustive check for texture transparency by looking at the alpha channel of each pixel.
* @param {Boolean} [options.secure=false] Prevent the converter from reading image or mtl files outside of the input obj directory. * @param {Boolean} [options.secure=false] Prevent the converter from reading image or mtl files outside of the input obj directory.
* @param {Logger} [options.logger] A callback function for handling logged messages. Defaults to console.log. * @param {Logger} [options.logger] A callback function for handling logged messages. Defaults to console.log.
@ -50,7 +49,6 @@ function obj2gltf(objPath, gltfPath, options) {
var optimizeForCesium = defaultValue(options.optimizeForCesium, defaults.optimizeForCesium); var optimizeForCesium = defaultValue(options.optimizeForCesium, defaults.optimizeForCesium);
var generateNormals = defaultValue(options.generateNormals, defaults.generateNormals); var generateNormals = defaultValue(options.generateNormals, defaults.generateNormals);
var ao = defaultValue(options.ao, defaults.ao); var ao = defaultValue(options.ao, defaults.ao);
var kmc = defaultValue(options.kmc, defaults.kmc);
var textureCompressionOptions = options.textureCompressionOptions; var textureCompressionOptions = options.textureCompressionOptions;
var bypassPipeline = defaultValue(options.bypassPipeline, defaults.bypassPipeline); var bypassPipeline = defaultValue(options.bypassPipeline, defaults.bypassPipeline);
var checkTransparency = defaultValue(options.checkTransparency, defaults.checkTransparency); var checkTransparency = defaultValue(options.checkTransparency, defaults.checkTransparency);
@ -86,7 +84,6 @@ function obj2gltf(objPath, gltfPath, options) {
gltfPath = path.join(path.dirname(gltfPath), modelName + extension); gltfPath = path.join(path.dirname(gltfPath), modelName + extension);
var aoOptions = ao ? {} : undefined; var aoOptions = ao ? {} : undefined;
var kmcOptions = kmc ? {} : undefined;
var pipelineOptions = { var pipelineOptions = {
createDirectory : false, createDirectory : false,
@ -101,7 +98,6 @@ function obj2gltf(objPath, gltfPath, options) {
optimizeForCesium : optimizeForCesium, optimizeForCesium : optimizeForCesium,
smoothNormals : generateNormals, smoothNormals : generateNormals,
aoOptions : aoOptions, aoOptions : aoOptions,
kmcOptions : kmcOptions,
textureCompressionOptions : textureCompressionOptions textureCompressionOptions : textureCompressionOptions
}; };
@ -187,12 +183,6 @@ obj2gltf.defaults = {
* @default false * @default false
*/ */
ao: false, ao: false,
/**
* Gets or sets whether the model will be saved with the KHR_materials_common extension.
* @type Boolean
* @default false
*/
kmc: false,
/** /**
* Gets or sets whether the converter will bypass the gltf-pipeline for debugging purposes. * Gets or sets whether the converter will bypass the gltf-pipeline for debugging purposes.
* @type Boolean * @type Boolean

View File

@ -39,7 +39,6 @@ describe('obj2gltf', function() {
quantize : false, quantize : false,
compressTextureCoordinates : false, compressTextureCoordinates : false,
aoOptions : undefined, aoOptions : undefined,
kmcOptions : undefined,
smoothNormals : false, smoothNormals : false,
optimizeForCesium : false, optimizeForCesium : false,
textureCompressionOptions : undefined, textureCompressionOptions : undefined,
@ -64,7 +63,6 @@ describe('obj2gltf', function() {
optimizeForCesium : true, optimizeForCesium : true,
generateNormals : true, generateNormals : true,
ao : true, ao : true,
kmc : true,
textureCompressionOptions : textureCompressionOptions, textureCompressionOptions : textureCompressionOptions,
checkTransparency : true, checkTransparency : true,
secure : true, secure : true,
@ -85,7 +83,6 @@ describe('obj2gltf', function() {
quantize : true, quantize : true,
compressTextureCoordinates : true, compressTextureCoordinates : true,
aoOptions : {}, aoOptions : {},
kmcOptions : {},
smoothNormals : true, smoothNormals : true,
optimizeForCesium : true, optimizeForCesium : true,
textureCompressionOptions : textureCompressionOptions, textureCompressionOptions : textureCompressionOptions,