From a1713052e5ed7f33897651c07e6075f1d89ad4f4 Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Sun, 26 Aug 2012 18:53:15 +0200 Subject: [PATCH] - fbx: support reading LimbNode attachments, less Property70 warnings. --- code/FBXDocument.cpp | 3 +++ code/FBXDocument.h | 10 ++++++++++ code/FBXNodeAttribute.cpp | 21 ++++++++++++++++++--- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/code/FBXDocument.cpp b/code/FBXDocument.cpp index ea4b56631..b0c2de289 100644 --- a/code/FBXDocument.cpp +++ b/code/FBXDocument.cpp @@ -152,6 +152,9 @@ const Object* LazyObject::Get(bool dieOnError) else if (!strcmp(classtag.c_str(),"Null")) { object.reset(new Null(id,element,doc,name)); } + else if (!strcmp(classtag.c_str(),"LimbNode")) { + object.reset(new LimbNode(id,element,doc,name)); + } } else if (!strncmp(obtype,"Deformer",length)) { if (!strcmp(classtag.c_str(),"Cluster")) { diff --git a/code/FBXDocument.h b/code/FBXDocument.h index 5b1b49307..9b7d5e3ec 100644 --- a/code/FBXDocument.h +++ b/code/FBXDocument.h @@ -271,6 +271,16 @@ public: }; +/** DOM base class for FBX limb node markers attached to a node */ +class LimbNode : public NodeAttribute +{ +public: + + LimbNode(uint64_t id, const Element& element, const Document& doc, const std::string& name); + ~LimbNode(); +}; + + /** DOM base class for FBX lights attached to a node */ class Light : public NodeAttribute { diff --git a/code/FBXNodeAttribute.cpp b/code/FBXNodeAttribute.cpp index 64abf9960..1b7314666 100644 --- a/code/FBXNodeAttribute.cpp +++ b/code/FBXNodeAttribute.cpp @@ -65,11 +65,11 @@ NodeAttribute::NodeAttribute(uint64_t id, const Element& element, const Document const std::string& classname = ParseTokenAsString(GetRequiredToken(element,2)); - // hack on the deriving type but Null attributes are the only case in which + // hack on the deriving type but Null/LimbNode attributes are the only case in which // the property table is by design absent and no warning should be generated // for it. - const bool is_null = !strcmp(classname.c_str(), "Null"); - props = GetPropertyTable(doc,"NodeAttribute.Fbx" + classname,element,sc, is_null); + const bool is_null_or_limb = !strcmp(classname.c_str(), "Null") || !strcmp(classname.c_str(), "LimbNode"); + props = GetPropertyTable(doc,"NodeAttribute.Fbx" + classname,element,sc, is_null_or_limb); } @@ -152,6 +152,21 @@ Null::~Null() } + +// ------------------------------------------------------------------------------------------------ +LimbNode::LimbNode(uint64_t id, const Element& element, const Document& doc, const std::string& name) +: NodeAttribute(id,element,doc,name) +{ + +} + + +// ------------------------------------------------------------------------------------------------ +LimbNode::~LimbNode() +{ + +} + } }