From 4578bbc0d1ec16617efd2c0179e5e6962300ddc9 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 6 May 2026 02:16:28 -0700 Subject: [PATCH] fix(wom): toM2 converts .png texture paths back to .blp for renderer Same fix as WoB: M2Renderer's PNG override is keyed on .blp extension. fromM2 writes .png paths to signal intent (PNG export pipeline), but toM2 must convert back so the runtime engages the override and finds the actual texture file. --- src/pipeline/wowee_model.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pipeline/wowee_model.cpp b/src/pipeline/wowee_model.cpp index 65b4c30b..922f7606 100644 --- a/src/pipeline/wowee_model.cpp +++ b/src/pipeline/wowee_model.cpp @@ -422,11 +422,19 @@ M2Model WoweeModelLoader::toM2(const WoweeModel& wom) { for (uint32_t idx : wom.indices) m.indices.push_back(static_cast(idx)); + // Convert .png paths back to .blp so the M2 renderer's PNG override path + // engages — it's keyed on .blp extension, not .png. fromM2 stored .png to + // signal intent; toM2 has to undo that for the runtime to find textures. for (const auto& tp : wom.texturePaths) { M2Texture tex; tex.type = 0; tex.flags = 0; tex.filename = tp; + if (tex.filename.size() >= 4) { + std::string ext = tex.filename.substr(tex.filename.size() - 4); + if (ext == ".png" || ext == ".PNG") + tex.filename = tex.filename.substr(0, tex.filename.size() - 4) + ".blp"; + } m.textures.push_back(tex); } m.textureLookup.clear();