From 321d651d77fe0c8927e003c08715020de8928765 Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Sun, 30 Nov 2014 12:54:43 -0800 Subject: [PATCH] Hack for avoiding lightmaps loading in starchamber --- interface/src/renderer/GeometryCache.cpp | 7 ++++++- libraries/fbx/src/FBXReader.cpp | 10 +++++----- libraries/fbx/src/FBXReader.h | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/interface/src/renderer/GeometryCache.cpp b/interface/src/renderer/GeometryCache.cpp index 5ef90732ef..04b59e7ea1 100644 --- a/interface/src/renderer/GeometryCache.cpp +++ b/interface/src/renderer/GeometryCache.cpp @@ -834,7 +834,12 @@ void GeometryReader::run() { if (_url.path().toLower().endsWith(".svo")) { fbxgeo = readSVO(_reply->readAll()); } else { - fbxgeo = readFBX(_reply->readAll(), _mapping); + bool grabLightmaps = true; + // HACK: For monday 12/01/2014 we need to kill lighmaps loading in starchamber... + if (_url.path().toLower().endsWith("loungev4_11-18.fbx")) { + grabLightmaps = false; + } + fbxgeo = readFBX(_reply->readAll(), _mapping, grabLightmaps); } QMetaObject::invokeMethod(geometry.data(), "setGeometry", Q_ARG(const FBXGeometry&, fbxgeo)); diff --git a/libraries/fbx/src/FBXReader.cpp b/libraries/fbx/src/FBXReader.cpp index fd9190f597..d77cbbd0a1 100644 --- a/libraries/fbx/src/FBXReader.cpp +++ b/libraries/fbx/src/FBXReader.cpp @@ -1194,7 +1194,7 @@ int matchTextureUVSetToAttributeChannel(const std::string& texUVSetName, const Q } } -FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping) { +FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping, bool loadLightmaps) { QHash meshes; QHash modelIDsToNames; QHash meshIDsToMeshIndices; @@ -1704,10 +1704,10 @@ FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping) } else if (type.contains("shininess")) { counter++; - } else if (type.contains("emissive")) { + } else if (loadLightmaps && type.contains("emissive")) { emissiveTextures.insert(getID(connection.properties, 2), getID(connection.properties, 1)); - } else if (type.contains("ambient")) { + } else if (loadLightmaps && type.contains("ambient")) { ambientTextures.insert(getID(connection.properties, 2), getID(connection.properties, 1)); } else { std::string typenam = type.data(); @@ -2372,10 +2372,10 @@ QByteArray writeMapping(const QVariantHash& mapping) { return buffer.data(); } -FBXGeometry readFBX(const QByteArray& model, const QVariantHash& mapping) { +FBXGeometry readFBX(const QByteArray& model, const QVariantHash& mapping, bool loadLightmaps) { QBuffer buffer(const_cast(&model)); buffer.open(QIODevice::ReadOnly); - return extractFBXGeometry(parseFBX(&buffer), mapping); + return extractFBXGeometry(parseFBX(&buffer), mapping, loadLightmaps); } bool addMeshVoxelsOperation(OctreeElement* element, void* extraData) { diff --git a/libraries/fbx/src/FBXReader.h b/libraries/fbx/src/FBXReader.h index d92f787050..3adf5b5ffb 100644 --- a/libraries/fbx/src/FBXReader.h +++ b/libraries/fbx/src/FBXReader.h @@ -253,7 +253,7 @@ QByteArray writeMapping(const QVariantHash& mapping); /// Reads FBX geometry from the supplied model and mapping data. /// \exception QString if an error occurs in parsing -FBXGeometry readFBX(const QByteArray& model, const QVariantHash& mapping); +FBXGeometry readFBX(const QByteArray& model, const QVariantHash& mapping, bool loadLightmaps = true); /// Reads SVO geometry from the supplied model data. FBXGeometry readSVO(const QByteArray& model);