diff options
author | Gordon MacPherson <gordon@gordonite.tech> | 2021-03-30 02:33:06 +0100 |
---|---|---|
committer | Gordon MacPherson <gordon@gordonite.tech> | 2021-04-15 05:54:50 +0100 |
commit | 061b77e5e6c6e3f446734bf214e395e7e6f1a4b4 (patch) | |
tree | 809e3660221e0bc6d9bb119d0fa8591c3bbdb233 /modules/fbx/fbx_parser/FBXDocumentUtil.cpp | |
parent | a86e7c3bb7d9238e664be8a7c63d1cc19bde0d8c (diff) |
This stops using FBXPropertyTable as a pointer.
The base object will inherit the property table, for every FBX object, if it doesn't exist it will be ignored.
The previous code was dangerous and not simple to understand, this makes the code simpler and should result in no leaks with PropertyTable.
Features/Fixes:
Adds ability for multiple millions of polygons to be loaded.
Fixes memory leaks with tokens
Fixes memory leaks with property table
Fixes loading some corrupt files
Fixes meshes not having a unique name to the mesh node.
Opens up loading for two more versions: 7100 and 7200, up to 2020.
Preliminary support for Cinema4D files in parser now, before this was not possible it would cause memory corruption, which is gone now.
FBXProperties not being pointers presented simpler challenges in the long run also, fixed a bunch of bugs.
Diffstat (limited to 'modules/fbx/fbx_parser/FBXDocumentUtil.cpp')
-rw-r--r-- | modules/fbx/fbx_parser/FBXDocumentUtil.cpp | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/modules/fbx/fbx_parser/FBXDocumentUtil.cpp b/modules/fbx/fbx_parser/FBXDocumentUtil.cpp index df50a32c39..3930e005c3 100644 --- a/modules/fbx/fbx_parser/FBXDocumentUtil.cpp +++ b/modules/fbx/fbx_parser/FBXDocumentUtil.cpp @@ -137,36 +137,5 @@ void DOMWarning(const std::string &message, const std::shared_ptr<Element> eleme print_verbose("[FBX-DOM] warning:" + String(message.c_str())); } -// ------------------------------------------------------------------------------------------------ -// fetch a property table and the corresponding property template -const PropertyTable *GetPropertyTable(const Document &doc, - const std::string &templateName, - const ElementPtr element, - const ScopePtr sc, - bool no_warn /*= false*/) { - // todo: make this an abstraction - const ElementPtr Properties70 = sc->GetElement("Properties70"); - const PropertyTable *templateProps = static_cast<const PropertyTable *>(nullptr); - - if (templateName.length()) { - PropertyTemplateMap::const_iterator it = doc.Templates().find(templateName); - if (it != doc.Templates().end()) { - templateProps = (*it).second; - } - } - - if (!Properties70 || !Properties70->Compound()) { - if (!no_warn) { - DOMWarning("property table (Properties70) not found", element); - } - if (templateProps) { - return new const PropertyTable(templateProps); - } else { - return new const PropertyTable(); - } - } - - return new PropertyTable(Properties70, templateProps); -} } // namespace Util } // namespace FBXDocParser |