From bcbfdae6bea3522f0a355f1e97765c9d9627bab7 Mon Sep 17 00:00:00 2001 From: Par Winzell Date: Thu, 16 Nov 2017 14:10:12 -0800 Subject: [PATCH] Drop misleading warning. It's perfectly fine for materials to have neither diffuse texture nor vertex colours. This dates back to a time when the tool had more limited use cases. To compensate: https://github.com/facebookincubator/FBX2glTF/issues/43 --- src/Raw2Gltf.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Raw2Gltf.cpp b/src/Raw2Gltf.cpp index 9ed143e..45c98e6 100644 --- a/src/Raw2Gltf.cpp +++ b/src/Raw2Gltf.cpp @@ -474,18 +474,11 @@ ModelData *Raw2Gltf( for (size_t surfaceIndex = 0; surfaceIndex < materialModels.size(); surfaceIndex++) { const RawModel &surfaceModel = materialModels[surfaceIndex]; - assert(surfaceModel.GetSurfaceCount() == 1); + assert(surfaceModel.GetSurfaceCount() == 1); const RawSurface &rawSurface = surfaceModel.GetSurface(0); - const std::string surfaceName = std::to_string(surfaceIndex) + "_" + rawSurface.name; const RawMaterial &rawMaterial = surfaceModel.GetMaterial(surfaceModel.GetTriangle(0).materialIndex); - if (rawMaterial.textures[RAW_TEXTURE_USAGE_DIFFUSE] < 0 && - (surfaceModel.GetVertexAttributes() & RAW_VERTEX_ATTRIBUTE_COLOR) == 0) { - if (verboseOutput) { - fmt::printf("Warning: surface %s has neither texture nor vertex colors.\n", surfaceName.c_str()); - } - } const MaterialData &mData = require(materialsByName, materialHash(rawMaterial)); std::string nodeName = rawSurface.nodeName;