From a4605289a2d12b59765ec64304755ab4388fbd7e Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Mon, 10 Sep 2018 10:03:05 -0700 Subject: [PATCH] animation on switch url --- libraries/entities-renderer/src/RenderableModelEntityItem.cpp | 4 ++-- libraries/entities-renderer/src/RenderableModelEntityItem.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp index 34936c2c48..1d698d47a6 100644 --- a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp @@ -1336,6 +1336,7 @@ void ModelEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce if (_parsedModelURL != model->getURL()) { withWriteLock([&] { _texturesLoaded = false; + _jointMappingCompleted = false; model->setURL(_parsedModelURL); }); } @@ -1445,8 +1446,7 @@ void ModelEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& sce if (!jointsMapped()) { mapJoints(entity, model->getJointNames()); //else the joint have been mapped before but we have a new animation to load - } else if (_animation && (_animation->getURL().toString() != entity->getAnimationURL())) { - _animation = DependencyManager::get()->getAnimation(entity->getAnimationURL()); + } else if (_animation && (_animation->getURL().toString() != entity->getAnimationURL())) { _jointMappingCompleted = false; mapJoints(entity, model->getJointNames()); } diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.h b/libraries/entities-renderer/src/RenderableModelEntityItem.h index 45892fdd7f..75f35fae9c 100644 --- a/libraries/entities-renderer/src/RenderableModelEntityItem.h +++ b/libraries/entities-renderer/src/RenderableModelEntityItem.h @@ -187,7 +187,7 @@ private: const void* _collisionMeshKey { nullptr }; // used on client side - bool _jointMappingCompleted{ false }; + bool _jointMappingCompleted { false }; QVector _jointMapping; // domain is index into model-joints, range is index into animation-joints AnimationPointer _animation; QUrl _parsedModelURL;