Merge pull request #4108 from davidepi/fix-aistring-embedtextures

Fix aiString length not updated in the EmbedTextures postprocess task
This commit is contained in:
Kim Kulling 2021-10-04 15:22:49 +02:00 committed by GitHub
commit babf3b8e3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -89,7 +89,7 @@ void EmbedTexturesProcess::Execute(aiScene* pScene) {
// Indeed embed
if (addTexture(pScene, path.data)) {
auto embeddedTextureId = pScene->mNumTextures - 1u;
::ai_snprintf(path.data, 1024, "*%u", embeddedTextureId);
path.length = ::ai_snprintf(path.data, 1024, "*%u", embeddedTextureId);
material->AddProperty(&path, AI_MATKEY_TEXTURE(tt, texId));
embeddedTexturesCount++;
}