diff --git a/interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml b/interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml index 2fc5cc4196..f91642105f 100644 --- a/interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml +++ b/interface/resources/qml/hifi/tablet/OpenVrConfiguration.qml @@ -9,9 +9,9 @@ import QtQuick 2.5 import QtGraphicalEffects 1.0 -import stylesUit 1.0 +import "../../styles-uit" import "../../controls" -import controlsUit 1.0 as HifiControls +import "../../controls-uit" as HifiControls import "." diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 502be9d57c..8d47591d40 100755 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -431,7 +431,7 @@ void MyAvatar::reset(bool andRecenter, bool andReload, bool andHead) { _wasPushing = _isPushing = _isBraking = false; _follow.deactivate(); if (andReload) { - //_skeletonModel->reset(); + _skeletonModel->reset(); } if (andHead) { // which drives camera in desktop getHead()->reset(); diff --git a/libraries/animation/src/AnimSkeleton.cpp b/libraries/animation/src/AnimSkeleton.cpp index 1d4d662928..aec969af69 100644 --- a/libraries/animation/src/AnimSkeleton.cpp +++ b/libraries/animation/src/AnimSkeleton.cpp @@ -31,8 +31,11 @@ AnimSkeleton::AnimSkeleton(const HFMModel& hfmModel) { buildSkeletonFromJoints(joints, hfmModel.jointRotationOffsets); // add offsets for spine2 and the neck - - + static bool once = true; + qCDebug(animation) << "the hfm model path is " << hfmModel.originalURL; + if (once && hfmModel.originalURL == "/angus/avatars/engineer_hifinames/engineer_hifinames/engineer_hifinames.fbx") { + //if (once && hfmModel.originalURL == "/angus/avatars/pei_z_neckNexX_spine2NegY_fwd/pei_z_neckNexX_spine2NegY_fwd/pei_z_neckNexX_spine2NegY_fwd.fbx") { + once = false; for (int i = 0; i < (int)hfmModel.meshes.size(); i++) { const HFMMesh& mesh = hfmModel.meshes.at(i); for (int j = 0; j < mesh.clusters.size(); j++) { @@ -44,6 +47,15 @@ AnimSkeleton::AnimSkeleton(const HFMModel& hfmModel) { // AJT: mutate bind pose! this allows us to oreint the skeleton back into the authored orientaiton before // rendering, with no runtime overhead. // this works if clusters match joints one for one. + if (hfmModel.jointRotationOffsets.contains(cluster.jointIndex)) { + qCDebug(animation) << "found a joint offset to add " << cluster.jointIndex << " " << offset2 << " cluster " << cluster.jointIndex; + AnimPose localOffset(hfmModel.jointRotationOffsets[cluster.jointIndex], glm::vec3()); + //AnimPose localOffset(offset2, glm::vec3()); + cluster.inverseBindMatrix = (glm::mat4)localOffset.inverse() * cluster.inverseBindMatrix; + cluster.inverseBindTransform.evalFromRawMatrix(cluster.inverseBindMatrix); + } + + /* if (cluster.jointIndex == 62) { qCDebug(animation) << "Neck"; @@ -55,14 +67,16 @@ AnimSkeleton::AnimSkeleton(const HFMModel& hfmModel) { } if (cluster.jointIndex == 13) { qCDebug(animation) << "Spine2"; - qCDebug(animation) << "found a joint offset to add " << cluster.jointIndex << " " << offset1<< " cluster " << cluster.jointIndex; + qCDebug(animation) << "found a joint offset to add " << cluster.jointIndex << " " << offset1 << " cluster " << cluster.jointIndex; AnimPose localOffset(hfmModel.jointRotationOffsets[cluster.jointIndex], glm::vec3()); //AnimPose localOffset(offset1, glm::vec3()); cluster.inverseBindMatrix = (glm::mat4)localOffset.inverse() * cluster.inverseBindMatrix; cluster.inverseBindTransform.evalFromRawMatrix(cluster.inverseBindMatrix); } + */ } } + } @@ -247,6 +261,7 @@ void AnimSkeleton::buildSkeletonFromJoints(const std::vector& joints, } } + for (int k = 0; k < _jointsSize; k++) { int parentIndex2 = getParentIndex(k); if (jointOffsets.contains(k)) { @@ -261,6 +276,10 @@ void AnimSkeleton::buildSkeletonFromJoints(const std::vector& joints, _relativeDefaultPoses.push_back(_absoluteDefaultPoses[k]); } } + + // re-compute relative poses + //_relativeDefaultPoses = _absoluteDefaultPoses; + //convertAbsolutePosesToRelative(_relativeDefaultPoses); for (int i = 0; i < _jointsSize; i++) { diff --git a/libraries/fbx/src/FBXReader.cpp b/libraries/fbx/src/FBXReader.cpp index 6ae2b69e60..6213cc458b 100644 --- a/libraries/fbx/src/FBXReader.cpp +++ b/libraries/fbx/src/FBXReader.cpp @@ -2031,8 +2031,8 @@ HFMModel* FBXReader::extractHFMModel(const QVariantHash& mapping, const QString& } qCDebug(modelformat) << "Joint Rotation Offset added to Rig._jointRotationOffsets : " << " jointName: " << jointName << " jointIndex: " << jointIndex << " rotation offset: " << rotationOffset; } - hfmModel.jointRotationOffsets.insert(13, glm::quat(0.5f, 0.5f, 0.5f, -0.5f)); - hfmModel.jointRotationOffsets.insert(62, glm::quat(0.7071f, 0.0f, -0.7071f, 0.0f)); + //hfmModel.jointRotationOffsets.insert(13, glm::quat(0.5f, 0.5f, 0.5f, -0.5f)); + //hfmModel.jointRotationOffsets.insert(62, glm::quat(0.7071f, 0.0f, -0.7071f, 0.0f)); return hfmModelPtr; }