Fix MyAvatar getting stuck in T-pose on loading

Before this change, there was a race condition between the main thread calling Model::initWhenReady,
and the render thread calling Avatar::fixupModelsInScene().  They both would end up setting the
Model::_addedToScene flag.  This race caused Model::initWhenReady() to never return true, which
resulted in the MyAvatar class never initializing the animation system.
This commit is contained in:
Anthony J. Thibault 2017-09-08 11:44:06 -07:00
parent db0ecb61fd
commit 559ac6786d

View file

@ -648,7 +648,9 @@ void Avatar::render(RenderArgs* renderArgs) {
return;
}
fixupModelsInScene(renderArgs->_scene);
if (!isMyAvatar()) {
fixupModelsInScene(renderArgs->_scene);
}
if (showCollisionShapes && shouldRenderHead(renderArgs) && _skeletonModel->isRenderable()) {
PROFILE_RANGE_BATCH(batch, __FUNCTION__":skeletonBoundingCollisionShapes");