From 710871323882cb4f8fe17ffca4c6ca6c9d578734 Mon Sep 17 00:00:00 2001 From: Alexander Gessler Date: Tue, 26 Jun 2012 21:35:16 +0200 Subject: [PATCH] - fbx: work on reading the first layer of geometry data channels. --- code/FBXDocument.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/code/FBXDocument.cpp b/code/FBXDocument.cpp index a34a7c191..721c9bda3 100644 --- a/code/FBXDocument.cpp +++ b/code/FBXDocument.cpp @@ -48,6 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "FBXParser.h" #include "FBXDocument.h" #include "FBXUtil.h" +#include "FBXImporter.h" namespace { @@ -268,6 +269,29 @@ MeshGeometry::MeshGeometry(const Element& element, const std::string& name) std::vector tempFaces; ReadIntDataArray(tempFaces,PolygonVertexIndex); + + // ignore all but the first layer, but warn about any further layers + for (ElementMap::const_iterator it = Layer.first; it != Layer.second; ++it) { + const TokenList& tokens = (*it).second->Tokens(); + + const char* err; + const int index = ParseTokenAsInt(*tokens[0], err); + if(err) { + DOMError(err,&element); + } + + if(index == 0) { + const Scope* const layer = (*it).second->Compound(); + if (layer) { + DOMError("expected layer scope",&element); + } + + // XXX read layer data + } + else { + FBXImporter::LogWarn("ignoring additional geometry layers"); + } + } } // ------------------------------------------------------------------------------------------------