From a6f254551166707a3bd62a277f28bafd592c8710 Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Tue, 3 Oct 2017 12:51:37 -0700 Subject: [PATCH] fix local t pose --- libraries/animation/src/Rig.cpp | 4 +++- libraries/animation/src/Rig.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/animation/src/Rig.cpp b/libraries/animation/src/Rig.cpp index 712c728dcb..0897c26a12 100644 --- a/libraries/animation/src/Rig.cpp +++ b/libraries/animation/src/Rig.cpp @@ -1620,13 +1620,14 @@ void Rig::updateFromControllerParameters(const ControllerParameters& params, flo } void Rig::initAnimGraph(const QUrl& url) { - if (_animGraphURL != url || !_animNode) { + if (_animGraphURL != url || (!_animNode && !_animLoading)) { _animGraphURL = url; _animNode.reset(); // load the anim graph _animLoader.reset(new AnimNodeLoader(url)); + _animLoading = true; connect(_animLoader.get(), &AnimNodeLoader::success, [this](AnimNode::Pointer nodeIn) { _animNode = nodeIn; _animNode->setSkeleton(_animSkeleton); @@ -1637,6 +1638,7 @@ void Rig::initAnimGraph(const QUrl& url) { _userAnimState = { UserAnimState::None, "", 30.0f, false, 0.0f, 0.0f }; overrideAnimation(origState.url, origState.fps, origState.loop, origState.firstFrame, origState.lastFrame); } + _animLoading = false; emit onLoadComplete(); }); diff --git a/libraries/animation/src/Rig.h b/libraries/animation/src/Rig.h index eabc62ab75..18d49c5f1e 100644 --- a/libraries/animation/src/Rig.h +++ b/libraries/animation/src/Rig.h @@ -303,6 +303,7 @@ protected: std::shared_ptr _animNode; std::shared_ptr _animSkeleton; std::unique_ptr _animLoader; + bool _animLoading { false }; AnimVariantMap _animVars; enum class RigRole { Idle = 0,