diff --git a/interface/src/ModelPackager.cpp b/interface/src/ModelPackager.cpp index e997095bcd..e6f7c50840 100644 --- a/interface/src/ModelPackager.cpp +++ b/interface/src/ModelPackager.cpp @@ -298,7 +298,7 @@ void ModelPackager::populateBasicMapping(QVariantHash& mapping, QString filename // If there are no blendshape mappings, and we detect that this is likely a mixamo file, // then we can add the default mixamo to blendshape mappings. if (!mapping.contains(BLENDSHAPE_FIELD) && likelyMixamoFile) { - QVariantHash blendshapes; + hifi::VariantMultiHash blendshapes; blendshapes.insert("BrowsD_L", QVariantList() << "BrowsDown_Left" << 1.0); blendshapes.insert("BrowsD_R", QVariantList() << "BrowsDown_Right" << 1.0); blendshapes.insert("BrowsU_C", QVariantList() << "BrowsUp_Left" << 1.0); diff --git a/libraries/model-serializers/src/FST.cpp b/libraries/model-serializers/src/FST.cpp index 41e5107912..f239b67521 100644 --- a/libraries/model-serializers/src/FST.cpp +++ b/libraries/model-serializers/src/FST.cpp @@ -86,7 +86,7 @@ FST* FST::createFSTFromModel(const QString& fstPath, const QString& modelFilePat // If there are no blendshape mappings, and we detect that this is likely a mixamo file, // then we can add the default mixamo to blendshape mappings. if (likelyMixamoFile) { - QVariantHash blendshapes; + hifi::VariantMultiHash blendshapes; blendshapes.insert("BrowsD_L", QVariantList() << "BrowsDown_Left" << 1.0); blendshapes.insert("BrowsD_R", QVariantList() << "BrowsDown_Right" << 1.0); blendshapes.insert("BrowsU_C", QVariantList() << "BrowsUp_Left" << 1.0); diff --git a/libraries/model-serializers/src/FSTReader.cpp b/libraries/model-serializers/src/FSTReader.cpp index c06e163136..7aa3570dd6 100644 --- a/libraries/model-serializers/src/FSTReader.cpp +++ b/libraries/model-serializers/src/FSTReader.cpp @@ -20,8 +20,8 @@ #include #include -QVariantHash FSTReader::parseMapping(QIODevice* device) { - QVariantHash properties; +hifi::VariantMultiHash FSTReader::parseMapping(QIODevice* device) { + hifi::VariantMultiHash properties; QByteArray line; while (!(line = device->readLine()).isEmpty()) { @@ -76,7 +76,7 @@ static void splitBlendshapes(hifi::VariantMultiHash& bs, const QString& key, con } // convert legacy blendshapes to arkit blendshapes -static void fixUpLegacyBlendshapes(QVariantHash & properties) { +static void fixUpLegacyBlendshapes(hifi::VariantMultiHash & properties) { hifi::VariantMultiHash bs = properties.value("bs").toHash(); // These blendshapes have no ARKit equivalent, so we remove them. @@ -95,10 +95,10 @@ static void fixUpLegacyBlendshapes(QVariantHash & properties) { properties.insert("bs", bs); } -QVariantHash FSTReader::readMapping(const QByteArray& data) { +hifi::VariantMultiHash FSTReader::readMapping(const QByteArray& data) { QBuffer buffer(const_cast(&data)); buffer.open(QIODevice::ReadOnly); - QVariantHash mapping = FSTReader::parseMapping(&buffer); + hifi::VariantMultiHash mapping = FSTReader::parseMapping(&buffer); fixUpLegacyBlendshapes(mapping); return mapping; } @@ -182,17 +182,17 @@ FSTReader::ModelType FSTReader::getTypeFromName(const QString& name) { return _namesToTypes[name]; } -FSTReader::ModelType FSTReader::predictModelType(const QVariantHash& mapping) { +FSTReader::ModelType FSTReader::predictModelType(const hifi::VariantMultiHash& mapping) { QVariantHash joints; - if (mapping.contains("joint") && mapping["joint"].type() == QVariant::Hash) { - joints = mapping["joint"].toHash(); + if (mapping.contains("joint") && mapping.value("joint").type() == QVariant::Hash) { + joints = mapping.value("joint").toHash(); } // if the mapping includes the type hint... then we trust the mapping if (mapping.contains(TYPE_FIELD)) { - return FSTReader::getTypeFromName(mapping[TYPE_FIELD].toString()); + return FSTReader::getTypeFromName(mapping.value(TYPE_FIELD).toString()); } // check for blendshapes diff --git a/libraries/model-serializers/src/FSTReader.h b/libraries/model-serializers/src/FSTReader.h index f9fd883f84..280671e5fb 100644 --- a/libraries/model-serializers/src/FSTReader.h +++ b/libraries/model-serializers/src/FSTReader.h @@ -48,13 +48,13 @@ public: }; /// Reads an FST mapping from the supplied data. - static QVariantHash readMapping(const QByteArray& data); + static hifi::VariantMultiHash readMapping(const QByteArray& data); /// Writes an FST mapping to a byte array. static QByteArray writeMapping(const hifi::VariantMultiHash& mapping); /// Predicts the type of model by examining the mapping - static ModelType predictModelType(const QVariantHash& mapping); + static ModelType predictModelType(const hifi::VariantMultiHash& mapping); static QVector getScripts(const QUrl& fstUrl, const hifi::VariantMultiHash& mapping = QVariantHash()); @@ -64,7 +64,7 @@ public: private: static void writeVariant(QBuffer& buffer, QVariantHash::const_iterator& it); - static QVariantHash parseMapping(QIODevice* device); + static hifi::VariantMultiHash parseMapping(QIODevice* device); static QHash _typesToNames; static QHash _namesToTypes;