Merge branch 'RC67' of github.com:highfidelity/hifi into RC67

This commit is contained in:
Dante Ruiz 2018-05-07 15:33:00 -07:00
commit 9d6019e78c
5 changed files with 26 additions and 18 deletions

View file

@ -84,11 +84,9 @@ Item {
height: undefined // invalidate so that the image's size sets the height height: undefined // invalidate so that the image's size sets the height
focus: true focus: true
style: OriginalStyles.ButtonStyle { background: Image {
background: Image { id: buttonImage
id: buttonImage source: "../../images/steam-sign-in.png"
source: "../../images/steam-sign-in.png"
}
} }
onClicked: signInBody.login() onClicked: signInBody.login()
} }

View file

@ -582,7 +582,7 @@ Rectangle {
} }
lightboxPopup.button2text = "CONFIRM"; lightboxPopup.button2text = "CONFIRM";
lightboxPopup.button2method = function() { lightboxPopup.button2method = function() {
MyAvatar.skeletonModelURL = ''; MyAvatar.useFullAvatarURL('');
root.activeView = "giftAsset"; root.activeView = "giftAsset";
lightboxPopup.visible = false; lightboxPopup.visible = false;
}; };

View file

@ -1473,6 +1473,15 @@ void MyAvatar::setSkeletonModelURL(const QUrl& skeletonModelURL) {
std::shared_ptr<QMetaObject::Connection> skeletonConnection = std::make_shared<QMetaObject::Connection>(); std::shared_ptr<QMetaObject::Connection> skeletonConnection = std::make_shared<QMetaObject::Connection>();
*skeletonConnection = QObject::connect(_skeletonModel.get(), &SkeletonModel::skeletonLoaded, [this, skeletonModelChangeCount, skeletonConnection]() { *skeletonConnection = QObject::connect(_skeletonModel.get(), &SkeletonModel::skeletonLoaded, [this, skeletonModelChangeCount, skeletonConnection]() {
if (skeletonModelChangeCount == _skeletonModelChangeCount) { if (skeletonModelChangeCount == _skeletonModelChangeCount) {
if (_fullAvatarModelName.isEmpty()) {
// Store the FST file name into preferences
const auto& mapping = _skeletonModel->getGeometry()->getMapping();
if (mapping.value("name").isValid()) {
_fullAvatarModelName = mapping.value("name").toString();
}
}
initHeadBones(); initHeadBones();
_skeletonModel->setCauterizeBoneSet(_headBoneSet); _skeletonModel->setCauterizeBoneSet(_headBoneSet);
_fstAnimGraphOverrideUrl = _skeletonModel->getGeometry()->getAnimGraphOverrideUrl(); _fstAnimGraphOverrideUrl = _skeletonModel->getGeometry()->getAnimGraphOverrideUrl();
@ -1535,12 +1544,7 @@ void MyAvatar::useFullAvatarURL(const QUrl& fullAvatarURL, const QString& modelN
if (_fullAvatarURLFromPreferences != fullAvatarURL) { if (_fullAvatarURLFromPreferences != fullAvatarURL) {
_fullAvatarURLFromPreferences = fullAvatarURL; _fullAvatarURLFromPreferences = fullAvatarURL;
if (modelName.isEmpty()) { _fullAvatarModelName = modelName;
QVariantHash fullAvatarFST = FSTReader::downloadMapping(_fullAvatarURLFromPreferences.toString());
_fullAvatarModelName = fullAvatarFST["name"].toString();
} else {
_fullAvatarModelName = modelName;
}
} }
const QString& urlString = fullAvatarURL.toString(); const QString& urlString = fullAvatarURL.toString();
@ -1548,8 +1552,8 @@ void MyAvatar::useFullAvatarURL(const QUrl& fullAvatarURL, const QString& modelN
setSkeletonModelURL(fullAvatarURL); setSkeletonModelURL(fullAvatarURL);
UserActivityLogger::getInstance().changedModel("skeleton", urlString); UserActivityLogger::getInstance().changedModel("skeleton", urlString);
} }
markIdentityDataChanged(); markIdentityDataChanged();
} }
void MyAvatar::setAttachmentData(const QVector<AttachmentData>& attachmentData) { void MyAvatar::setAttachmentData(const QVector<AttachmentData>& attachmentData) {

View file

@ -63,16 +63,18 @@ void GeometryMappingResource::downloadFinished(const QByteArray& data) {
PROFILE_ASYNC_BEGIN(resource_parse_geometry, "GeometryMappingResource::downloadFinished", _url.toString(), PROFILE_ASYNC_BEGIN(resource_parse_geometry, "GeometryMappingResource::downloadFinished", _url.toString(),
{ { "url", _url.toString() } }); { { "url", _url.toString() } });
auto mapping = FSTReader::readMapping(data); // store parsed contents of FST file
_mapping = FSTReader::readMapping(data);
QString filename = _mapping.value("filename").toString();
QString filename = mapping.value("filename").toString();
if (filename.isNull()) { if (filename.isNull()) {
qCDebug(modelnetworking) << "Mapping file" << _url << "has no \"filename\" field"; qCDebug(modelnetworking) << "Mapping file" << _url << "has no \"filename\" field";
finishedLoading(false); finishedLoading(false);
} else { } else {
QUrl url = _url.resolved(filename); QUrl url = _url.resolved(filename);
QString texdir = mapping.value(TEXDIR_FIELD).toString(); QString texdir = _mapping.value(TEXDIR_FIELD).toString();
if (!texdir.isNull()) { if (!texdir.isNull()) {
if (!texdir.endsWith('/')) { if (!texdir.endsWith('/')) {
texdir += '/'; texdir += '/';
@ -82,7 +84,8 @@ void GeometryMappingResource::downloadFinished(const QByteArray& data) {
_textureBaseUrl = url.resolved(QUrl(".")); _textureBaseUrl = url.resolved(QUrl("."));
} }
auto animGraphVariant = mapping.value("animGraphUrl"); auto animGraphVariant = _mapping.value("animGraphUrl");
if (animGraphVariant.isValid()) { if (animGraphVariant.isValid()) {
QUrl fstUrl(animGraphVariant.toString()); QUrl fstUrl(animGraphVariant.toString());
if (fstUrl.isValid()) { if (fstUrl.isValid()) {
@ -95,7 +98,7 @@ void GeometryMappingResource::downloadFinished(const QByteArray& data) {
} }
auto modelCache = DependencyManager::get<ModelCache>(); auto modelCache = DependencyManager::get<ModelCache>();
GeometryExtra extra{ mapping, _textureBaseUrl, false }; GeometryExtra extra{ _mapping, _textureBaseUrl, false };
// Get the raw GeometryResource // Get the raw GeometryResource
_geometryResource = modelCache->getResource(url, QUrl(), &extra).staticCast<GeometryResource>(); _geometryResource = modelCache->getResource(url, QUrl(), &extra).staticCast<GeometryResource>();
@ -362,6 +365,7 @@ Geometry::Geometry(const Geometry& geometry) {
} }
_animGraphOverrideUrl = geometry._animGraphOverrideUrl; _animGraphOverrideUrl = geometry._animGraphOverrideUrl;
_mapping = geometry._mapping;
} }
void Geometry::setTextures(const QVariantMap& textureMap) { void Geometry::setTextures(const QVariantMap& textureMap) {

View file

@ -55,6 +55,7 @@ public:
virtual bool areTexturesLoaded() const; virtual bool areTexturesLoaded() const;
const QUrl& getAnimGraphOverrideUrl() const { return _animGraphOverrideUrl; } const QUrl& getAnimGraphOverrideUrl() const { return _animGraphOverrideUrl; }
const QVariantHash& getMapping() const { return _mapping; }
protected: protected:
friend class GeometryMappingResource; friend class GeometryMappingResource;
@ -68,6 +69,7 @@ protected:
NetworkMaterials _materials; NetworkMaterials _materials;
QUrl _animGraphOverrideUrl; QUrl _animGraphOverrideUrl;
QVariantHash _mapping; // parsed contents of FST file.
private: private:
mutable bool _areTexturesLoaded { false }; mutable bool _areTexturesLoaded { false };