mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 09:03:52 +00:00
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:
parent
c532a1a787
commit
4148c890dc
1 changed files with 21 additions and 0 deletions
|
|
@ -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<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)
|
||||
auto usedTextures = TextureExporter::collectUsedTextures(terrain_);
|
||||
if (!usedTextures.empty()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue