2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-07-02 22:08:11 +00:00

feat: T4 xanim binary dumping and loading (#854)

This commit is contained in:
mo
2026-06-27 13:16:50 +01:00
committed by GitHub
parent 8d905cca2f
commit b5d50120ad
8 changed files with 16 additions and 8 deletions
+1 -1
View File
@@ -129,7 +129,7 @@ The following section specify which assets are supported to be dumped to disk (u
| PhysPreset | ❌ | ❌ | |
| PhysConstraints | ❌ | ❌ | |
| DestructibleDef | ❌ | ❌ | |
| XAnimParts | | | |
| XAnimParts | | | |
| XModel | ✅ | ❌ | Model data can be exported to `XMODEL_EXPORT/XMODEL_BIN`, `OBJ`, `GLB/GLTF`. |
| Material | ❌ | ❌ | |
| MaterialTechniqueSet | ❌ | ❌ | |
+2 -2
View File
@@ -236,8 +236,8 @@ namespace T4
struct XAnimPartTransFrames
{
float mins[3];
float size[3];
vec3_t mins;
vec3_t size;
XAnimDynamicFrames frames;
XAnimDynamicIndicesTrans indices;
};
+2
View File
@@ -3,6 +3,7 @@
#include "Asset/GlobalAssetPoolsLoader.h"
#include "Game/T4/AssetMarkerT4.h"
#include "Game/T4/T4.h"
#include "Game/T4/XAnim/XAnimLoaderT4.h"
#include "Localize/AssetLoaderLocalizeT4.h"
using namespace T4;
@@ -85,6 +86,7 @@ namespace
{
auto& memory = zone.Memory();
collection.AddAssetCreator(xanim::CreateLoaderT4(memory, searchPath, zone));
collection.AddAssetCreator(localize::CreateLoaderT4(memory, searchPath, zone));
}
} // namespace
@@ -1,4 +1,4 @@
#options GAME(IW3, IW4, IW5, T5, T6)
#options GAME(IW3, IW4, IW5, T4, T5, T6)
#filename "Game/" + GAME + "/XAnim/XAnimLoader" + GAME + ".cpp"
@@ -12,6 +12,8 @@
#elif GAME == "IW5"
#define FEATURE_IW5
#define HAS_DELTA_QUAT_3D
#elif GAME == "T4"
#define FEATURE_T4
#elif GAME == "T5"
#define FEATURE_T5
#elif GAME == "T6"
+1 -1
View File
@@ -1,4 +1,4 @@
#options GAME(IW3, IW4, IW5, T5, T6)
#options GAME(IW3, IW4, IW5, T4, T5, T6)
#filename "Game/" + GAME + "/XAnim/XAnimLoader" + GAME + ".h"
+2
View File
@@ -1,6 +1,7 @@
#include "ObjWriterT4.h"
#include "Game/T4/Image/ImageDumperT4.h"
#include "Game/T4/XAnim/XAnimDumperT4.h"
#include "Game/T4/XModel/XModelDumperT4.h"
#include "Localize/LocalizeDumperT4.h"
#include "RawFile/RawFileDumperT4.h"
@@ -10,6 +11,7 @@ using namespace T4;
void ObjWriter::RegisterAssetDumpers(AssetDumpingContext& context)
{
RegisterAssetDumper(std::make_unique<xanim::DumperT4>());
RegisterAssetDumper(std::make_unique<xmodel::DumperT4>());
RegisterAssetDumper(std::make_unique<image::DumperT4>());
RegisterAssetDumper(std::make_unique<localize::DumperT4>());
@@ -1,4 +1,4 @@
#options GAME(IW3, IW4, IW5, T5, T6)
#options GAME(IW3, IW4, IW5, T4, T5, T6)
#filename "Game/" + GAME + "/XAnim/XAnimDumper" + GAME + ".cpp"
@@ -12,6 +12,8 @@
#elif GAME == "IW5"
#define FEATURE_IW5
#define HAS_DELTA_QUAT_3D
#elif GAME == "T4"
#define FEATURE_T4
#elif GAME == "T5"
#define FEATURE_T5
#elif GAME == "T6"
@@ -346,7 +348,7 @@ namespace xanim
WriteCompiledXAnim(
*assetFile,
commonParts,
#if defined(FEATURE_IW3)
#if defined(FEATURE_IW3) || defined(FEATURE_T4)
CompiledXAnimVersion::VERSION_17
#elif defined(FEATURE_IW4) || defined(FEATURE_IW5)
// Make sure we dump as many anims as possible in an IW3 modtools compatible way
+1 -1
View File
@@ -1,4 +1,4 @@
#options GAME(IW3, IW4, IW5, T5, T6)
#options GAME(IW3, IW4, IW5, T4, T5, T6)
#filename "Game/" + GAME + "/XAnim/XAnimDumper" + GAME + ".h"