Update ComputeUVMappingProcess.cpp (#5541)

* Update ComputeUVMappingProcess.cpp

- closes https://github.com/assimp/assimp/issues/5540

* Update ComputeUVMappingProcess.cpp

Add missing token.
pull/5545/head
Kim Kulling 2024-04-11 11:30:36 +01:00 committed by GitHub
parent 08c1adc015
commit 85f084a4ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 3 deletions

View File

@ -346,16 +346,20 @@ void ComputeUVMappingProcess::Execute(aiScene *pScene) {
ASSIMP_LOG_DEBUG("GenUVCoordsProcess begin"); ASSIMP_LOG_DEBUG("GenUVCoordsProcess begin");
char buffer[1024]; char buffer[1024];
if (pScene->mFlags & AI_SCENE_FLAGS_NON_VERBOSE_FORMAT) if (pScene->mFlags & AI_SCENE_FLAGS_NON_VERBOSE_FORMAT) {
throw DeadlyImportError("Post-processing order mismatch: expecting pseudo-indexed (\"verbose\") vertices here"); throw DeadlyImportError("Post-processing order mismatch: expecting pseudo-indexed (\"verbose\") vertices here");
}
std::list<MappingInfo> mappingStack; std::list<MappingInfo> mappingStack;
/* Iterate through all materials and search for non-UV mapped textures // Iterate through all materials and search for non-UV mapped textures
*/
for (unsigned int i = 0; i < pScene->mNumMaterials; ++i) { for (unsigned int i = 0; i < pScene->mNumMaterials; ++i) {
mappingStack.clear(); mappingStack.clear();
aiMaterial *mat = pScene->mMaterials[i]; aiMaterial *mat = pScene->mMaterials[i];
if (mat == nullptr) {
ASSIMP_LOG_INFO("Material pointer in nullptr, skipping.");
continue;
}
for (unsigned int a = 0; a < mat->mNumProperties; ++a) { for (unsigned int a = 0; a < mat->mNumProperties; ++a) {
aiMaterialProperty *prop = mat->mProperties[a]; aiMaterialProperty *prop = mat->mProperties[a];
if (!::strcmp(prop->mKey.data, "$tex.mapping")) { if (!::strcmp(prop->mKey.data, "$tex.mapping")) {