mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 01:12:48 +02:00
Merge branch 'vircadia:master' into tell-accountmanager-url-changed
This commit is contained in:
commit
bf48bf01c6
4 changed files with 14 additions and 14 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
#include <NetworkingConstants.h>
|
||||
#include <SharedUtil.h>
|
||||
|
||||
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<QByteArray*>(&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
|
||||
|
|
|
@ -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<QString> 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<FSTReader::ModelType, QString> _typesToNames;
|
||||
static QHash<QString, FSTReader::ModelType> _namesToTypes;
|
||||
|
|
Loading…
Reference in a new issue