feat(model3d): complete stage 1-2 import pipeline

This commit is contained in:
西风逍遥游 committed 2026-08-24 23:58:14 +08:00
1 parent 12ba5f2b06
commit 5844b9a663
16 files changed
+529 -16

No files matched your search

+11 -1
View File
@@ -12,6 +12,7 @@
#include "common/Module.h"
#include "common/Resource.h"
#include "filesystem/Filesystem.h"
#include "filesystem/FileData.h"
#include "medialoader/Exception.h"
#include "medialoader/model/ModelLoader.h"
#include "model3d/EveFileSystem.h"
@@ -41,7 +42,7 @@ bool isModelPath(const std::string &path) {
ext == ".b3d" || ext == ".csm" || ext == ".irr" || ext == ".irrmesh" || ext == ".md2" ||
ext == ".md3" || ext == ".ms3d" || ext == ".smd" || ext == ".vta" || ext == ".bvh" ||
ext == ".ac" || ext == ".off" || ext == ".raw" || ext == ".ter" || ext == ".nff" ||
ext == ".ndo";
ext == ".ndo" || ext == ".evmodel";
}
// Mirror of the option mapping in Model3D.cpp.
@@ -106,6 +107,15 @@ public:
if (!fs) fs = filesystem::Filesystem::create();
if (!fs) return nullptr;
if (extensionOf(path) == ".evmodel") {
filesystem::FileData *packedRaw = fs->read(path);
if (!packedRaw) return nullptr;
eve::ref<filesystem::FileData> packed(packedRaw);
Model3D *module = ModuleManager::getInstance<Model3D>("Model3D");
if (!module) module = Model3D::create();
return module->newModelData(packed.get(), ".evmodel", options);
}
EveFileSystem eveFs(fs);
medialoader::ModelLoader loader(&eveFs);
try {