From e6297ab3d6262014d3b501703154437bea523be1 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 27 Sep 2016 17:29:22 -0400 Subject: SL-451 - support for getJoint() by number, use in initSkinningMatrixPalette() --- indra/newview/llskinningutil.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'indra/newview/llskinningutil.cpp') diff --git a/indra/newview/llskinningutil.cpp b/indra/newview/llskinningutil.cpp index d69432ad21..e1333b8352 100644 --- a/indra/newview/llskinningutil.cpp +++ b/indra/newview/llskinningutil.cpp @@ -203,6 +203,7 @@ void LLSkinningUtil::remapSkinInfoJoints(LLVOAvatar *avatar, LLMeshSkinInfo* ski // Apply the remap to mJointNames, mInvBindMatrix, and mAlternateBindMatrix std::vector new_joint_names; + std::vector new_joint_nums; std::vector new_inv_bind_matrix; std::vector new_alternate_bind_matrix; @@ -211,6 +212,7 @@ void LLSkinningUtil::remapSkinInfoJoints(LLVOAvatar *avatar, LLMeshSkinInfo* ski if (j_proxy[j] == j && new_joint_names.size() < max_joints) { new_joint_names.push_back(skin->mJointNames[j]); + new_joint_nums.push_back(-1); new_inv_bind_matrix.push_back(skin->mInvBindMatrix[j]); if (!skin->mAlternateBindMatrix.empty()) { @@ -245,7 +247,19 @@ void LLSkinningUtil::initSkinningMatrixPalette( // Note that we are mostly passing Matrix4a's to this routine anyway, just dubiously casted. for (U32 j = 0; j < count; ++j) { - LLJoint* joint = avatar->getJoint(skin->mJointNames[j]); + LLJoint *joint = NULL; + if (skin->mJointNums[j] == -1) + { + joint = avatar->getJoint(skin->mJointNames[j]); + if (joint) + { + skin->mJointNums[j] = joint->getJointNum(); + } + } + else + { + joint = avatar->getJoint(skin->mJointNums[j]); + } mat[j] = skin->mInvBindMatrix[j]; if (joint) { -- cgit v1.2.3