diff --git a/src/ObjWriting/Game/T5/ObjWriterT5.cpp b/src/ObjWriting/Game/T5/ObjWriterT5.cpp index 19c5e277..b85d6c96 100644 --- a/src/ObjWriting/Game/T5/ObjWriterT5.cpp +++ b/src/ObjWriting/Game/T5/ObjWriterT5.cpp @@ -7,6 +7,7 @@ #include "Localize/LocalizeDumperT5.h" #include "RawFile/RawFileDumperT5.h" #include "StringTable/StringTableDumperT5.h" +#include "XAnim/XAnimDumperT5.h" using namespace T5; @@ -15,7 +16,7 @@ void ObjWriter::RegisterAssetDumpers(AssetDumpingContext& context) // REGISTER_DUMPER(AssetDumperPhysPreset, m_phys_preset) // REGISTER_DUMPER(AssetDumperPhysConstraints, m_phys_constraints) // REGISTER_DUMPER(AssetDumperDestructibleDef, m_destructible_def) - // REGISTER_DUMPER(AssetDumperXAnimParts, m_xanim_parts) + RegisterAssetDumper(std::make_unique()); RegisterAssetDumper(std::make_unique()); RegisterAssetDumper(std::make_unique()); RegisterAssetDumper(std::make_unique( diff --git a/src/ObjWriting/Game/T5/XAnim/XAnimDumperT5.cpp b/src/ObjWriting/Game/T5/XAnim/XAnimDumperT5.cpp new file mode 100644 index 00000000..adcda36d --- /dev/null +++ b/src/ObjWriting/Game/T5/XAnim/XAnimDumperT5.cpp @@ -0,0 +1,26 @@ +#include "XAnimDumperT5.h" + +#include "Utils/Logging/Log.h" + +using namespace T5; + +namespace xanim +{ + void DumperT5::DumpAsset(AssetDumpingContext& context, const XAssetInfo& asset) + { + auto* anim = asset.Asset(); + const auto& scriptStrings = context.m_zone.m_script_strings; + + con::info("Anim {}", anim->name); + if (anim->names) + { + for (auto boneIndex = 0u; boneIndex < anim->boneCount[PART_TYPE_ALL]; boneIndex++) + { + const auto* boneName = scriptStrings.CValue(anim->names[boneIndex]); + con::info(" Bone {}: {}", boneIndex, boneName ? boneName : ""); + } + } + + con::info(""); + } +} // namespace xanim diff --git a/src/ObjWriting/Game/T5/XAnim/XAnimDumperT5.h b/src/ObjWriting/Game/T5/XAnim/XAnimDumperT5.h new file mode 100644 index 00000000..8ce07039 --- /dev/null +++ b/src/ObjWriting/Game/T5/XAnim/XAnimDumperT5.h @@ -0,0 +1,13 @@ +#pragma once + +#include "Dumping/AbstractAssetDumper.h" +#include "Game/T5/T5.h" + +namespace xanim +{ + class DumperT5 final : public AbstractAssetDumper + { + protected: + void DumpAsset(AssetDumpingContext& context, const XAssetInfo& asset) override; + }; +} // namespace xanim