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
focus: true
style: OriginalStyles.ButtonStyle {
background: Image {
id: buttonImage
source: "../../images/steam-sign-in.png"
}
background: Image {
id: buttonImage
source: "../../images/steam-sign-in.png"
}
onClicked: signInBody.login()
}

View file

@ -582,7 +582,7 @@ Rectangle {
}
lightboxPopup.button2text = "CONFIRM";
lightboxPopup.button2method = function() {
MyAvatar.skeletonModelURL = '';
MyAvatar.useFullAvatarURL('');
root.activeView = "giftAsset";
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>();
*skeletonConnection = QObject::connect(_skeletonModel.get(), &SkeletonModel::skeletonLoaded, [this, skeletonModelChangeCount, skeletonConnection]() {
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();
_skeletonModel->setCauterizeBoneSet(_headBoneSet);
_fstAnimGraphOverrideUrl = _skeletonModel->getGeometry()->getAnimGraphOverrideUrl();
@ -1535,12 +1544,7 @@ void MyAvatar::useFullAvatarURL(const QUrl& fullAvatarURL, const QString& modelN
if (_fullAvatarURLFromPreferences != fullAvatarURL) {
_fullAvatarURLFromPreferences = fullAvatarURL;
if (modelName.isEmpty()) {
QVariantHash fullAvatarFST = FSTReader::downloadMapping(_fullAvatarURLFromPreferences.toString());
_fullAvatarModelName = fullAvatarFST["name"].toString();
} else {
_fullAvatarModelName = modelName;
}
_fullAvatarModelName = modelName;
}
const QString& urlString = fullAvatarURL.toString();
@ -1548,8 +1552,8 @@ void MyAvatar::useFullAvatarURL(const QUrl& fullAvatarURL, const QString& modelN
setSkeletonModelURL(fullAvatarURL);
UserActivityLogger::getInstance().changedModel("skeleton", urlString);
}
markIdentityDataChanged();
}
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(),
{ { "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()) {
qCDebug(modelnetworking) << "Mapping file" << _url << "has no \"filename\" field";
finishedLoading(false);
} else {
QUrl url = _url.resolved(filename);
QString texdir = mapping.value(TEXDIR_FIELD).toString();
QString texdir = _mapping.value(TEXDIR_FIELD).toString();
if (!texdir.isNull()) {
if (!texdir.endsWith('/')) {
texdir += '/';
@ -82,7 +84,8 @@ void GeometryMappingResource::downloadFinished(const QByteArray& data) {
_textureBaseUrl = url.resolved(QUrl("."));
}
auto animGraphVariant = mapping.value("animGraphUrl");
auto animGraphVariant = _mapping.value("animGraphUrl");
if (animGraphVariant.isValid()) {
QUrl fstUrl(animGraphVariant.toString());
if (fstUrl.isValid()) {
@ -95,7 +98,7 @@ void GeometryMappingResource::downloadFinished(const QByteArray& data) {
}
auto modelCache = DependencyManager::get<ModelCache>();
GeometryExtra extra{ mapping, _textureBaseUrl, false };
GeometryExtra extra{ _mapping, _textureBaseUrl, false };
// Get the raw GeometryResource
_geometryResource = modelCache->getResource(url, QUrl(), &extra).staticCast<GeometryResource>();
@ -362,6 +365,7 @@ Geometry::Geometry(const Geometry& geometry) {
}
_animGraphOverrideUrl = geometry._animGraphOverrideUrl;
_mapping = geometry._mapping;
}
void Geometry::setTextures(const QVariantMap& textureMap) {

View file

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