clear the face model URL if the username is changed in preferences

This commit is contained in:
Stephen Birarda 2013-10-07 17:24:07 -07:00
parent 4b62026c25
commit 26d5e2cfec

View file

@ -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());