mirror of
https://github.com/CesiumGS/obj2gltf.git
synced 2024-11-23 16:44:05 -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);
|
}).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 objPath = argv.i;
|
||||||
var gltfPath = argv.o;
|
var gltfPath = argv.o;
|
||||||
|
|
||||||
@ -157,14 +167,10 @@ var options = {
|
|||||||
|
|
||||||
console.time('Total');
|
console.time('Total');
|
||||||
|
|
||||||
try {
|
obj2gltf(objPath, gltfPath, options)
|
||||||
obj2gltf(objPath, gltfPath, options)
|
.then(function() {
|
||||||
.then(function() {
|
console.timeEnd('Total');
|
||||||
console.timeEnd('Total');
|
})
|
||||||
})
|
.catch(function(error) {
|
||||||
.catch(function(error) {
|
console.log(error.message);
|
||||||
console.log(error.message);
|
});
|
||||||
});
|
|
||||||
} catch(error) {
|
|
||||||
console.log(error.message);
|
|
||||||
}
|
|
||||||
|
@ -83,11 +83,11 @@ function obj2gltf(objPath, gltfPath, options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (metallicRoughness + specularGlossiness + materialsCommon > 1) {
|
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)) {
|
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)) {
|
if (defined(overridingImages.metallicRoughnessOcclusionTexture)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user