chore(editor): cap texture-not-found warnings at 5 with suppression count
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run

Character body/skin textures live in CharSections-composed paths that
don't exist as standalone BLPs. Exporting a zone with many character
NPCs would spam hundreds of warnings. Now logs the first 5, suppresses
the rest, and reports the total skipped count in the summary line.
This commit is contained in:
Kelsi 2026-05-06 02:03:30 -07:00
parent bbdd48a78a
commit f1223cfc69

View file

@ -95,10 +95,14 @@ int TextureExporter::exportTexturesAsPng(pipeline::AssetManager* am,
namespace fs = std::filesystem;
int exported = 0;
int notFound = 0;
for (const auto& texPath : texturePaths) {
auto blpImage = am->loadTexture(texPath);
if (!blpImage.isValid()) {
LOG_WARNING("Texture not found or invalid: ", texPath);
// Many character/dynamic textures legitimately don't exist as files
// (composed at runtime from CharSections.dbc); don't spam.
++notFound;
if (notFound <= 5) LOG_WARNING("Texture not found or invalid: ", texPath);
continue;
}
@ -125,7 +129,8 @@ int TextureExporter::exportTexturesAsPng(pipeline::AssetManager* am,
}
}
LOG_INFO("Exported ", exported, "/", texturePaths.size(), " textures as PNG to ", outputDir);
LOG_INFO("Exported ", exported, "/", texturePaths.size(), " textures as PNG to ", outputDir,
notFound > 5 ? " (" + std::to_string(notFound - 5) + " more not-found warnings suppressed)" : "");
return exported;
}