From a8e34e2899165141dcdf49ba541125567ece7a35 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Fri, 20 Jul 2018 21:27:18 +0100
Subject: [PATCH] MAINT-8863 - less verbose diagnostics, kept the fix. Make
 sure joint nums get rebuilt after invalid joints are scrubbed.

---
 indra/newview/llskinningutil.cpp | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/indra/newview/llskinningutil.cpp b/indra/newview/llskinningutil.cpp
index 72252aebde5..2bd70da01d5 100644
--- a/indra/newview/llskinningutil.cpp
+++ b/indra/newview/llskinningutil.cpp
@@ -111,9 +111,10 @@ void LLSkinningUtil::scrubInvalidJoints(LLVOAvatar *avatar, LLMeshSkinInfo* skin
         // needed for handling of any legacy bad data.
         if (!avatar->getJoint(skin->mJointNames[j]))
         {
-            LL_DEBUGS("Avatar") << avatar->getFullname() << " mesh rigged to invalid joint" << skin->mJointNames[j] << LL_ENDL;
+            LL_DEBUGS("Avatar") << avatar->getFullname() << " mesh rigged to invalid joint " << skin->mJointNames[j] << LL_ENDL;
             LL_WARNS_ONCE("Avatar") << avatar->getFullname() << " mesh rigged to invalid joint" << skin->mJointNames[j] << LL_ENDL;
             skin->mJointNames[j] = "mPelvis";
+            skin->mJointNumsInitialized = false; // force update after names change.
         }
     }
     skin->mInvalidJointsScrubbed = true;
@@ -156,10 +157,11 @@ void LLSkinningUtil::initSkinningMatrixPalette(
             LL_WARNS_ONCE("Avatar") << avatar->getFullname() 
                                     << " avatar build state: isBuilt() " << avatar->isBuilt() 
                                     << " mInitFlags " << avatar->mInitFlags << LL_ENDL;
+#if 0
             dump_avatar_and_skin_state("initSkinningMatrixPalette joint not found", avatar, skin);
+#endif
         }
     }
-    //dump_avatar_and_skin_state("initSkinningMatrixPalette finished OK", avatar, skin);
 }
 
 void LLSkinningUtil::checkSkinWeights(LLVector4a* weights, U32 num_vertices, const LLMeshSkinInfo* skin)
@@ -280,14 +282,13 @@ void LLSkinningUtil::initJointNums(LLMeshSkinInfo* skin, LLVOAvatar *avatar)
                 {
                     LL_WARNS_ONCE("Avatar") << avatar->getFullname() << " unable to find joint " << skin->mJointNames[j] << LL_ENDL;
                     LL_WARNS_ONCE("Avatar") << avatar->getFullname() << " avatar build state: isBuilt() " << avatar->isBuilt() << " mInitFlags " << avatar->mInitFlags << LL_ENDL;
+#if 0
                     dump_avatar_and_skin_state("initJointNums joint not found", avatar, skin);
+#endif
                 }
             }
         }
         skin->mJointNumsInitialized = true;
-        LL_WARNS("Avatar") << avatar->getFullname() << " jointNums initialized, avatar built " << avatar->isBuilt() 
-                           << " mInitFlags " << avatar->mInitFlags 
-                           << " num joints " << skin->mJointNames.size() << LL_ENDL;
     }
 }
 
-- 
GitLab