From 4148c890dcffc2385e51620c0dd1121a440fb21d Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 5 May 2026 10:44:38 -0700 Subject: [PATCH] feat(editor): auto-export WMO buildings as WOB placeholders on zone save MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- tools/editor/editor_app.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tools/editor/editor_app.cpp b/tools/editor/editor_app.cpp index 9ed1c0e4..87925d29 100644 --- a/tools/editor/editor_app.cpp +++ b/tools/editor/editor_app.cpp @@ -6,6 +6,7 @@ #include "texture_exporter.hpp" #include "dbc_exporter.hpp" #include "pipeline/wowee_model.hpp" +#include "pipeline/wowee_building.hpp" #include "core/coordinates.hpp" #include "rendering/vk_context.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"); } + // Convert placed WMO buildings to WOB open format + if (objectPlacer_.objectCount() > 0) { + std::unordered_set 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) auto usedTextures = TextureExporter::collectUsedTextures(terrain_); if (!usedTextures.empty()) {