diff --git a/interface/src/renderer/FBXReader.cpp b/interface/src/renderer/FBXReader.cpp index 9b92c531cd..24644866cd 100644 --- a/interface/src/renderer/FBXReader.cpp +++ b/interface/src/renderer/FBXReader.cpp @@ -334,6 +334,18 @@ public: FBXBlendshape blendshape; }; +void printNode(const FBXNode& node, int indent) { + QByteArray spaces(indent, ' '); + qDebug("%s%s: ", spaces.data(), node.name.data()); + foreach (const QVariant& property, node.properties) { + qDebug() << property; + } + qDebug() << "\n"; + foreach (const FBXNode& child, node.children) { + printNode(child, indent + 1); + } +} + FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping) { QHash meshes; QVector blendshapes; @@ -560,8 +572,10 @@ FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping) } else if (object.name == "Texture") { foreach (const FBXNode& subobject, object.children) { if (subobject.name == "RelativeFilename") { - textureFilenames.insert(object.properties.at(0).value(), - subobject.properties.at(0).toByteArray()); + // trim off any path information + QByteArray filename = subobject.properties.at(0).toByteArray(); + filename = filename.mid(qMax(filename.lastIndexOf('\\'), filename.lastIndexOf('/')) + 1); + textureFilenames.insert(object.properties.at(0).value(), filename); } } } else if (object.name == "Deformer") { @@ -678,18 +692,6 @@ FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping) return geometry; } -void printNode(const FBXNode& node, int indent) { - QByteArray spaces(indent, ' '); - qDebug("%s%s: ", spaces.data(), node.name.data()); - foreach (const QVariant& property, node.properties) { - qDebug() << property; - } - qDebug() << "\n"; - foreach (const FBXNode& child, node.children) { - printNode(child, indent + 1); - } -} - FBXGeometry readFBX(const QByteArray& model, const QByteArray& mapping) { QBuffer modelBuffer(const_cast(&model)); modelBuffer.open(QIODevice::ReadOnly); diff --git a/interface/src/renderer/GeometryCache.cpp b/interface/src/renderer/GeometryCache.cpp index 482545b91d..c63ec7eed4 100644 --- a/interface/src/renderer/GeometryCache.cpp +++ b/interface/src/renderer/GeometryCache.cpp @@ -363,10 +363,7 @@ void NetworkGeometry::maybeReadModelWithMapping() { glBindBuffer(GL_ARRAY_BUFFER, 0); QString basePath = url.path(); - int idx = basePath.lastIndexOf('/'); - if (idx != -1) { - basePath = basePath.left(idx); - } + basePath = basePath.left(basePath.lastIndexOf('/') + 1); if (!mesh.diffuseFilename.isEmpty()) { url.setPath(basePath + mesh.diffuseFilename); networkMesh.diffuseTexture = Application::getInstance()->getTextureCache()->getTexture(url, mesh.isEye);