diff --git a/libraries/avatars/src/HeadData.cpp b/libraries/avatars/src/HeadData.cpp index f19ee3de86..392b08d48c 100644 --- a/libraries/avatars/src/HeadData.cpp +++ b/libraries/avatars/src/HeadData.cpp @@ -102,8 +102,8 @@ const QVector& HeadData::getSummedBlendshapeCoefficients() { void HeadData::setBlendshape(QString name, float val) { // Check to see if the named blendshape exists, and then set its value if it does - auto it = blendshapeLookupMap.find(name); - if (it != blendshapeLookupMap.end()) { + auto it = BLENDSHAPE_LOOKUP_MAP.find(name); + if (it != BLENDSHAPE_LOOKUP_MAP.end()) { if (_blendshapeCoefficients.size() <= it.value()) { _blendshapeCoefficients.resize(it.value() + 1); } @@ -128,8 +128,8 @@ void HeadData::setBlendshape(QString name, float val) { } int HeadData::getBlendshapeIndex(const QString& name) { - auto it = blendshapeLookupMap.find(name); - int index = it != blendshapeLookupMap.end() ? it.value() : -1; + auto it = BLENDSHAPE_LOOKUP_MAP.find(name); + int index = it != BLENDSHAPE_LOOKUP_MAP.end() ? it.value() : -1; return index; } @@ -148,8 +148,8 @@ static const QString JSON_AVATAR_HEAD_LOOKAT = QStringLiteral("lookAt"); QJsonObject HeadData::toJson() const { QJsonObject headJson; QJsonObject blendshapesJson; - for (auto name : blendshapeLookupMap.keys()) { - auto index = blendshapeLookupMap[name]; + for (auto name : BLENDSHAPE_LOOKUP_MAP.keys()) { + auto index = BLENDSHAPE_LOOKUP_MAP[name]; float value = 0.0f; if (index < _blendshapeCoefficients.size()) { value += _blendshapeCoefficients[index]; diff --git a/libraries/entities/src/ModelEntityItem.cpp b/libraries/entities/src/ModelEntityItem.cpp index 9f54033373..3808844a6f 100644 --- a/libraries/entities/src/ModelEntityItem.cpp +++ b/libraries/entities/src/ModelEntityItem.cpp @@ -769,8 +769,8 @@ void ModelEntityItem::setBlendshapeCoefficients(const QString& blendshapeCoeffic withWriteLock([&] { for (auto& blendshape : newCoefficientsMap.keys()) { auto newCoefficient = newCoefficientsMap[blendshape]; - auto blendshapeIter = blendshapeLookupMap.find(blendshape); - if (newCoefficient.canConvert() && blendshapeIter != blendshapeLookupMap.end()) { + auto blendshapeIter = BLENDSHAPE_LOOKUP_MAP.find(blendshape); + if (newCoefficient.canConvert() && blendshapeIter != BLENDSHAPE_LOOKUP_MAP.end()) { float newCoefficientValue = newCoefficient.toFloat(); _blendshapeCoefficientsVector[blendshapeIter.value()] = newCoefficientValue; _blendshapeCoefficientsMap[blendshape] = newCoefficientValue; diff --git a/libraries/shared/src/BlendshapeConstants.cpp b/libraries/shared/src/BlendshapeConstants.cpp index 0150e3854f..83c8271340 100644 --- a/libraries/shared/src/BlendshapeConstants.cpp +++ b/libraries/shared/src/BlendshapeConstants.cpp @@ -77,7 +77,7 @@ const char* FACESHIFT_BLENDSHAPES[] = { "" }; -QMap blendshapeLookupMap = [] { +const QMap BLENDSHAPE_LOOKUP_MAP = [] { QMap toReturn; for (int i = 0; i < (int)Blendshapes::BlendshapeCount; i++) { toReturn[FACESHIFT_BLENDSHAPES[i]] = i; diff --git a/libraries/shared/src/BlendshapeConstants.h b/libraries/shared/src/BlendshapeConstants.h index 358efb6597..33d02de57d 100644 --- a/libraries/shared/src/BlendshapeConstants.h +++ b/libraries/shared/src/BlendshapeConstants.h @@ -19,7 +19,7 @@ /// The names of the blendshapes expected by Faceshift, terminated with an empty string. extern const char* FACESHIFT_BLENDSHAPES[]; -extern QMap blendshapeLookupMap; +extern const QMap BLENDSHAPE_LOOKUP_MAP; enum class Blendshapes : int { EyeBlink_L = 0, diff --git a/plugins/KasenAPIExample/src/KasenAPIExample.cpp b/plugins/KasenAPIExample/src/KasenAPIExample.cpp index b0a9c29519..9f81793037 100644 --- a/plugins/KasenAPIExample/src/KasenAPIExample.cpp +++ b/plugins/KasenAPIExample/src/KasenAPIExample.cpp @@ -113,7 +113,7 @@ private: } struct _HeadHelper : public HeadData { QMap getBlendshapeMap() const { - return blendshapeLookupMap; + return BLENDSHAPE_LOOKUP_MAP; } struct States { QVector base, summed, transient; }; States getBlendshapeStates() const {