From 26d5e2cfec239b3c2f94d4739939be50733653d5 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 7 Oct 2013 17:24:07 -0700 Subject: [PATCH] clear the face model URL if the username is changed in preferences --- interface/src/Menu.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index afaec2305e..923b563af4 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -806,19 +806,18 @@ void Menu::editPreferences() { QUrl faceModelURL(faceURLEdit->text()); + if (avatarUsernameEdit->text() != avatarUsername) { // there has been a username change - set the new UUID on the avatar instance applicationInstance->getAvatar()->setUsername(avatarUsernameEdit->text()); if (faceModelURL.toString() == faceURLString) { - // if there was no change to the face model URL then ask the data-server for what it is + // if there was no change to the face model URL then clear it and ask the data-server for what it is + applicationInstance->getAvatar()->getHead().getBlendFace().setModelURL(QUrl()); DataServerClient::getClientValueForKey(DataServerKey::FaceMeshURL); } } - QUrl avatarVoxelURL(avatarURL->text()); - applicationInstance->getAvatar()->getVoxels()->setVoxelURL(avatarVoxelURL); - if (faceModelURL.toString() != faceURLString) { applicationInstance->getAvatar()->getHead().getBlendFace().setModelURL(faceModelURL); @@ -827,6 +826,11 @@ void Menu::editPreferences() { faceModelURL.toString().toLocal8Bit().constData()); } + QUrl avatarVoxelURL(avatarURL->text()); + applicationInstance->getAvatar()->getVoxels()->setVoxelURL(avatarVoxelURL); + + + Avatar::sendAvatarURLsMessage(avatarVoxelURL, faceModelURL); applicationInstance->getAvatar()->getHead().setPupilDilation(pupilDilation->value() / (float)pupilDilation->maximum());