#pragma once
#include <unordered_map>
#include <vector>
#include <whiteout/models/mdx/structures.h>
#include <whiteout/models/mdx/types.h>
#include <whiteout/models/wem/diagnostics.h>
#include <whiteout/models/wem/document.h>
#include <whiteout/models/wem/profile.h>
namespace whiteout {
namespace models {
namespace wem {
namespace mdx_anim {
struct Context {
const std::unordered_map<u32, u32>* byObjectId = nullptr;
std::vector<u32> cameraNodes;
struct ProfileLayers {
ProfileId profile = ProfileId::Generic;
std::vector<std::vector<u32>> byMaterial;
};
std::vector<ProfileLayers> layerOrdinals;
};
void Import(const mdx::Model& source, const Context& context, Document& document, u32 model,
Diagnostics& out);
struct ExportContext {
enum class Slot : u8 {
None = 0,
Bone,
Helper,
Light,
Attachment,
ParticleEmitter,
ParticleEmitter2,
RibbonEmitter,
CornEmitter,
EventObject,
CollisionShape,
Camera,
};
struct NodeSlot {
Slot slot = Slot::None;
u32 index = 0; };
std::vector<NodeSlot> nodeSlots;
std::vector<std::vector<u32>> geosetsOfMesh;
std::vector<std::vector<u32>> sectionOfGeoset;
std::vector<std::vector<u32>> layerOfOrdinal;
};
void Export(const Document& document, u32 model, ProfileId profile, const ExportContext& context,
mdx::Model& out, Diagnostics& diagnostics);
} } } }