fix avatar loading spheres

This commit is contained in:
SamGondelman 2019-05-17 15:29:27 -07:00
parent 024dfbf8b7
commit 3273f46179
3 changed files with 14 additions and 13 deletions

View file

@ -412,7 +412,7 @@ AvatarSharedPointer AvatarManager::newSharedAvatar(const QUuid& sessionUUID) {
auto otherAvatar = new OtherAvatar(qApp->thread());
otherAvatar->setSessionUUID(sessionUUID);
auto nodeList = DependencyManager::get<NodeList>();
if (!nodeList || !nodeList->isIgnoringNode(sessionUUID)) {
if (nodeList && !nodeList->isIgnoringNode(sessionUUID)) {
otherAvatar->createOrb();
}
return AvatarSharedPointer(otherAvatar, [](OtherAvatar* ptr) { ptr->deleteLater(); });

View file

@ -62,7 +62,7 @@ void OtherAvatar::removeOrb() {
}
void OtherAvatar::updateOrbPosition() {
if (_otherAvatarOrbMeshPlaceholderID.isNull()) {
if (!_otherAvatarOrbMeshPlaceholderID.isNull()) {
EntityItemProperties properties;
properties.setPosition(getHead()->getPosition());
DependencyManager::get<EntityScriptingInterface>()->editEntity(_otherAvatarOrbMeshPlaceholderID, properties);

View file

@ -1519,18 +1519,19 @@ void Avatar::scaleVectorRelativeToPosition(glm::vec3 &positionToScale) const {
}
void Avatar::setSkeletonModelURL(const QUrl& skeletonModelURL) {
AvatarData::setSkeletonModelURL(skeletonModelURL);
if (QThread::currentThread() == thread()) {
if (!isMyAvatar() && !DependencyManager::get<NodeList>()->isIgnoringNode(getSessionUUID())) {
createOrb();
}
_skeletonModel->setURL(_skeletonModelURL);
indicateLoadingStatus(LoadingStatus::LoadModel);
} else {
QMetaObject::invokeMethod(_skeletonModel.get(), "setURL", Qt::QueuedConnection, Q_ARG(QUrl, _skeletonModelURL));
if (QThread::currentThread() != thread()) {
QMetaObject::invokeMethod(this, "setSkeletonModelURL", Q_ARG(const QUrl&, skeletonModelURL));
return;
}
AvatarData::setSkeletonModelURL(skeletonModelURL);
if (!isMyAvatar() && !DependencyManager::get<NodeList>()->isIgnoringNode(getSessionUUID())) {
createOrb();
}
indicateLoadingStatus(LoadingStatus::LoadModel);
_skeletonModel->setURL(_skeletonModelURL);
}
void Avatar::setModelURLFinished(bool success) {