mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-08 14:38:08 +02:00
Fix warnings related to deprecated usage of multiple keys in QHash and QMap
This replaces those uses with QMultiHash and QMultiMap
This commit is contained in:
parent
57167cdfef
commit
d77c8bbe41
17 changed files with 226 additions and 221 deletions
|
@ -179,7 +179,7 @@ bool ModelPackager::zipModel() {
|
|||
auto list = wdir.entryList(QDir::NoDotAndDotDot | QDir::AllEntries);
|
||||
for (auto script : list) {
|
||||
auto sc = tempDir.relativeFilePath(scriptDir.path()) + "/" + QUrl(script).fileName();
|
||||
_mapping.insertMulti(SCRIPT_FIELD, sc);
|
||||
_mapping.insert(SCRIPT_FIELD, sc);
|
||||
}
|
||||
copyDirectoryContent(wdir, scriptDir);
|
||||
}
|
||||
|
@ -204,8 +204,8 @@ bool ModelPackager::zipModel() {
|
|||
fbx.copy(newPath);
|
||||
|
||||
// Correct FST
|
||||
_mapping[FILENAME_FIELD] = tempDir.relativeFilePath(newPath);
|
||||
_mapping[TEXDIR_FIELD] = tempDir.relativeFilePath(texDir.path());
|
||||
_mapping.replace(FILENAME_FIELD, tempDir.relativeFilePath(newPath));
|
||||
_mapping.replace(TEXDIR_FIELD, tempDir.relativeFilePath(texDir.path()));
|
||||
|
||||
for (auto multi : _mapping.values(SCRIPT_FIELD)) {
|
||||
multi.fromValue(tempDir.relativeFilePath(scriptDir.path()) + multi.toString());
|
||||
|
@ -299,56 +299,56 @@ void ModelPackager::populateBasicMapping(QVariantHash& mapping, QString filename
|
|||
// then we can add the default mixamo to blendshape mappings.
|
||||
if (!mapping.contains(BLENDSHAPE_FIELD) && likelyMixamoFile) {
|
||||
QVariantHash blendshapes;
|
||||
blendshapes.insertMulti("BrowsD_L", QVariantList() << "BrowsDown_Left" << 1.0);
|
||||
blendshapes.insertMulti("BrowsD_R", QVariantList() << "BrowsDown_Right" << 1.0);
|
||||
blendshapes.insertMulti("BrowsU_C", QVariantList() << "BrowsUp_Left" << 1.0);
|
||||
blendshapes.insertMulti("BrowsU_C", QVariantList() << "BrowsUp_Right" << 1.0);
|
||||
blendshapes.insertMulti("BrowsU_L", QVariantList() << "BrowsUp_Left" << 1.0);
|
||||
blendshapes.insertMulti("BrowsU_R", QVariantList() << "BrowsUp_Right" << 1.0);
|
||||
blendshapes.insertMulti("ChinLowerRaise", QVariantList() << "Jaw_Up" << 1.0);
|
||||
blendshapes.insertMulti("ChinUpperRaise", QVariantList() << "UpperLipUp_Left" << 0.5);
|
||||
blendshapes.insertMulti("ChinUpperRaise", QVariantList() << "UpperLipUp_Right" << 0.5);
|
||||
blendshapes.insertMulti("EyeBlink_L", QVariantList() << "Blink_Left" << 1.0);
|
||||
blendshapes.insertMulti("EyeBlink_R", QVariantList() << "Blink_Right" << 1.0);
|
||||
blendshapes.insertMulti("EyeOpen_L", QVariantList() << "EyesWide_Left" << 1.0);
|
||||
blendshapes.insertMulti("EyeOpen_R", QVariantList() << "EyesWide_Right" << 1.0);
|
||||
blendshapes.insertMulti("EyeSquint_L", QVariantList() << "Squint_Left" << 1.0);
|
||||
blendshapes.insertMulti("EyeSquint_R", QVariantList() << "Squint_Right" << 1.0);
|
||||
blendshapes.insertMulti("JawFwd", QVariantList() << "JawForeward" << 1.0);
|
||||
blendshapes.insertMulti("JawLeft", QVariantList() << "JawRotateY_Left" << 0.5);
|
||||
blendshapes.insertMulti("JawOpen", QVariantList() << "MouthOpen" << 0.7);
|
||||
blendshapes.insertMulti("JawRight", QVariantList() << "Jaw_Right" << 1.0);
|
||||
blendshapes.insertMulti("LipsFunnel", QVariantList() << "JawForeward" << 0.39);
|
||||
blendshapes.insertMulti("LipsFunnel", QVariantList() << "Jaw_Down" << 0.36);
|
||||
blendshapes.insertMulti("LipsFunnel", QVariantList() << "MouthNarrow_Left" << 1.0);
|
||||
blendshapes.insertMulti("LipsFunnel", QVariantList() << "MouthNarrow_Right" << 1.0);
|
||||
blendshapes.insertMulti("LipsFunnel", QVariantList() << "MouthWhistle_NarrowAdjust_Left" << 0.5);
|
||||
blendshapes.insertMulti("LipsFunnel", QVariantList() << "MouthWhistle_NarrowAdjust_Right" << 0.5);
|
||||
blendshapes.insertMulti("LipsFunnel", QVariantList() << "TongueUp" << 1.0);
|
||||
blendshapes.insertMulti("LipsLowerClose", QVariantList() << "LowerLipIn" << 1.0);
|
||||
blendshapes.insertMulti("LipsLowerDown", QVariantList() << "LowerLipDown_Left" << 0.7);
|
||||
blendshapes.insertMulti("LipsLowerDown", QVariantList() << "LowerLipDown_Right" << 0.7);
|
||||
blendshapes.insertMulti("LipsLowerOpen", QVariantList() << "LowerLipOut" << 1.0);
|
||||
blendshapes.insertMulti("LipsPucker", QVariantList() << "MouthNarrow_Left" << 1.0);
|
||||
blendshapes.insertMulti("LipsPucker", QVariantList() << "MouthNarrow_Right" << 1.0);
|
||||
blendshapes.insertMulti("LipsUpperClose", QVariantList() << "UpperLipIn" << 1.0);
|
||||
blendshapes.insertMulti("LipsUpperOpen", QVariantList() << "UpperLipOut" << 1.0);
|
||||
blendshapes.insertMulti("LipsUpperUp", QVariantList() << "UpperLipUp_Left" << 0.7);
|
||||
blendshapes.insertMulti("LipsUpperUp", QVariantList() << "UpperLipUp_Right" << 0.7);
|
||||
blendshapes.insertMulti("MouthDimple_L", QVariantList() << "Smile_Left" << 0.25);
|
||||
blendshapes.insertMulti("MouthDimple_R", QVariantList() << "Smile_Right" << 0.25);
|
||||
blendshapes.insertMulti("MouthFrown_L", QVariantList() << "Frown_Left" << 1.0);
|
||||
blendshapes.insertMulti("MouthFrown_R", QVariantList() << "Frown_Right" << 1.0);
|
||||
blendshapes.insertMulti("MouthLeft", QVariantList() << "Midmouth_Left" << 1.0);
|
||||
blendshapes.insertMulti("MouthRight", QVariantList() << "Midmouth_Right" << 1.0);
|
||||
blendshapes.insertMulti("MouthSmile_L", QVariantList() << "Smile_Left" << 1.0);
|
||||
blendshapes.insertMulti("MouthSmile_R", QVariantList() << "Smile_Right" << 1.0);
|
||||
blendshapes.insertMulti("Puff", QVariantList() << "CheekPuff_Left" << 1.0);
|
||||
blendshapes.insertMulti("Puff", QVariantList() << "CheekPuff_Right" << 1.0);
|
||||
blendshapes.insertMulti("Sneer", QVariantList() << "NoseScrunch_Left" << 0.75);
|
||||
blendshapes.insertMulti("Sneer", QVariantList() << "NoseScrunch_Right" << 0.75);
|
||||
blendshapes.insertMulti("Sneer", QVariantList() << "Squint_Left" << 0.5);
|
||||
blendshapes.insertMulti("Sneer", QVariantList() << "Squint_Right" << 0.5);
|
||||
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);
|
||||
blendshapes.insert("BrowsU_C", QVariantList() << "BrowsUp_Right" << 1.0);
|
||||
blendshapes.insert("BrowsU_L", QVariantList() << "BrowsUp_Left" << 1.0);
|
||||
blendshapes.insert("BrowsU_R", QVariantList() << "BrowsUp_Right" << 1.0);
|
||||
blendshapes.insert("ChinLowerRaise", QVariantList() << "Jaw_Up" << 1.0);
|
||||
blendshapes.insert("ChinUpperRaise", QVariantList() << "UpperLipUp_Left" << 0.5);
|
||||
blendshapes.insert("ChinUpperRaise", QVariantList() << "UpperLipUp_Right" << 0.5);
|
||||
blendshapes.insert("EyeBlink_L", QVariantList() << "Blink_Left" << 1.0);
|
||||
blendshapes.insert("EyeBlink_R", QVariantList() << "Blink_Right" << 1.0);
|
||||
blendshapes.insert("EyeOpen_L", QVariantList() << "EyesWide_Left" << 1.0);
|
||||
blendshapes.insert("EyeOpen_R", QVariantList() << "EyesWide_Right" << 1.0);
|
||||
blendshapes.insert("EyeSquint_L", QVariantList() << "Squint_Left" << 1.0);
|
||||
blendshapes.insert("EyeSquint_R", QVariantList() << "Squint_Right" << 1.0);
|
||||
blendshapes.insert("JawFwd", QVariantList() << "JawForeward" << 1.0);
|
||||
blendshapes.insert("JawLeft", QVariantList() << "JawRotateY_Left" << 0.5);
|
||||
blendshapes.insert("JawOpen", QVariantList() << "MouthOpen" << 0.7);
|
||||
blendshapes.insert("JawRight", QVariantList() << "Jaw_Right" << 1.0);
|
||||
blendshapes.insert("LipsFunnel", QVariantList() << "JawForeward" << 0.39);
|
||||
blendshapes.insert("LipsFunnel", QVariantList() << "Jaw_Down" << 0.36);
|
||||
blendshapes.insert("LipsFunnel", QVariantList() << "MouthNarrow_Left" << 1.0);
|
||||
blendshapes.insert("LipsFunnel", QVariantList() << "MouthNarrow_Right" << 1.0);
|
||||
blendshapes.insert("LipsFunnel", QVariantList() << "MouthWhistle_NarrowAdjust_Left" << 0.5);
|
||||
blendshapes.insert("LipsFunnel", QVariantList() << "MouthWhistle_NarrowAdjust_Right" << 0.5);
|
||||
blendshapes.insert("LipsFunnel", QVariantList() << "TongueUp" << 1.0);
|
||||
blendshapes.insert("LipsLowerClose", QVariantList() << "LowerLipIn" << 1.0);
|
||||
blendshapes.insert("LipsLowerDown", QVariantList() << "LowerLipDown_Left" << 0.7);
|
||||
blendshapes.insert("LipsLowerDown", QVariantList() << "LowerLipDown_Right" << 0.7);
|
||||
blendshapes.insert("LipsLowerOpen", QVariantList() << "LowerLipOut" << 1.0);
|
||||
blendshapes.insert("LipsPucker", QVariantList() << "MouthNarrow_Left" << 1.0);
|
||||
blendshapes.insert("LipsPucker", QVariantList() << "MouthNarrow_Right" << 1.0);
|
||||
blendshapes.insert("LipsUpperClose", QVariantList() << "UpperLipIn" << 1.0);
|
||||
blendshapes.insert("LipsUpperOpen", QVariantList() << "UpperLipOut" << 1.0);
|
||||
blendshapes.insert("LipsUpperUp", QVariantList() << "UpperLipUp_Left" << 0.7);
|
||||
blendshapes.insert("LipsUpperUp", QVariantList() << "UpperLipUp_Right" << 0.7);
|
||||
blendshapes.insert("MouthDimple_L", QVariantList() << "Smile_Left" << 0.25);
|
||||
blendshapes.insert("MouthDimple_R", QVariantList() << "Smile_Right" << 0.25);
|
||||
blendshapes.insert("MouthFrown_L", QVariantList() << "Frown_Left" << 1.0);
|
||||
blendshapes.insert("MouthFrown_R", QVariantList() << "Frown_Right" << 1.0);
|
||||
blendshapes.insert("MouthLeft", QVariantList() << "Midmouth_Left" << 1.0);
|
||||
blendshapes.insert("MouthRight", QVariantList() << "Midmouth_Right" << 1.0);
|
||||
blendshapes.insert("MouthSmile_L", QVariantList() << "Smile_Left" << 1.0);
|
||||
blendshapes.insert("MouthSmile_R", QVariantList() << "Smile_Right" << 1.0);
|
||||
blendshapes.insert("Puff", QVariantList() << "CheekPuff_Left" << 1.0);
|
||||
blendshapes.insert("Puff", QVariantList() << "CheekPuff_Right" << 1.0);
|
||||
blendshapes.insert("Sneer", QVariantList() << "NoseScrunch_Left" << 0.75);
|
||||
blendshapes.insert("Sneer", QVariantList() << "NoseScrunch_Right" << 0.75);
|
||||
blendshapes.insert("Sneer", QVariantList() << "Squint_Left" << 0.5);
|
||||
blendshapes.insert("Sneer", QVariantList() << "Squint_Right" << 0.5);
|
||||
mapping.insert(BLENDSHAPE_FIELD, blendshapes);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include <memory>
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QVariantHash>
|
||||
#include <QMultiHash>
|
||||
|
||||
#include "ui/ModelsBrowser.h"
|
||||
|
||||
|
@ -44,7 +44,7 @@ private:
|
|||
QString _texDir;
|
||||
QString _scriptDir;
|
||||
|
||||
QVariantHash _mapping;
|
||||
QMultiHash<QString, QVariant> _mapping;
|
||||
std::shared_ptr<hfm::Model> _hfmModel;
|
||||
QStringList _textures;
|
||||
QStringList _scripts;
|
||||
|
|
|
@ -484,7 +484,7 @@ void Stats::updateStats(bool force) {
|
|||
// First iterate all the records, and for the ones that should be included, insert them into
|
||||
// a new Map sorted by average time...
|
||||
bool onlyDisplayTopTen = Menu::getInstance()->isOptionChecked(MenuOption::OnlyDisplayTopTen);
|
||||
QMap<float, QString> sortedRecords;
|
||||
QMultiMap<float, QString> sortedRecords;
|
||||
auto allRecords = PerformanceTimer::getAllTimerRecords();
|
||||
QMapIterator<QString, PerformanceTimerRecord> i(allRecords);
|
||||
|
||||
|
@ -492,7 +492,7 @@ void Stats::updateStats(bool force) {
|
|||
i.next();
|
||||
if (includeTimingRecord(i.key())) {
|
||||
float averageTime = (float)i.value().getMovingAverage() / (float)USECS_PER_MSEC;
|
||||
sortedRecords.insertMulti(averageTime, i.key());
|
||||
sortedRecords.insert(averageTime, i.key());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -140,9 +140,9 @@ void GeometryReader::run() {
|
|||
}
|
||||
|
||||
HFMModel::Pointer hfmModel;
|
||||
QVariantHash serializerMapping = _mapping.second;
|
||||
serializerMapping["combineParts"] = _combineParts;
|
||||
serializerMapping["deduplicateIndices"] = true;
|
||||
QMultiHash<QString, QVariant> serializerMapping = _mapping.second;
|
||||
serializerMapping.replace("combineParts",_combineParts);
|
||||
serializerMapping.replace("deduplicateIndices", true);
|
||||
|
||||
if (_url.path().toLower().endsWith(".gz")) {
|
||||
QByteArray uncompressedData;
|
||||
|
@ -247,7 +247,7 @@ void GeometryResource::downloadFinished(const QByteArray& data) {
|
|||
if (scripts.size() > 0) {
|
||||
_mapping.remove(SCRIPT_FIELD);
|
||||
for (auto &scriptPath : scripts) {
|
||||
_mapping.insertMulti(SCRIPT_FIELD, scriptPath);
|
||||
_mapping.insert(SCRIPT_FIELD, scriptPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -417,7 +417,7 @@ HFMModel* FBXSerializer::extractHFMModel(const hifi::VariantHash& mapping, const
|
|||
|
||||
std::map<QString, HFMLight> lights;
|
||||
|
||||
hifi::VariantHash blendshapeMappings = mapping.value("bs").toHash();
|
||||
hifi::VariantMultiHash blendshapeMappings = mapping.value("bs").toHash();
|
||||
|
||||
QMultiHash<hifi::ByteArray, WeightedIndex> blendshapeIndices;
|
||||
for (int i = 0;; i++) {
|
||||
|
|
|
@ -17,11 +17,11 @@
|
|||
|
||||
constexpr float DEFAULT_SCALE { 1.0f };
|
||||
|
||||
FST::FST(QString fstPath, QVariantHash data) : _fstPath(std::move(fstPath)) {
|
||||
FST::FST(QString fstPath, QMultiHash<QString, QVariant> data) : _fstPath(std::move(fstPath)) {
|
||||
|
||||
auto setValueFromFSTData = [&data] (const QString& propertyID, auto &targetProperty) mutable {
|
||||
if (data.contains(propertyID)) {
|
||||
targetProperty = data[propertyID].toString();
|
||||
targetProperty = data.value(propertyID).toString();
|
||||
data.remove(propertyID);
|
||||
}
|
||||
};
|
||||
|
@ -87,56 +87,56 @@ FST* FST::createFSTFromModel(const QString& fstPath, const QString& modelFilePat
|
|||
// then we can add the default mixamo to blendshape mappings.
|
||||
if (likelyMixamoFile) {
|
||||
QVariantHash blendshapes;
|
||||
blendshapes.insertMulti("BrowsD_L", QVariantList() << "BrowsDown_Left" << 1.0);
|
||||
blendshapes.insertMulti("BrowsD_R", QVariantList() << "BrowsDown_Right" << 1.0);
|
||||
blendshapes.insertMulti("BrowsU_C", QVariantList() << "BrowsUp_Left" << 1.0);
|
||||
blendshapes.insertMulti("BrowsU_C", QVariantList() << "BrowsUp_Right" << 1.0);
|
||||
blendshapes.insertMulti("BrowsU_L", QVariantList() << "BrowsUp_Left" << 1.0);
|
||||
blendshapes.insertMulti("BrowsU_R", QVariantList() << "BrowsUp_Right" << 1.0);
|
||||
blendshapes.insertMulti("ChinLowerRaise", QVariantList() << "Jaw_Up" << 1.0);
|
||||
blendshapes.insertMulti("ChinUpperRaise", QVariantList() << "UpperLipUp_Left" << 0.5);
|
||||
blendshapes.insertMulti("ChinUpperRaise", QVariantList() << "UpperLipUp_Right" << 0.5);
|
||||
blendshapes.insertMulti("EyeBlink_L", QVariantList() << "Blink_Left" << 1.0);
|
||||
blendshapes.insertMulti("EyeBlink_R", QVariantList() << "Blink_Right" << 1.0);
|
||||
blendshapes.insertMulti("EyeOpen_L", QVariantList() << "EyesWide_Left" << 1.0);
|
||||
blendshapes.insertMulti("EyeOpen_R", QVariantList() << "EyesWide_Right" << 1.0);
|
||||
blendshapes.insertMulti("EyeSquint_L", QVariantList() << "Squint_Left" << 1.0);
|
||||
blendshapes.insertMulti("EyeSquint_R", QVariantList() << "Squint_Right" << 1.0);
|
||||
blendshapes.insertMulti("JawFwd", QVariantList() << "JawForeward" << 1.0);
|
||||
blendshapes.insertMulti("JawLeft", QVariantList() << "JawRotateY_Left" << 0.5);
|
||||
blendshapes.insertMulti("JawOpen", QVariantList() << "MouthOpen" << 0.7);
|
||||
blendshapes.insertMulti("JawRight", QVariantList() << "Jaw_Right" << 1.0);
|
||||
blendshapes.insertMulti("LipsFunnel", QVariantList() << "JawForeward" << 0.39);
|
||||
blendshapes.insertMulti("LipsFunnel", QVariantList() << "Jaw_Down" << 0.36);
|
||||
blendshapes.insertMulti("LipsFunnel", QVariantList() << "MouthNarrow_Left" << 1.0);
|
||||
blendshapes.insertMulti("LipsFunnel", QVariantList() << "MouthNarrow_Right" << 1.0);
|
||||
blendshapes.insertMulti("LipsFunnel", QVariantList() << "MouthWhistle_NarrowAdjust_Left" << 0.5);
|
||||
blendshapes.insertMulti("LipsFunnel", QVariantList() << "MouthWhistle_NarrowAdjust_Right" << 0.5);
|
||||
blendshapes.insertMulti("LipsFunnel", QVariantList() << "TongueUp" << 1.0);
|
||||
blendshapes.insertMulti("LipsLowerClose", QVariantList() << "LowerLipIn" << 1.0);
|
||||
blendshapes.insertMulti("LipsLowerDown", QVariantList() << "LowerLipDown_Left" << 0.7);
|
||||
blendshapes.insertMulti("LipsLowerDown", QVariantList() << "LowerLipDown_Right" << 0.7);
|
||||
blendshapes.insertMulti("LipsLowerOpen", QVariantList() << "LowerLipOut" << 1.0);
|
||||
blendshapes.insertMulti("LipsPucker", QVariantList() << "MouthNarrow_Left" << 1.0);
|
||||
blendshapes.insertMulti("LipsPucker", QVariantList() << "MouthNarrow_Right" << 1.0);
|
||||
blendshapes.insertMulti("LipsUpperClose", QVariantList() << "UpperLipIn" << 1.0);
|
||||
blendshapes.insertMulti("LipsUpperOpen", QVariantList() << "UpperLipOut" << 1.0);
|
||||
blendshapes.insertMulti("LipsUpperUp", QVariantList() << "UpperLipUp_Left" << 0.7);
|
||||
blendshapes.insertMulti("LipsUpperUp", QVariantList() << "UpperLipUp_Right" << 0.7);
|
||||
blendshapes.insertMulti("MouthDimple_L", QVariantList() << "Smile_Left" << 0.25);
|
||||
blendshapes.insertMulti("MouthDimple_R", QVariantList() << "Smile_Right" << 0.25);
|
||||
blendshapes.insertMulti("MouthFrown_L", QVariantList() << "Frown_Left" << 1.0);
|
||||
blendshapes.insertMulti("MouthFrown_R", QVariantList() << "Frown_Right" << 1.0);
|
||||
blendshapes.insertMulti("MouthLeft", QVariantList() << "Midmouth_Left" << 1.0);
|
||||
blendshapes.insertMulti("MouthRight", QVariantList() << "Midmouth_Right" << 1.0);
|
||||
blendshapes.insertMulti("MouthSmile_L", QVariantList() << "Smile_Left" << 1.0);
|
||||
blendshapes.insertMulti("MouthSmile_R", QVariantList() << "Smile_Right" << 1.0);
|
||||
blendshapes.insertMulti("Puff", QVariantList() << "CheekPuff_Left" << 1.0);
|
||||
blendshapes.insertMulti("Puff", QVariantList() << "CheekPuff_Right" << 1.0);
|
||||
blendshapes.insertMulti("Sneer", QVariantList() << "NoseScrunch_Left" << 0.75);
|
||||
blendshapes.insertMulti("Sneer", QVariantList() << "NoseScrunch_Right" << 0.75);
|
||||
blendshapes.insertMulti("Sneer", QVariantList() << "Squint_Left" << 0.5);
|
||||
blendshapes.insertMulti("Sneer", QVariantList() << "Squint_Right" << 0.5);
|
||||
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);
|
||||
blendshapes.insert("BrowsU_C", QVariantList() << "BrowsUp_Right" << 1.0);
|
||||
blendshapes.insert("BrowsU_L", QVariantList() << "BrowsUp_Left" << 1.0);
|
||||
blendshapes.insert("BrowsU_R", QVariantList() << "BrowsUp_Right" << 1.0);
|
||||
blendshapes.insert("ChinLowerRaise", QVariantList() << "Jaw_Up" << 1.0);
|
||||
blendshapes.insert("ChinUpperRaise", QVariantList() << "UpperLipUp_Left" << 0.5);
|
||||
blendshapes.insert("ChinUpperRaise", QVariantList() << "UpperLipUp_Right" << 0.5);
|
||||
blendshapes.insert("EyeBlink_L", QVariantList() << "Blink_Left" << 1.0);
|
||||
blendshapes.insert("EyeBlink_R", QVariantList() << "Blink_Right" << 1.0);
|
||||
blendshapes.insert("EyeOpen_L", QVariantList() << "EyesWide_Left" << 1.0);
|
||||
blendshapes.insert("EyeOpen_R", QVariantList() << "EyesWide_Right" << 1.0);
|
||||
blendshapes.insert("EyeSquint_L", QVariantList() << "Squint_Left" << 1.0);
|
||||
blendshapes.insert("EyeSquint_R", QVariantList() << "Squint_Right" << 1.0);
|
||||
blendshapes.insert("JawFwd", QVariantList() << "JawForeward" << 1.0);
|
||||
blendshapes.insert("JawLeft", QVariantList() << "JawRotateY_Left" << 0.5);
|
||||
blendshapes.insert("JawOpen", QVariantList() << "MouthOpen" << 0.7);
|
||||
blendshapes.insert("JawRight", QVariantList() << "Jaw_Right" << 1.0);
|
||||
blendshapes.insert("LipsFunnel", QVariantList() << "JawForeward" << 0.39);
|
||||
blendshapes.insert("LipsFunnel", QVariantList() << "Jaw_Down" << 0.36);
|
||||
blendshapes.insert("LipsFunnel", QVariantList() << "MouthNarrow_Left" << 1.0);
|
||||
blendshapes.insert("LipsFunnel", QVariantList() << "MouthNarrow_Right" << 1.0);
|
||||
blendshapes.insert("LipsFunnel", QVariantList() << "MouthWhistle_NarrowAdjust_Left" << 0.5);
|
||||
blendshapes.insert("LipsFunnel", QVariantList() << "MouthWhistle_NarrowAdjust_Right" << 0.5);
|
||||
blendshapes.insert("LipsFunnel", QVariantList() << "TongueUp" << 1.0);
|
||||
blendshapes.insert("LipsLowerClose", QVariantList() << "LowerLipIn" << 1.0);
|
||||
blendshapes.insert("LipsLowerDown", QVariantList() << "LowerLipDown_Left" << 0.7);
|
||||
blendshapes.insert("LipsLowerDown", QVariantList() << "LowerLipDown_Right" << 0.7);
|
||||
blendshapes.insert("LipsLowerOpen", QVariantList() << "LowerLipOut" << 1.0);
|
||||
blendshapes.insert("LipsPucker", QVariantList() << "MouthNarrow_Left" << 1.0);
|
||||
blendshapes.insert("LipsPucker", QVariantList() << "MouthNarrow_Right" << 1.0);
|
||||
blendshapes.insert("LipsUpperClose", QVariantList() << "UpperLipIn" << 1.0);
|
||||
blendshapes.insert("LipsUpperOpen", QVariantList() << "UpperLipOut" << 1.0);
|
||||
blendshapes.insert("LipsUpperUp", QVariantList() << "UpperLipUp_Left" << 0.7);
|
||||
blendshapes.insert("LipsUpperUp", QVariantList() << "UpperLipUp_Right" << 0.7);
|
||||
blendshapes.insert("MouthDimple_L", QVariantList() << "Smile_Left" << 0.25);
|
||||
blendshapes.insert("MouthDimple_R", QVariantList() << "Smile_Right" << 0.25);
|
||||
blendshapes.insert("MouthFrown_L", QVariantList() << "Frown_Left" << 1.0);
|
||||
blendshapes.insert("MouthFrown_R", QVariantList() << "Frown_Right" << 1.0);
|
||||
blendshapes.insert("MouthLeft", QVariantList() << "Midmouth_Left" << 1.0);
|
||||
blendshapes.insert("MouthRight", QVariantList() << "Midmouth_Right" << 1.0);
|
||||
blendshapes.insert("MouthSmile_L", QVariantList() << "Smile_Left" << 1.0);
|
||||
blendshapes.insert("MouthSmile_R", QVariantList() << "Smile_Right" << 1.0);
|
||||
blendshapes.insert("Puff", QVariantList() << "CheekPuff_Left" << 1.0);
|
||||
blendshapes.insert("Puff", QVariantList() << "CheekPuff_Right" << 1.0);
|
||||
blendshapes.insert("Sneer", QVariantList() << "NoseScrunch_Left" << 0.75);
|
||||
blendshapes.insert("Sneer", QVariantList() << "NoseScrunch_Right" << 0.75);
|
||||
blendshapes.insert("Sneer", QVariantList() << "Squint_Left" << 0.5);
|
||||
blendshapes.insert("Sneer", QVariantList() << "Squint_Right" << 0.5);
|
||||
mapping.insert(BLENDSHAPE_FIELD, blendshapes);
|
||||
}
|
||||
return new FST(fstPath, mapping);
|
||||
|
@ -158,14 +158,14 @@ void FST::setModelPath(const QString& modelPath) {
|
|||
emit modelPathChanged(modelPath);
|
||||
}
|
||||
|
||||
QVariantHash FST::getMapping() const {
|
||||
QVariantHash mapping;
|
||||
QMultiHash<QString, QVariant> FST::getMapping() const {
|
||||
QMultiHash<QString, QVariant> mapping;
|
||||
mapping.unite(_other);
|
||||
mapping.insert(NAME_FIELD, _name);
|
||||
mapping.insert(FILENAME_FIELD, _modelPath);
|
||||
mapping.insert(MARKETPLACE_ID_FIELD, _marketplaceID);
|
||||
for (const auto& scriptPath : _scriptPaths) {
|
||||
mapping.insertMulti(SCRIPT_FIELD, scriptPath);
|
||||
mapping.insert(SCRIPT_FIELD, scriptPath);
|
||||
}
|
||||
return mapping;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ class FST : public QObject {
|
|||
Q_PROPERTY(QUuid marketplaceID READ getMarketplaceID)
|
||||
Q_PROPERTY(bool hasMarketplaceID READ getHasMarketplaceID NOTIFY marketplaceIDChanged)
|
||||
public:
|
||||
FST(QString fstPath, QVariantHash data);
|
||||
FST(QString fstPath, QMultiHash<QString, QVariant> data);
|
||||
|
||||
static FST* createFSTFromModel(const QString& fstPath, const QString& modelFilePath, const hfm::Model& hfmModel);
|
||||
|
||||
|
@ -47,7 +47,7 @@ public:
|
|||
|
||||
QString getPath() const { return _fstPath; }
|
||||
|
||||
QVariantHash getMapping() const;
|
||||
QMultiHash<QString, QVariant> getMapping() const;
|
||||
|
||||
bool write();
|
||||
|
||||
|
|
|
@ -34,10 +34,10 @@ QVariantHash FSTReader::parseMapping(QIODevice* device) {
|
|||
}
|
||||
QByteArray name = sections.at(0).trimmed();
|
||||
if (sections.size() == 2) {
|
||||
properties.insertMulti(name, sections.at(1).trimmed());
|
||||
properties.insert(name, sections.at(1).trimmed());
|
||||
} else if (sections.size() == 3) {
|
||||
QVariantHash heading = properties.value(name).toHash();
|
||||
heading.insertMulti(sections.at(1).trimmed(), sections.at(2).trimmed());
|
||||
heading.insert(sections.at(1).trimmed(), sections.at(2).trimmed());
|
||||
properties.insert(name, heading);
|
||||
} else if (sections.size() >= 4) {
|
||||
QVariantHash heading = properties.value(name).toHash();
|
||||
|
@ -45,7 +45,7 @@ QVariantHash FSTReader::parseMapping(QIODevice* device) {
|
|||
for (int i = 2; i < sections.size(); i++) {
|
||||
contents.append(sections.at(i).trimmed());
|
||||
}
|
||||
heading.insertMulti(sections.at(1).trimmed(), contents);
|
||||
heading.insert(sections.at(1).trimmed(), contents);
|
||||
properties.insert(name, heading);
|
||||
}
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ static void removeBlendshape(QVariantHash& bs, const QString& key) {
|
|||
}
|
||||
}
|
||||
|
||||
static void splitBlendshapes(QVariantHash& bs, const QString& key, const QString& leftKey, const QString& rightKey) {
|
||||
static void splitBlendshapes(hifi::VariantMultiHash& bs, const QString& key, const QString& leftKey, const QString& rightKey) {
|
||||
if (bs.contains(key) && !(bs.contains(leftKey) || bs.contains(rightKey))) {
|
||||
// key has been split into leftKey and rightKey blendshapes
|
||||
QVariantList origShapes = bs.values(key);
|
||||
|
@ -69,15 +69,15 @@ static void splitBlendshapes(QVariantHash& bs, const QString& key, const QString
|
|||
QVariantList halfShape;
|
||||
halfShape.append(origShape[0]);
|
||||
halfShape.append(QVariant(0.5f * origShape[1].toFloat()));
|
||||
bs.insertMulti(leftKey, halfShape);
|
||||
bs.insertMulti(rightKey, halfShape);
|
||||
bs.insert(leftKey, halfShape);
|
||||
bs.insert(rightKey, halfShape);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// convert legacy blendshapes to arkit blendshapes
|
||||
static void fixUpLegacyBlendshapes(QVariantHash& properties) {
|
||||
QVariantHash bs = properties.value("bs").toHash();
|
||||
static void fixUpLegacyBlendshapes(QVariantHash & properties) {
|
||||
hifi::VariantMultiHash bs = properties.value("bs").toHash();
|
||||
|
||||
// These blendshapes have no ARKit equivalent, so we remove them.
|
||||
removeBlendshape(bs, "JawChew");
|
||||
|
@ -125,7 +125,7 @@ void FSTReader::writeVariant(QBuffer& buffer, QVariantHash::const_iterator& it)
|
|||
}
|
||||
}
|
||||
|
||||
QByteArray FSTReader::writeMapping(const QVariantHash& mapping) {
|
||||
QByteArray FSTReader::writeMapping(const hifi::VariantMultiHash& mapping) {
|
||||
static const QStringList PREFERED_ORDER = QStringList() << NAME_FIELD << TYPE_FIELD << SCALE_FIELD << FILENAME_FIELD
|
||||
<< MARKETPLACE_ID_FIELD << TEXDIR_FIELD << SCRIPT_FIELD << JOINT_FIELD
|
||||
<< BLENDSHAPE_FIELD << JOINT_INDEX_FIELD;
|
||||
|
@ -230,7 +230,7 @@ FSTReader::ModelType FSTReader::predictModelType(const QVariantHash& mapping) {
|
|||
return ENTITY_MODEL;
|
||||
}
|
||||
|
||||
QVector<QString> FSTReader::getScripts(const QUrl& url, const QVariantHash& mapping) {
|
||||
QVector<QString> FSTReader::getScripts(const QUrl& url, const hifi::VariantMultiHash& mapping) {
|
||||
|
||||
auto fstMapping = mapping.isEmpty() ? downloadMapping(url.toString()) : mapping;
|
||||
QVector<QString> scriptPaths;
|
||||
|
@ -250,7 +250,7 @@ QVector<QString> FSTReader::getScripts(const QUrl& url, const QVariantHash& mapp
|
|||
return scriptPaths;
|
||||
}
|
||||
|
||||
QVariantHash FSTReader::downloadMapping(const QString& url) {
|
||||
hifi::VariantMultiHash FSTReader::downloadMapping(const QString& url) {
|
||||
QNetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance();
|
||||
QNetworkRequest networkRequest = QNetworkRequest(url);
|
||||
networkRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
#include <QBuffer>
|
||||
#include <QVariantHash>
|
||||
#include "shared/HifiTypes.h"
|
||||
|
||||
static const unsigned int FST_VERSION = 1;
|
||||
static const QString FST_VERSION_FIELD = "version";
|
||||
|
@ -50,16 +51,16 @@ public:
|
|||
static QVariantHash readMapping(const QByteArray& data);
|
||||
|
||||
/// Writes an FST mapping to a byte array.
|
||||
static QByteArray writeMapping(const QVariantHash& mapping);
|
||||
static QByteArray writeMapping(const hifi::VariantMultiHash& mapping);
|
||||
|
||||
/// Predicts the type of model by examining the mapping
|
||||
static ModelType predictModelType(const QVariantHash& mapping);
|
||||
|
||||
static QVector<QString> getScripts(const QUrl& fstUrl, const QVariantHash& mapping = QVariantHash());
|
||||
static QVector<QString> getScripts(const QUrl& fstUrl, const hifi::VariantMultiHash& mapping = QVariantHash());
|
||||
|
||||
static QString getNameFromType(ModelType modelType);
|
||||
static FSTReader::ModelType getTypeFromName(const QString& name);
|
||||
static QVariantHash downloadMapping(const QString& url);
|
||||
static hifi::VariantMultiHash downloadMapping(const QString& url);
|
||||
|
||||
private:
|
||||
static void writeVariant(QBuffer& buffer, QVariantHash::const_iterator& it);
|
||||
|
|
|
@ -1548,7 +1548,7 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
|
|||
|
||||
// Build list of blendshapes from FST and model.
|
||||
typedef QPair<int, float> WeightedIndex;
|
||||
hifi::VariantHash blendshapeMappings = mapping.value("bs").toHash();
|
||||
hifi::VariantMultiHash blendshapeMappings = mapping.value("bs").toHash();
|
||||
QMultiHash<QString, WeightedIndex> blendshapeIndices;
|
||||
for (int i = 0;; ++i) {
|
||||
auto blendshapeName = QString(BLENDSHAPE_NAMES[i]);
|
||||
|
|
|
@ -301,7 +301,7 @@ void ResourceCache::refreshAll() {
|
|||
clearUnusedResources();
|
||||
resetUnusedResourceCounter();
|
||||
|
||||
QHash<QUrl, QHash<size_t, QWeakPointer<Resource>>> allResources;
|
||||
QHash<QUrl, QMultiHash<size_t, QWeakPointer<Resource>>> allResources;
|
||||
{
|
||||
QReadLocker locker(&_resourcesLock);
|
||||
allResources = _resources;
|
||||
|
|
|
@ -284,7 +284,7 @@ private:
|
|||
void resetResourceCounters();
|
||||
|
||||
// Resources
|
||||
QHash<QUrl, QHash<size_t, QWeakPointer<Resource>>> _resources;
|
||||
QHash<QUrl, QMultiHash<size_t, QWeakPointer<Resource>>> _resources;
|
||||
QReadWriteLock _resourcesLock { QReadWriteLock::Recursive };
|
||||
int _lastLRUKey = 0;
|
||||
|
||||
|
|
|
@ -448,7 +448,7 @@ bool ScriptEngines::stopScript(const QString& rawScriptURL, bool restart) {
|
|||
|
||||
QReadLocker lock(&_scriptEnginesHashLock);
|
||||
if (_scriptEnginesHash.contains(scriptURL)) {
|
||||
ScriptEnginePointer scriptEngine = _scriptEnginesHash[scriptURL];
|
||||
ScriptEnginePointer scriptEngine = _scriptEnginesHash.value(scriptURL);
|
||||
if (restart) {
|
||||
bool isUserLoaded = scriptEngine->isUserLoaded();
|
||||
ScriptEngine::Type type = scriptEngine->getType();
|
||||
|
@ -561,7 +561,7 @@ void ScriptEngines::onScriptEngineLoaded(const QString& rawScriptURL) {
|
|||
QWriteLocker lock(&_scriptEnginesHashLock);
|
||||
QUrl url = QUrl(rawScriptURL);
|
||||
QUrl normalized = normalizeScriptURL(url);
|
||||
_scriptEnginesHash.insertMulti(normalized, scriptEngine);
|
||||
_scriptEnginesHash.insert(normalized, scriptEngine);
|
||||
}
|
||||
|
||||
// Update settings with new script
|
||||
|
|
|
@ -344,7 +344,7 @@ protected:
|
|||
|
||||
ScriptEngine::Context _context;
|
||||
QReadWriteLock _scriptEnginesHashLock;
|
||||
QHash<QUrl, ScriptEnginePointer> _scriptEnginesHash;
|
||||
QMultiHash<QUrl, ScriptEnginePointer> _scriptEnginesHash;
|
||||
QSet<ScriptEnginePointer> _allKnownScriptEngines;
|
||||
QMutex _allScriptsMutex;
|
||||
ScriptsModel _scriptsModel;
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
QVariantMap HifiConfigVariantMap::mergeCLParametersWithJSONConfig(const QStringList& argumentList) {
|
||||
|
||||
QVariantMap mergedMap;
|
||||
QMultiMap<QString, QVariant> mergedMap;
|
||||
|
||||
// Add anything in the CL parameter list to the variant map.
|
||||
// Take anything with a dash in it as a key, and the values after it as the value.
|
||||
|
@ -49,7 +49,7 @@ QVariantMap HifiConfigVariantMap::mergeCLParametersWithJSONConfig(const QStringL
|
|||
|
||||
if (nextKeyIndex == keyIndex + 1 || keyIndex == argumentList.size() - 1) {
|
||||
// this option is simply a switch, so add it to the map with a value of `true`
|
||||
mergedMap.insertMulti(key, QVariant(true));
|
||||
mergedMap.insert(key, QVariant(true));
|
||||
} else {
|
||||
int maxIndex = (nextKeyIndex == -1) ? argumentList.size() : nextKeyIndex;
|
||||
|
||||
|
|
|
@ -15,10 +15,14 @@
|
|||
#include <QVarLengthArray>
|
||||
#include <QVariant>
|
||||
#include <QUrl>
|
||||
#include <QMultiHash>
|
||||
#include <QMultiMap>
|
||||
|
||||
namespace hifi {
|
||||
using ByteArray = QByteArray;
|
||||
using VariantHash = QVariantHash;
|
||||
using VariantMultiHash = QMultiHash<QString, QVariant>;
|
||||
using VariantMultiMap = QMultiMap<QString, QVariant>;
|
||||
using URL = QUrl;
|
||||
};
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ public:
|
|||
auto preset = _preset.get();
|
||||
if (preset != _preset.getDefault() && _presets.contains(preset)) {
|
||||
// Load the persisted configuration
|
||||
C::load(_presets[preset].toMap());
|
||||
C::load(_presets.value(preset).toMap());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,8 +79,8 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
QVariantMap _default;
|
||||
QVariantMap _presets;
|
||||
QMultiMap<QString, QVariant> _default;
|
||||
QMultiMap<QString, QVariant> _presets;
|
||||
Setting::Handle<QString> _preset;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue