Showing the changes to interface/src/ModelUploader.cpp (1 of 1 file). Show all
Unified · Split
| @@ -424,19 +424,24 @@ void ModelUploader::processCheck() { · 423 unmodified lines | ||
| 424 | 424 | } |
| 425 | 425 | |
| 426 | 426 | bool ModelUploader::addTextures(const QString& texdir, const FBXGeometry& geometry) { |
| 427 | + QSet<QByteArray> added; | |
| 427 | 428 | foreach (FBXMesh mesh, geometry.meshes) { |
| 428 | 429 | foreach (FBXMeshPart part, mesh.parts) { |
| 429 | − if (!part.diffuseTexture.filename.isEmpty() && part.diffuseTexture.content.isEmpty()) { | |
| 430 | + if (!part.diffuseTexture.filename.isEmpty() && part.diffuseTexture.content.isEmpty() && | |
| 431 | + !added.contains(part.diffuseTexture.filename)) { | |
| 430 | 432 | if (!addPart(texdir + "/" + part.diffuseTexture.filename, |
| 431 | 433 | QString("texture%1").arg(++_texturesCount), true)) { |
| 432 | 434 | return false; |
| 433 | 435 | } |
| 436 | + added.insert(part.diffuseTexture.filename); | |
| 434 | 437 | } |
| 435 | − if (!part.normalTexture.filename.isEmpty() && part.normalTexture.content.isEmpty()) { | |
| 438 | + if (!part.normalTexture.filename.isEmpty() && part.normalTexture.content.isEmpty() && | |
| 439 | + !added.contains(part.normalTexture.filename)) { | |
| 436 | 440 | if (!addPart(texdir + "/" + part.normalTexture.filename, |
| 437 | 441 | QString("texture%1").arg(++_texturesCount), true)) { |
| 438 | 442 | return false; |
| 439 | 443 | } |
| 444 | + added.insert(part.normalTexture.filename); | |
| 440 | 445 | } |
| 441 | 446 | } |
| 442 | 447 | } |