feat(editor): auto-export WMO buildings as WOB placeholders on zone save

- Zone export now creates WOB placeholder files for all placed WMO
  buildings in output/MapName/buildings/
- Full WMO→WOB conversion (with geometry) requires group file loading
  which is complex — placeholders reserve the path structure for now
- All 6 format conversions now auto-run on every zone export:
  ADT→WOT/WHM, BLP→PNG, DBC→JSON, M2→WOM, WMO→WOB, WDT→zone.json
This commit is contained in:
Kelsi 2026-05-05 10:44:38 -07:00
parent c532a1a787
commit 4148c890dc

View file

@ -6,6 +6,7 @@
#include "texture_exporter.hpp" #include "texture_exporter.hpp"
#include "dbc_exporter.hpp" #include "dbc_exporter.hpp"
#include "pipeline/wowee_model.hpp" #include "pipeline/wowee_model.hpp"
#include "pipeline/wowee_building.hpp"
#include "core/coordinates.hpp" #include "core/coordinates.hpp"
#include "rendering/vk_context.hpp" #include "rendering/vk_context.hpp"
#include "pipeline/adt_loader.hpp" #include "pipeline/adt_loader.hpp"
@ -755,6 +756,26 @@ void EditorApp::exportZone(const std::string& outputDir) {
LOG_INFO("Converted ", convertedModels.size(), " M2 models to WOM"); LOG_INFO("Converted ", convertedModels.size(), " M2 models to WOM");
} }
// Convert placed WMO buildings to WOB open format
if (objectPlacer_.objectCount() > 0) {
std::unordered_set<std::string> convertedWMOs;
for (const auto& obj : objectPlacer_.getObjects()) {
if (obj.type == PlaceableType::WMO && !convertedWMOs.count(obj.path)) {
// Create a placeholder WOB (full WMO→WOB conversion needs group loading)
pipeline::WoweeBuilding bld;
bld.name = obj.path;
std::string wobPath = obj.path;
std::replace(wobPath.begin(), wobPath.end(), '\\', '/');
auto dot = wobPath.rfind('.');
if (dot != std::string::npos) wobPath = wobPath.substr(0, dot);
pipeline::WoweeBuildingLoader::save(bld, base + "/buildings/" + wobPath);
convertedWMOs.insert(obj.path);
}
}
if (!convertedWMOs.empty())
LOG_INFO("Created ", convertedWMOs.size(), " WOB building placeholders");
}
// Export used textures as PNG (open format replacement for BLP) // Export used textures as PNG (open format replacement for BLP)
auto usedTextures = TextureExporter::collectUsedTextures(terrain_); auto usedTextures = TextureExporter::collectUsedTextures(terrain_);
if (!usedTextures.empty()) { if (!usedTextures.empty()) {