瀏覽代碼

- fbx: support reading LimbNode attachments, less Property70 warnings.

Alexander Gessler 13 年之前
父節點
當前提交
a1713052e5
共有 3 個文件被更改,包括 31 次插入3 次删除
  1. 3 0
      code/FBXDocument.cpp
  2. 10 0
      code/FBXDocument.h
  3. 18 3
      code/FBXNodeAttribute.cpp

+ 3 - 0
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")) {

+ 10 - 0
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
 {

+ 18 - 3
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()
+{
+
+}
+
 }
 }