- fbx: work on reading the first layer of geometry data channels.

pull/14/head
Alexander Gessler 2012-06-26 21:35:16 +02:00
parent a996ecba75
commit 7108713238
1 changed files with 24 additions and 0 deletions

View File

@ -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<int> 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");
}
}
}
// ------------------------------------------------------------------------------------------------