diff --git a/code/nel/tools/pipeline/max/builtin/animatable.cpp b/code/nel/tools/pipeline/max/builtin/animatable.cpp index 0a3abed4b..3bc65c181 100644 --- a/code/nel/tools/pipeline/max/builtin/animatable.cpp +++ b/code/nel/tools/pipeline/max/builtin/animatable.cpp @@ -39,6 +39,8 @@ using namespace std; // using namespace NLMISC; +#define PBM_ANIMATABLE_UNKNOWN2140_CHUNK_ID 0x2140 + namespace PIPELINE { namespace MAX { namespace BUILTIN { @@ -52,6 +54,8 @@ CAnimatable::~CAnimatable() { if (!m_ChunksOwnsPointers) { + delete m_Unknown2140; + m_Unknown2140 = NULL; delete m_AppData; m_AppData = NULL; } @@ -70,6 +74,12 @@ void CAnimatable::parse(uint16 version, uint filter) CSceneClass::parse(version); if (!m_ChunksOwnsPointers) { + m_Unknown2140 = getChunk(PBM_ANIMATABLE_UNKNOWN2140_CHUNK_ID); + if (m_Unknown2140) + { + // nldebug("Found unknown 0x2140"); + // TODO: Put std::cout code here + } m_AppData = static_cast(getChunk(PMBS_APP_DATA_CHUNK_ID)); } } @@ -77,15 +87,16 @@ void CAnimatable::parse(uint16 version, uint filter) void CAnimatable::clean() { CSceneClass::clean(); - if (m_AppData) - { - m_AppData->clean(); - } + if (m_AppData) m_AppData->clean(); } void CAnimatable::build(uint16 version, uint filter) { CSceneClass::build(version); + if (m_Unknown2140) + { + putChunk(PBM_ANIMATABLE_UNKNOWN2140_CHUNK_ID, m_Unknown2140); + } if (m_AppData) { if (m_AppData->entries().size() == 0) @@ -103,6 +114,7 @@ void CAnimatable::build(uint16 version, uint filter) void CAnimatable::disown() { + m_Unknown2140 = NULL; m_AppData = NULL; CSceneClass::disown(); } diff --git a/code/nel/tools/pipeline/max/builtin/animatable.h b/code/nel/tools/pipeline/max/builtin/animatable.h index 74f09fa8e..cee7e1362 100644 --- a/code/nel/tools/pipeline/max/builtin/animatable.h +++ b/code/nel/tools/pipeline/max/builtin/animatable.h @@ -84,6 +84,7 @@ protected: virtual IStorageObject *createChunkById(uint16 id, bool container); private: + IStorageObject *m_Unknown2140; STORAGE::CAppData *m_AppData; }; /* class CAnimatable */ diff --git a/code/nel/tools/pipeline/max/builtin/builtin.cpp b/code/nel/tools/pipeline/max/builtin/builtin.cpp index 344caf6df..dafe1d5e8 100644 --- a/code/nel/tools/pipeline/max/builtin/builtin.cpp +++ b/code/nel/tools/pipeline/max/builtin/builtin.cpp @@ -205,14 +205,30 @@ const CUserDataTypeSuperClassDesc UserDataTypeSuperClassDesc(&ReferenceTargetCla typedef CSuperClassDescUnknown CUserTypeSuperClassDesc; const CUserTypeSuperClassDesc UserTypeSuperClassDesc(&ReferenceTargetClassDesc, "UserTypeSuperClassUnknown"); -// 0x40 - shape object +// 0x40 - shape object (text, ...) typedef CSuperClassDescUnknown CShapeObjectSuperClassDesc; const CShapeObjectSuperClassDesc ShapeObjectSuperClassDesc(&GeomObjectClassDesc, "ShapeObjectSuperClassUnknown"); -// 0x30 - light object +// 0x30 - light object (omni, ...) typedef CSuperClassDescUnknown CLightObjectSuperClassDesc; const CLightObjectSuperClassDesc LightObjectSuperClassDesc(&ObjectClassDesc, "LightObjectSuperClassUnknown"); +// 0x20 camera - (target, ...) +typedef CSuperClassDescUnknown CCameraObjectSuperClassDesc; +const CCameraObjectSuperClassDesc CameraObjectSuperClassDesc(&ObjectClassDesc, "CameraObjectSuperClassUnknown"); + +// Creating superclass 0x820 (FFD Binding) (0xd6636ea2, 0x9aa42bf3) that does not exist = WSM, sub of modifier (under baseobj) +typedef CSuperClassDescUnknown CWSModifierSuperClassDesc; +const CWSModifierSuperClassDesc WSModifierSuperClassDesc(&BaseObjectClassDesc, "WSModifierSuperClassUnknown"); + +// Creating superclass 0x830 (FFD(Cyl)) (0xfa4700be, 0xbbe85051) that does not exist = WSMObject, sub of object +typedef CSuperClassDescUnknown CWSMObjectSuperClassDesc; +const CWSMObjectSuperClassDesc WSMObjectSuperClassDesc(&ObjectClassDesc, "WSMObjectSuperClassUnknown"); + +// Creating superclass 0xc30 (Placement) (0x00000100, 0x00000000) that does not exist | xyzgen, sub of mtlbase +typedef CSuperClassDescUnknown CXYZGenSuperClassDesc; +const CXYZGenSuperClassDesc XYZGenSuperClassDesc(&ReferenceTargetClassDesc, "XYZGenSuperClassUnknown"); + } /* anonymous namespace */ CBuiltin::CBuiltin() @@ -309,6 +325,10 @@ void CBuiltin::registerClasses(CSceneClassRegistry *registry) registry->add(&UserTypeSuperClassDesc); registry->add(&ShapeObjectSuperClassDesc); registry->add(&LightObjectSuperClassDesc); + registry->add(&CameraObjectSuperClassDesc); + registry->add(&WSModifierSuperClassDesc); + registry->add(&WSMObjectSuperClassDesc); + registry->add(&XYZGenSuperClassDesc); } } /* namespace BUILTIN */ diff --git a/code/nel/tools/pipeline/max_rewrite_assets/main.cpp b/code/nel/tools/pipeline/max_rewrite_assets/main.cpp index 831c2a805..bceb17cb8 100644 --- a/code/nel/tools/pipeline/max_rewrite_assets/main.cpp +++ b/code/nel/tools/pipeline/max_rewrite_assets/main.cpp @@ -57,6 +57,9 @@ using namespace PIPELINE::MAX::EPOLY; CSceneClassRegistry SceneClassRegistry; +// Never enable this +bool DebugParser = true; + bool DisplayStream = false; bool WriteModified = false; bool WriteDummy = true; @@ -65,7 +68,8 @@ const char *DatabaseDirectory = "w:\\database\\"; const char *LinuxDatabaseDirectory = "/srv/work/database/"; bool RunningLinux = true; -const char *SrcDirectoryRecursive = "w:\\database\\interfaces\\"; +//const char *SrcDirectoryRecursive = "w:\\database\\interfaces\\"; +const char *SrcDirectoryRecursive = "w:\\database\\"; std::set MissingFiles; std::map KnownFileCache; @@ -637,13 +641,14 @@ void handleFile(const std::string &path) PIPELINE::MAX::CScene scene(&SceneClassRegistry, &dllDirectory, &classDirectory3); serializeStorageContainer(&scene, infile, "Scene"); - /* - // Not parsing the scene for this function. - scene.parse(VersionUnknown); - scene.clean(); - scene.build(VersionUnknown); - scene.disown(); - */ + if (DebugParser) + { + // Not parsing the scene for this function. + scene.parse(VersionUnknown); + scene.clean(); + scene.build(VersionUnknown); + scene.disown(); + } /* PIPELINE::MAX::CStorageContainer dllDirectory;