From 9ea7fc2856397b9f39a8f331846775fba45a2380 Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Sun, 26 Aug 2012 17:45:09 +0200 Subject: [PATCH] - fbx: don't die if a file contains no GlobalSettings. --- code/FBXConverter.cpp | 2 +- code/FBXDocument.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/code/FBXConverter.cpp b/code/FBXConverter.cpp index 0c17f11d4..190f4a7ff 100644 --- a/code/FBXConverter.cpp +++ b/code/FBXConverter.cpp @@ -1797,7 +1797,7 @@ private: // empty animations would fail validation, so drop them delete anim; animations.pop_back(); - FBXImporter::LogInfo("ignoring empty AnimationStack: " + name); + FBXImporter::LogInfo("ignoring empty AnimationStack (using IK?): " + name); return; } diff --git a/code/FBXDocument.cpp b/code/FBXDocument.cpp index fdfff15cf..051a51110 100644 --- a/code/FBXDocument.cpp +++ b/code/FBXDocument.cpp @@ -162,7 +162,7 @@ const Object* LazyObject::Get(bool dieOnError) } } else if (!strncmp(obtype,"Model",length)) { - // do not load IKEffectors yet + // FK and IK effectors are not supported if (strcmp(classtag.c_str(),"IKEffector") && strcmp(classtag.c_str(),"FKEffector")) { object.reset(new Model(id,element,doc,name)); } @@ -318,7 +318,10 @@ void Document::ReadGlobalSettings() const Scope& sc = parser.GetRootScope(); const Element* const ehead = sc["GlobalSettings"]; if(!ehead || !ehead->Compound()) { - DOMError("no GlobalSettings dictionary found"); + DOMWarning("no GlobalSettings dictionary found"); + + globals.reset(new FileGlobalSettings(*this, boost::make_shared())); + return; } boost::shared_ptr props = GetPropertyTable(*this, "", *ehead, *ehead->Compound(), true);