diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index b544739f5a..d477db936e 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -830,6 +830,9 @@ void MyAvatar::loadData() { settings.endGroup(); _rig->setEnableRig(Menu::getInstance()->isOptionChecked(MenuOption::EnableRigAnimations)); + setEnableMeshVisible(Menu::getInstance()->isOptionChecked(MenuOption::MeshVisible)); + setEnableDebugDrawBindPose(Menu::getInstance()->isOptionChecked(MenuOption::AnimDebugDrawBindPose)); + setEnableDebugDrawAnimPose(Menu::getInstance()->isOptionChecked(MenuOption::AnimDebugDrawAnimPose)); } void MyAvatar::saveAttachmentData(const AttachmentData& attachment) const { @@ -1269,7 +1272,7 @@ void MyAvatar::initAnimGraph() { // python2 -m SimpleHTTPServer& //auto graphUrl = QUrl("http://localhost:8000/avatar.json"); auto graphUrl = QUrl("https://gist.githubusercontent.com/hyperlogic/7d6a0892a7319c69e2b9/raw/e2cb37aee601b6fba31d60eac3f6ae3ef72d4a66/avatar.json"); - _skeletonModel.initAnimGraph(graphUrl, _skeletonModel.getGeometry()->getFBXGeometry()); + _rig->initAnimGraph(graphUrl, _skeletonModel.getGeometry()->getFBXGeometry()); } void MyAvatar::destroyAnimGraph() { diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index a3a7514778..bb3c6385f9 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -19,7 +19,6 @@ #include "Avatar.h" class ModelItemID; -class AnimNode; enum eyeContactTarget { LEFT_EYE, diff --git a/interface/src/avatar/SkeletonModel.cpp b/interface/src/avatar/SkeletonModel.cpp index ffe15a6d04..8a05b15c4c 100644 --- a/interface/src/avatar/SkeletonModel.cpp +++ b/interface/src/avatar/SkeletonModel.cpp @@ -622,6 +622,3 @@ bool SkeletonModel::hasSkeleton() { void SkeletonModel::onInvalidate() { } -void SkeletonModel::initAnimGraph(const QUrl& url, const FBXGeometry& fbxGeometry) { - _rig->initAnimGraph(url, fbxGeometry); -} diff --git a/interface/src/avatar/SkeletonModel.h b/interface/src/avatar/SkeletonModel.h index fc99f22ee9..e2c3ab8f83 100644 --- a/interface/src/avatar/SkeletonModel.h +++ b/interface/src/avatar/SkeletonModel.h @@ -106,8 +106,6 @@ public: virtual void onInvalidate() override; - void initAnimGraph(const QUrl& url, const FBXGeometry& fbxGeometry); - signals: void skeletonLoaded(); diff --git a/tests/animation/src/AnimTests.cpp b/tests/animation/src/AnimTests.cpp index 806560d96f..a08288000e 100644 --- a/tests/animation/src/AnimTests.cpp +++ b/tests/animation/src/AnimTests.cpp @@ -127,21 +127,20 @@ void AnimTests::testClipEvaulateWithVars() { void AnimTests::testLoader() { auto url = QUrl("https://gist.githubusercontent.com/hyperlogic/857129fe04567cbe670f/raw/8ba57a8f0a76f88b39a11f77f8d9df04af9cec95/test.json"); + // NOTE: This will warn about missing "test01.fbx", "test02.fbx", etc. if the resource loading code doesn't handle relative pathnames! + // However, the test will proceed. AnimNodeLoader loader(url); const int timeout = 1000; QEventLoop loop; - QTimer timer; - timer.setInterval(timeout); - timer.setSingleShot(true); AnimNode::Pointer node = nullptr; connect(&loader, &AnimNodeLoader::success, [&](AnimNode::Pointer nodeIn) { node = nodeIn; }); loop.connect(&loader, SIGNAL(success(AnimNode::Pointer)), SLOT(quit())); loop.connect(&loader, SIGNAL(error(int, QString)), SLOT(quit())); - loop.connect(&timer, SIGNAL(timeout()), SLOT(quit())); - timer.start(); + QTimer::singleShot(timeout, &loop, SLOT(quit())); + loop.exec(); QVERIFY((bool)node); @@ -184,42 +183,58 @@ void AnimTests::testLoader() { void AnimTests::testVariant() { auto defaultVar = AnimVariant(); - auto boolVar = AnimVariant(true); - auto intVar = AnimVariant(1); - auto floatVar = AnimVariant(1.0f); - auto vec3Var = AnimVariant(glm::vec3(1.0f, 2.0f, 3.0f)); - auto quatVar = AnimVariant(glm::quat(1.0f, 2.0f, 3.0f, 4.0f)); + auto boolVarTrue = AnimVariant(true); + auto boolVarFalse = AnimVariant(false); + auto intVarZero = AnimVariant(0); + auto intVarOne = AnimVariant(1); + auto intVarNegative = AnimVariant(-1); + auto floatVarZero = AnimVariant(0.0f); + auto floatVarOne = AnimVariant(1.0f); + auto floatVarNegative = AnimVariant(-1.0f); + auto vec3Var = AnimVariant(glm::vec3(1.0f, -2.0f, 3.0f)); + auto quatVar = AnimVariant(glm::quat(1.0f, 2.0f, -3.0f, 4.0f)); auto mat4Var = AnimVariant(glm::mat4(glm::vec4(1.0f, 2.0f, 3.0f, 4.0f), - glm::vec4(5.0f, 6.0f, 7.0f, 8.0f), + glm::vec4(5.0f, 6.0f, -7.0f, 8.0f), glm::vec4(9.0f, 10.0f, 11.0f, 12.0f), glm::vec4(13.0f, 14.0f, 15.0f, 16.0f))); QVERIFY(defaultVar.isBool()); QVERIFY(defaultVar.getBool() == false); - QVERIFY(boolVar.isBool()); - QVERIFY(boolVar.getBool() == true); + QVERIFY(boolVarTrue.isBool()); + QVERIFY(boolVarTrue.getBool() == true); + QVERIFY(boolVarFalse.isBool()); + QVERIFY(boolVarFalse.getBool() == false); - QVERIFY(intVar.isInt()); - QVERIFY(intVar.getInt() == 1); + QVERIFY(intVarZero.isInt()); + QVERIFY(intVarZero.getInt() == 0); + QVERIFY(intVarOne.isInt()); + QVERIFY(intVarOne.getInt() == 1); + QVERIFY(intVarNegative.isInt()); + QVERIFY(intVarNegative.getInt() == -1); - QVERIFY(floatVar.isFloat()); - QVERIFY(floatVar.getFloat() == 1.0f); + QVERIFY(floatVarZero.isFloat()); + QVERIFY(floatVarZero.getFloat() == 0.0f); + QVERIFY(floatVarOne.isFloat()); + QVERIFY(floatVarOne.getFloat() == 1.0f); + QVERIFY(floatVarNegative.isFloat()); + QVERIFY(floatVarNegative.getFloat() == -1.0f); QVERIFY(vec3Var.isVec3()); auto v = vec3Var.getVec3(); QVERIFY(v.x == 1.0f); - QVERIFY(v.y == 2.0f); + QVERIFY(v.y == -2.0f); QVERIFY(v.z == 3.0f); QVERIFY(quatVar.isQuat()); auto q = quatVar.getQuat(); QVERIFY(q.w == 1.0f); QVERIFY(q.x == 2.0f); - QVERIFY(q.y == 3.0f); + QVERIFY(q.y == -3.0f); QVERIFY(q.z == 4.0f); QVERIFY(mat4Var.isMat4()); auto m = mat4Var.getMat4(); QVERIFY(m[0].x == 1.0f); + QVERIFY(m[1].z == -7.0f); QVERIFY(m[3].w == 16.0f); }