From 56a06eee2da0f75001cef8830bdfde85022afec2 Mon Sep 17 00:00:00 2001 From: Omar Shehata Date: Tue, 4 Dec 2018 15:05:00 -0500 Subject: [PATCH] Error if use mutiple material types --- lib/obj2gltf.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/obj2gltf.js b/lib/obj2gltf.js index 0ceeb37..fe51a20 100644 --- a/lib/obj2gltf.js +++ b/lib/obj2gltf.js @@ -63,8 +63,8 @@ function obj2gltf(objPath, options) { throw new DeveloperError('Either options.writer or options.outputDirectory must be defined when writing separate resources.'); } - if (options.metallicRoughness + options.specularGlossiness > 1) { - throw new DeveloperError('Only one material type may be set from [metallicRoughness, specularGlossiness].'); + if (options.metallicRoughness + options.specularGlossiness + options.unlit > 1) { + throw new DeveloperError('Only one material type may be set from [metallicRoughness, specularGlossiness, unlit].'); } if (defined(options.overridingTextures.metallicRoughnessOcclusionTexture) && defined(options.overridingTextures.specularGlossinessTexture)) {