From b30562b9ce1f63bcf89dc56fa11a8fd3028cdb84 Mon Sep 17 00:00:00 2001 From: Armads Date: Thu, 24 Aug 2017 14:25:07 -0400 Subject: [PATCH] Adding checks to hide avatar attachments to other head and facial joints --- interface/src/avatar/MyAvatar.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 76535930bc..983d0b252a 100755 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -1893,6 +1893,17 @@ void MyAvatar::preDisplaySide(RenderArgs* renderArgs) { const bool shouldDrawHead = shouldRenderHead(renderArgs); if (shouldDrawHead != _prevShouldDrawHead) { _skeletonModel->setEnableCauterization(!shouldDrawHead); + + for (int i = 0; i < _attachmentData.size(); i++) { + if (_attachmentData[i].jointName.compare("Head", Qt::CaseInsensitive) == 0 || + _attachmentData[i].jointName.compare("Neck", Qt::CaseInsensitive) == 0 || + _attachmentData[i].jointName.compare("LeftEye", Qt::CaseInsensitive) == 0 || + _attachmentData[i].jointName.compare("RightEye", Qt::CaseInsensitive) == 0 || + _attachmentData[i].jointName.compare("HeadTop_End", Qt::CaseInsensitive) == 0 || + _attachmentData[i].jointName.compare("Face", Qt::CaseInsensitive) == 0) { + _attachmentModels[i]->setVisibleInScene(shouldDrawHead, qApp->getMain3DScene()); + } + } } _prevShouldDrawHead = shouldDrawHead; }