mirror of
https://github.com/CesiumGS/obj2gltf.git
synced 2024-11-23 08:34:14 -05:00
Move incompatible argument checking to bin file
This commit is contained in:
parent
3da691df62
commit
487eca91f8
@ -122,6 +122,16 @@ var argv = yargs
|
||||
}
|
||||
}).parse(args);
|
||||
|
||||
if (argv.metallicRoughness + argv.specularGlossiness + argv.materialsCommon > 1) {
|
||||
console.error('Only one material type may be set from [--metallicRoughness, --specularGlossiness, --materialsCommon].');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (defined(argv.metallicRoughnessOcclusionTexture) && defined(argv.specularGlossinessTexture)) {
|
||||
console.error('--metallicRoughnessOcclusionTexture and --specularGlossinessTexture cannot both be set.');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
var objPath = argv.i;
|
||||
var gltfPath = argv.o;
|
||||
|
||||
@ -157,14 +167,10 @@ var options = {
|
||||
|
||||
console.time('Total');
|
||||
|
||||
try {
|
||||
obj2gltf(objPath, gltfPath, options)
|
||||
.then(function() {
|
||||
console.timeEnd('Total');
|
||||
})
|
||||
.catch(function(error) {
|
||||
console.log(error.message);
|
||||
});
|
||||
} catch(error) {
|
||||
console.log(error.message);
|
||||
}
|
||||
obj2gltf(objPath, gltfPath, options)
|
||||
.then(function() {
|
||||
console.timeEnd('Total');
|
||||
})
|
||||
.catch(function(error) {
|
||||
console.log(error.message);
|
||||
});
|
||||
|
@ -83,11 +83,11 @@ function obj2gltf(objPath, gltfPath, options) {
|
||||
}
|
||||
|
||||
if (metallicRoughness + specularGlossiness + materialsCommon > 1) {
|
||||
throw new DeveloperError('Only one material type may be set from [--metallicRoughness, --specularGlossiness, --materialsCommon].');
|
||||
throw new DeveloperError('Only one material type may be set from [metallicRoughness, specularGlossiness, materialsCommon].');
|
||||
}
|
||||
|
||||
if (defined(overridingImages.metallicRoughnessOcclusionTexture) && defined(overridingImages.specularGlossinessTexture)) {
|
||||
throw new DeveloperError('options.overridingImages.metallicRoughnessOcclusionTexture and options.overridingImages.specularGlossinessTexture cannot both be defined.');
|
||||
throw new DeveloperError('metallicRoughnessOcclusionTexture and specularGlossinessTexture cannot both be defined.');
|
||||
}
|
||||
|
||||
if (defined(overridingImages.metallicRoughnessOcclusionTexture)) {
|
||||
|
Loading…
Reference in New Issue
Block a user