Hack for avoiding lightmaps loading in starchamber

This commit is contained in:
Sam Gateau 2014-11-30 12:54:43 -08:00
parent 91fe014411
commit 321d651d77
3 changed files with 12 additions and 7 deletions

View file

@ -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));

View file

@ -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<QString, ExtractedMesh> meshes;
QHash<QString, QString> modelIDsToNames;
QHash<QString, int> 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<QByteArray*>(&model));
buffer.open(QIODevice::ReadOnly);
return extractFBXGeometry(parseFBX(&buffer), mapping);
return extractFBXGeometry(parseFBX(&buffer), mapping, loadLightmaps);
}
bool addMeshVoxelsOperation(OctreeElement* element, void* extraData) {

View file

@ -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);