From c480c85f85a07eabac035e5f039677ff111bc103 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Wed, 24 Jun 2015 17:35:23 -0700 Subject: [PATCH] Fixes for switching between fullAvatar and head & body avatars while in first person. Need to always add _skeletonModel to the main scene when switching to head/body avatar. Need to always remove _firstPersonSkeletonModel from main scene when switching to head/body avatar. --- interface/src/avatar/MyAvatar.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 4704fc3413..4b140e0569 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -993,6 +993,7 @@ QString MyAvatar::getModelDescription() const { } void MyAvatar::setFaceModelURL(const QUrl& faceModelURL) { + Avatar::setFaceModelURL(faceModelURL); render::ScenePointer scene = Application::getInstance()->getMain3DScene(); getHead()->getFaceModel().setVisibleInScene(_prevShouldDrawHead, scene); @@ -1000,19 +1001,27 @@ void MyAvatar::setFaceModelURL(const QUrl& faceModelURL) { } void MyAvatar::setSkeletonModelURL(const QUrl& skeletonModelURL) { + Avatar::setSkeletonModelURL(skeletonModelURL); render::ScenePointer scene = Application::getInstance()->getMain3DScene(); - _skeletonModel.setVisibleInScene(_prevShouldDrawHead, scene); _billboardValid = false; if (_useFullAvatar) { + _skeletonModel.setVisibleInScene(_prevShouldDrawHead, scene); + const QUrl DEFAULT_SKELETON_MODEL_URL = QUrl::fromLocalFile(PathUtils::resourcesPath() + "meshes/defaultAvatar_body.fst"); _firstPersonSkeletonModel.setURL(_skeletonModelURL, DEFAULT_SKELETON_MODEL_URL, true, !isMyAvatar()); _firstPersonSkeletonModel.setVisibleInScene(!_prevShouldDrawHead, scene); + } else { + _skeletonModel.setVisibleInScene(true, scene); + + _firstPersonSkeletonModel.setVisibleInScene(false, scene); + _firstPersonSkeletonModel.reset(); } } void MyAvatar::useFullAvatarURL(const QUrl& fullAvatarURL, const QString& modelName) { + if (QThread::currentThread() != thread()) { QMetaObject::invokeMethod(this, "useFullAvatarURL", Qt::BlockingQueuedConnection, Q_ARG(const QUrl&, fullAvatarURL),