mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 13:38:02 +02:00
ask for a mesh if username is present on login or is changed
This commit is contained in:
parent
e9e77d8276
commit
b33843fddc
3 changed files with 19 additions and 3 deletions
|
@ -58,6 +58,7 @@
|
||||||
#include <VoxelSceneStats.h>
|
#include <VoxelSceneStats.h>
|
||||||
|
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
|
#include "DataServerClient.h"
|
||||||
#include "LogDisplay.h"
|
#include "LogDisplay.h"
|
||||||
#include "Menu.h"
|
#include "Menu.h"
|
||||||
#include "Swatch.h"
|
#include "Swatch.h"
|
||||||
|
@ -1585,6 +1586,11 @@ void Application::init() {
|
||||||
_audio.setJitterBufferSamples(Menu::getInstance()->getAudioJitterBufferSamples());
|
_audio.setJitterBufferSamples(Menu::getInstance()->getAudioJitterBufferSamples());
|
||||||
}
|
}
|
||||||
qDebug("Loaded settings.\n");
|
qDebug("Loaded settings.\n");
|
||||||
|
|
||||||
|
if (!_myAvatar.getUsername().isEmpty()) {
|
||||||
|
// we have a username for this avatar, ask the data-server for the mesh URL for this avatar
|
||||||
|
DataServerClient::getClientValueForKey(DataServerKey::FaceMeshURL);
|
||||||
|
}
|
||||||
|
|
||||||
// Set up VoxelSystem after loading preferences so we can get the desired max voxel count
|
// Set up VoxelSystem after loading preferences so we can get the desired max voxel count
|
||||||
_voxels.setMaxVoxels(Menu::getInstance()->getMaxVoxels());
|
_voxels.setMaxVoxels(Menu::getInstance()->getMaxVoxels());
|
||||||
|
|
|
@ -29,4 +29,8 @@ private:
|
||||||
static std::vector<unsigned char*> _unconfirmedPackets;
|
static std::vector<unsigned char*> _unconfirmedPackets;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace DataServerKey {
|
||||||
|
const char FaceMeshURL[] = "mesh";
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* defined(__hifi__DataServerClient__) */
|
#endif /* defined(__hifi__DataServerClient__) */
|
||||||
|
|
|
@ -804,21 +804,27 @@ void Menu::editPreferences() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QUrl faceModelURL(faceURLEdit->text());
|
||||||
|
|
||||||
if (avatarUsernameEdit->text() != avatarUsername) {
|
if (avatarUsernameEdit->text() != avatarUsername) {
|
||||||
// there has been a UUID change - set the new UUID on the avatar instance
|
// there has been a username change - set the new UUID on the avatar instance
|
||||||
applicationInstance->getAvatar()->setUsername(avatarUsernameEdit->text());
|
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
|
||||||
|
DataServerClient::getClientValueForKey(DataServerKey::FaceMeshURL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QUrl avatarVoxelURL(avatarURL->text());
|
QUrl avatarVoxelURL(avatarURL->text());
|
||||||
applicationInstance->getAvatar()->getVoxels()->setVoxelURL(avatarVoxelURL);
|
applicationInstance->getAvatar()->getVoxels()->setVoxelURL(avatarVoxelURL);
|
||||||
|
|
||||||
QUrl faceModelURL(faceURLEdit->text());
|
|
||||||
if (faceModelURL.toString() != faceURLString) {
|
if (faceModelURL.toString() != faceURLString) {
|
||||||
applicationInstance->getAvatar()->getHead().getBlendFace().setModelURL(faceModelURL);
|
applicationInstance->getAvatar()->getHead().getBlendFace().setModelURL(faceModelURL);
|
||||||
|
|
||||||
// send the new face mesh URL to the data-server (if we have a client UUID)
|
// send the new face mesh URL to the data-server (if we have a client UUID)
|
||||||
DataServerClient::putValueForKey("mesh", faceModelURL.toString().toLocal8Bit().constData());
|
DataServerClient::putValueForKey(DataServerKey::FaceMeshURL,
|
||||||
|
faceModelURL.toString().toLocal8Bit().constData());
|
||||||
}
|
}
|
||||||
|
|
||||||
Avatar::sendAvatarURLsMessage(avatarVoxelURL, faceModelURL);
|
Avatar::sendAvatarURLsMessage(avatarVoxelURL, faceModelURL);
|
||||||
|
|
Loading…
Reference in a new issue