diff --git a/code/ScenePreprocessor.cpp b/code/ScenePreprocessor.cpp index b6ade4166..8cbacb167 100644 --- a/code/ScenePreprocessor.cpp +++ b/code/ScenePreprocessor.cpp @@ -66,6 +66,13 @@ void ScenePreprocessor::ProcessScene (aiScene* _scene) // --------------------------------------------------------------------------- void ScenePreprocessor::ProcessMesh (aiMesh* mesh) { + // If aiMesh::mNumUVComponents is *not* set assign the default value of 2 + for (unsigned int i = 0; i < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++i) + { + if (!mesh->mNumUVComponents[i]) + mesh->mNumUVComponents[i] = 2; + } + // If the information which primitive types are there in the // mesh is currently not available, compute it. if (!mesh->mPrimitiveTypes) diff --git a/include/aiMesh.h b/include/aiMesh.h index 0b74778c9..f6c3ae2fc 100644 --- a/include/aiMesh.h +++ b/include/aiMesh.h @@ -388,7 +388,6 @@ struct aiMesh * or cube maps). If the value is 2 for a given channel n, the * component p.z of mTextureCoords[n][p] is set to 0.0f. * If the value is 1 for a given channel, p.y is set to 0.0f, too. - * If this value is 0, 2 should be assumed. * @note 4D coords are not supported */ unsigned int mNumUVComponents[AI_MAX_NUMBER_OF_TEXTURECOORDS];