From f2bca5d6c6b94d3c749844a8f375ed15a81b419a Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Fri, 8 Mar 2019 07:32:41 +0100 Subject: [PATCH] added the multiple root joints warning --- interface/src/avatar/AvatarDoctor.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/interface/src/avatar/AvatarDoctor.cpp b/interface/src/avatar/AvatarDoctor.cpp index 45d05ad608..8c22780b52 100644 --- a/interface/src/avatar/AvatarDoctor.cpp +++ b/interface/src/avatar/AvatarDoctor.cpp @@ -168,12 +168,23 @@ void AvatarDoctor::startDiagnosing() { _errors.push_back({ "Asymmetrical leg bones.", DEFAULT_URL }); } + // Multiple skeleton root joints checkup + int skeletonRootJoints = 0; + foreach(const HFMJoint& joint, avatarModel.joints) { + if (joint.parentIndex == -1 && joint.isSkeletonJoint) { + skeletonRootJoints++; + } + } + + if (skeletonRootJoints > 1) { + _errors.push_back({ "Multiple root joints found.", DEFAULT_URL }); + } + const auto rig = new Rig(); rig->reset(avatarModel); const float eyeHeight = rig->getUnscaledEyeHeight(); const float ratio = eyeHeight / DEFAULT_AVATAR_HEIGHT; const float avatarHeight = eyeHeight + ratio * DEFAULT_AVATAR_EYE_TO_TOP_OF_HEAD; - qDebug() << "avatarHeight = " << avatarHeight; // SCALE const float RECOMMENDED_MIN_HEIGHT = DEFAULT_AVATAR_HEIGHT * 0.25f;