#3870 Added joint initialization for LLVOAvatarSelf

Sometimes mesh thread crashes when allocating joints
master
Andrey Kleshchev 2025-04-21 16:59:29 +03:00 committed by Ansariel
parent 9b531e01eb
commit af9254e3e3
4 changed files with 14 additions and 0 deletions

View File

@ -4702,6 +4702,7 @@ void LLMeshRepository::notifyLoadedMeshes()
if (mPendingRequests.size() > push_count)
{
LL_PROFILE_ZONE_NAMED("Mesh score_map");
// More requests than the high-water limit allows so
// sort and forward the most important.

View File

@ -7370,6 +7370,16 @@ LLJoint *LLVOAvatar::getJoint( S32 joint_num )
return pJoint;
}
void LLVOAvatar::initAllJoints()
{
getJointAliases();
for (auto& alias : mJointAliasMap)
{
mJointMap[alias.first] = mRoot->findJoint(alias.second);
}
// ignore mScreen and mRoot
}
//-----------------------------------------------------------------------------
// getRiggedMeshID
//

View File

@ -210,6 +210,7 @@ public:
LLJoint* getJoint( const std::string &name ) { return getJoint( JointKey::construct( name ) ); }
// </FS:ND>
LLJoint* getJoint(S32 num);
void initAllJoints();
//if you KNOW joint_num is a valid animated joint index, use getSkeletonJoint for efficiency
inline LLJoint* getSkeletonJoint(S32 joint_num) { return mSkeleton[joint_num]; }

View File

@ -272,6 +272,8 @@ void LLVOAvatarSelf::initInstance()
doPeriodically(check_for_unsupported_baked_appearance, 120.0);
doPeriodically(boost::bind(&LLVOAvatarSelf::checkStuckAppearance, this), 30.0);
initAllJoints(); // mesh thread uses LLVOAvatarSelf as a joint source
mInitFlags |= 1<<2;
}