diff options
-rw-r--r-- | indra/llappearance/llpolyskeletaldistortion.cpp | 15 | ||||
-rw-r--r-- | indra/llcharacter/lljoint.h | 4 | ||||
-rw-r--r-- | indra/newview/llskinningutil.cpp | 18 |
3 files changed, 17 insertions, 20 deletions
diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp index fdce8d97ce..8e9b52e974 100644 --- a/indra/llappearance/llpolyskeletaldistortion.cpp +++ b/indra/llappearance/llpolyskeletaldistortion.cpp @@ -154,12 +154,6 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info) continue; } - // BENTO remove? - //if (mJointScales.find(joint) != mJointScales.end()) - //{ - // LL_WARNS() << "Scale deformation already supplied for joint " << joint->getName() << "." << LL_ENDL; - //} - // store it mJointScales[joint] = bone_info->mScaleDeformation; @@ -178,11 +172,6 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info) if (bone_info->mHasPositionDeformation) { - // BENTO remove? - //if (mJointOffsets.find(joint) != mJointOffsets.end()) - //{ - // LL_WARNS() << "Offset deformation already supplied for joint " << joint->getName() << "." << LL_ENDL; - //} mJointOffsets[joint] = bone_info->mPositionDeformation; } } @@ -237,8 +226,8 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex ) LLVector3 positionDelta = iter->second; newPosition = newPosition + (effective_weight * positionDelta) - (mLastWeight * positionDelta); // SL-315 - // BENTO - allow attachment positions to override requests from the params. - joint->setPosition(newPosition, true); + bool allow_attachment_pos_overrides = true; + joint->setPosition(newPosition, allow_attachment_pos_overrides); } if (mLastWeight != mCurWeight && !mIsAnimating) diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index 40e0a2749b..2afdef1026 100644 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -40,8 +40,8 @@ #include "xform.h" const S32 LL_CHARACTER_MAX_JOINTS_PER_MESH = 15; -// BENTO JOINT COUNT LIMIT - need to set this to final skeleton size -// (bones + attachments) + 2, rounded to next multiple of 4. +// Need to set this to count of animate-able joints (currently #bones + +// #attachments) + 2, rounded to next multiple of 4. const U32 LL_CHARACTER_MAX_ANIMATED_JOINTS = 192; // must be divisible by 4! const U32 LL_MAX_JOINTS_PER_MESH_OBJECT = 110; diff --git a/indra/newview/llskinningutil.cpp b/indra/newview/llskinningutil.cpp index b36bfc870f..d69432ad21 100644 --- a/indra/newview/llskinningutil.cpp +++ b/indra/newview/llskinningutil.cpp @@ -72,7 +72,7 @@ U32 get_valid_joint_index(const std::string& name, LLVOAvatar *avatar, std::vect return j; } } - // BENTO how to handle? + // Shouldn't ever get here, because of the name cleanup pass in remapSkinInfoJoints() LL_ERRS() << "no valid joints in joint_names" << LL_ENDL; return 0; } @@ -118,7 +118,7 @@ U32 LLSkinningUtil::getMaxJointCount() U32 result = LL_MAX_JOINTS_PER_MESH_OBJECT; if (!sIncludeEnhancedSkeleton) { - // BENTO - currently the remap logic does not guarantee joint count <= 52; + // Currently the remap logic does not guarantee joint count <= 52; // if one of the base ancestors is not rigged in a given mesh, an extended // joint can still be included. result = llmin(result,(U32)52); @@ -160,6 +160,16 @@ void LLSkinningUtil::remapSkinInfoJoints(LLVOAvatar *avatar, LLMeshSkinInfo* ski U32 max_joints = getMeshJointCount(skin); // Compute the remap + for (U32 j = 0; j < skin->mJointNames.size(); ++j) + { + // Fix invalid names to "mPelvis". Currently meshes with + // invalid names will be blocked on upload, so this is just + // needed for handling of any legacy bad data. + if (!avatar->getJoint(skin->mJointNames[j])) + { + skin->mJointNames[j] = "mPelvis"; + } + } std::vector<U32> j_proxy(skin->mJointNames.size()); for (U32 j = 0; j < skin->mJointNames.size(); ++j) { @@ -179,8 +189,6 @@ void LLSkinningUtil::remapSkinInfoJoints(LLVOAvatar *avatar, LLMeshSkinInfo* ski { top++; } - - } } // Then use j_proxy to fill in j_remap for the joints that will be discarded @@ -285,7 +293,7 @@ void LLSkinningUtil::remapSkinWeights(LLVector4a* weights, U32 num_vertices, con void LLSkinningUtil::checkSkinWeights(LLVector4a* weights, U32 num_vertices, const LLMeshSkinInfo* skin) { #ifndef LL_RELEASE_FOR_DOWNLOAD - const S32 max_joints = skin->mJointNames.size(); + const S32 max_joints = skin->mJointRemap.size(); if (skin->mJointRemap.size()>0) { // Check the weights are consistent with the current remap. |