From ef02c9ea694a1f0ddc830a66f23555c6316afdc7 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 3 Feb 2016 08:59:25 -0500 Subject: SL-315 - context strings, comments, debugging. joint_test temporarily disabled. --- indra/llappearance/llpolyskeletaldistortion.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llappearance/llpolyskeletaldistortion.cpp') diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp index fbc312c426..722965af28 100644 --- a/indra/llappearance/llpolyskeletaldistortion.cpp +++ b/indra/llappearance/llpolyskeletaldistortion.cpp @@ -225,6 +225,7 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex ) LLVector3 newPosition = joint->getPosition(); LLVector3 positionDelta = iter->second; newPosition = newPosition + (effective_weight * positionDelta) - (mLastWeight * positionDelta); + // SL-315 joint->setPosition(newPosition); } -- cgit v1.2.3 From 70156605e283326e9476908141c44c197f9c6d18 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 22 Apr 2016 14:51:57 -0400 Subject: SL-374 - don't allow sliders to modify joint positions if there's already a mesh-imposed override in place. --- indra/llappearance/llpolyskeletaldistortion.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llappearance/llpolyskeletaldistortion.cpp') diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp index 722965af28..484969a9d9 100644 --- a/indra/llappearance/llpolyskeletaldistortion.cpp +++ b/indra/llappearance/llpolyskeletaldistortion.cpp @@ -226,7 +226,8 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex ) LLVector3 positionDelta = iter->second; newPosition = newPosition + (effective_weight * positionDelta) - (mLastWeight * positionDelta); // SL-315 - joint->setPosition(newPosition); + // BENTO - allow attachment positions to override requests from the params. + joint->setPosition(newPosition, true); } if (mLastWeight != mCurWeight && !mIsAnimating) -- cgit v1.2.3 From 182f2a48159e231149227e1cd606b3d7ead04dcd Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 11 May 2016 16:08:25 -0400 Subject: SL-315 - resetSkeleton(), working for bones at least partially, still some issues with collision volumes --- indra/llappearance/llpolyskeletaldistortion.cpp | 88 +++++++++++++------------ 1 file changed, 45 insertions(+), 43 deletions(-) (limited to 'indra/llappearance/llpolyskeletaldistortion.cpp') diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp index 484969a9d9..f75603e083 100644 --- a/indra/llappearance/llpolyskeletaldistortion.cpp +++ b/indra/llappearance/llpolyskeletaldistortion.cpp @@ -134,55 +134,57 @@ LLPolySkeletalDistortion::~LLPolySkeletalDistortion() BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info) { - llassert(mInfo == NULL); - if (info->mID < 0) - return FALSE; - mInfo = info; - mID = info->mID; - setWeight(getDefaultWeight()); - - LLPolySkeletalDistortionInfo::bone_info_list_t::iterator iter; - for (iter = getInfo()->mBoneInfoList.begin(); iter != getInfo()->mBoneInfoList.end(); iter++) + //llassert(mInfo == NULL); + if (info->mID < 0) + { + return FALSE; + } + mInfo = info; + mID = info->mID; + setWeight(getDefaultWeight()); + + LLPolySkeletalDistortionInfo::bone_info_list_t::iterator iter; + for (iter = getInfo()->mBoneInfoList.begin(); iter != getInfo()->mBoneInfoList.end(); iter++) + { + LLPolySkeletalBoneInfo *bone_info = &(*iter); + LLJoint* joint = mAvatar->getJoint(bone_info->mBoneName); + if (!joint) { - LLPolySkeletalBoneInfo *bone_info = &(*iter); - LLJoint* joint = mAvatar->getJoint(bone_info->mBoneName); - if (!joint) - { - LL_WARNS() << "Joint " << bone_info->mBoneName << " not found." << LL_ENDL; - continue; - } + LL_WARNS() << "Joint " << bone_info->mBoneName << " not found." << LL_ENDL; + continue; + } - if (mJointScales.find(joint) != mJointScales.end()) - { - LL_WARNS() << "Scale deformation already supplied for joint " << joint->getName() << "." << LL_ENDL; - } + //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; + // store it + mJointScales[joint] = bone_info->mScaleDeformation; - // apply to children that need to inherit it - for (LLJoint::child_list_t::iterator iter = joint->mChildren.begin(); - iter != joint->mChildren.end(); ++iter) - { - LLAvatarJoint* child_joint = (LLAvatarJoint*)(*iter); - if (child_joint->inheritScale()) - { - LLVector3 childDeformation = LLVector3(child_joint->getScale()); - childDeformation.scaleVec(bone_info->mScaleDeformation); - mJointScales[child_joint] = childDeformation; - } - } + // apply to children that need to inherit it + for (LLJoint::child_list_t::iterator iter = joint->mChildren.begin(); + iter != joint->mChildren.end(); ++iter) + { + LLAvatarJoint* child_joint = (LLAvatarJoint*)(*iter); + if (child_joint->inheritScale()) + { + LLVector3 childDeformation = LLVector3(child_joint->getScale()); + childDeformation.scaleVec(bone_info->mScaleDeformation); + mJointScales[child_joint] = childDeformation; + } + } - if (bone_info->mHasPositionDeformation) - { - if (mJointOffsets.find(joint) != mJointOffsets.end()) - { - LL_WARNS() << "Offset deformation already supplied for joint " << joint->getName() << "." << LL_ENDL; - } - mJointOffsets[joint] = bone_info->mPositionDeformation; - } + if (bone_info->mHasPositionDeformation) + { + //if (mJointOffsets.find(joint) != mJointOffsets.end()) + //{ + // LL_WARNS() << "Offset deformation already supplied for joint " << joint->getName() << "." << LL_ENDL; + //} + mJointOffsets[joint] = bone_info->mPositionDeformation; } - return TRUE; + } + return TRUE; } /*virtual*/ LLViewerVisualParam* LLPolySkeletalDistortion::cloneParam(LLWearable* wearable) const -- cgit v1.2.3 From e8afa4c413efac9f58fbfccb1c14c114317a383e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 18 May 2016 17:07:54 -0400 Subject: SL-315 - fixed collision volume scale issue in resetSkeleton() --- indra/llappearance/llpolyskeletaldistortion.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'indra/llappearance/llpolyskeletaldistortion.cpp') diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp index f75603e083..fdce8d97ce 100644 --- a/indra/llappearance/llpolyskeletaldistortion.cpp +++ b/indra/llappearance/llpolyskeletaldistortion.cpp @@ -34,6 +34,7 @@ #include "llpolymorph.h" #include "llwearable.h" #include "llfasttimer.h" +#include "llcallstack.h" #include "llpolyskeletaldistortion.h" @@ -134,7 +135,6 @@ LLPolySkeletalDistortion::~LLPolySkeletalDistortion() BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info) { - //llassert(mInfo == NULL); if (info->mID < 0) { return FALSE; @@ -154,6 +154,7 @@ 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; @@ -177,6 +178,7 @@ 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; @@ -213,9 +215,16 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex ) joint = iter->first; LLVector3 newScale = joint->getScale(); LLVector3 scaleDelta = iter->second; - newScale = newScale + (effective_weight * scaleDelta) - (mLastWeight * scaleDelta); + LLVector3 offset = (effective_weight - mLastWeight) * scaleDelta; + newScale = newScale + offset; //An aspect of attached mesh objects (which contain joint offsets) that need to be cleaned up when detached // needed? // joint->storeScaleForReset( newScale ); + + // BENTO debugging stuff can be pulled. + std::stringstream ostr; + ostr << "LLPolySkeletalDistortion::apply, id " << getID() << " " << getName() << " effective wt " << effective_weight << " last wt " << mLastWeight << " scaleDelta " << scaleDelta << " offset " << offset; + LLScopedContextString str(ostr.str()); + joint->setScale(newScale); } -- cgit v1.2.3 From 3a53109152b961c9d0e7d6dd4f66b02d7531fb2a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 7 Jun 2016 10:39:32 -0400 Subject: SL-395 - support scale overrides (currently no way to get these into a dae, so the actual scale values are fabricated at run-time based on the joint name) --- indra/llappearance/llpolyskeletaldistortion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llappearance/llpolyskeletaldistortion.cpp') diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp index fdce8d97ce..890292a1f6 100644 --- a/indra/llappearance/llpolyskeletaldistortion.cpp +++ b/indra/llappearance/llpolyskeletaldistortion.cpp @@ -225,7 +225,7 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex ) ostr << "LLPolySkeletalDistortion::apply, id " << getID() << " " << getName() << " effective wt " << effective_weight << " last wt " << mLastWeight << " scaleDelta " << scaleDelta << " offset " << offset; LLScopedContextString str(ostr.str()); - joint->setScale(newScale); + joint->setScale(newScale, true); } for (iter = mJointOffsets.begin(); -- cgit v1.2.3 From b649847fe9f693b50b99cb73b7c641660812f5b7 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 24 Jun 2016 16:43:23 -0400 Subject: SL-124 - comment cleanup, fixed a crash if skinned mesh has no valid joint names defined --- indra/llappearance/llpolyskeletaldistortion.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'indra/llappearance/llpolyskeletaldistortion.cpp') 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) -- cgit v1.2.3 From 7f904fbcbd878b44b2ffe6c919e96c71756eece1 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 27 Jun 2016 08:48:15 -0400 Subject: SL-124 - code cleanup --- indra/llappearance/llpolyskeletaldistortion.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'indra/llappearance/llpolyskeletaldistortion.cpp') diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp index 8e9b52e974..a427f7c754 100644 --- a/indra/llappearance/llpolyskeletaldistortion.cpp +++ b/indra/llappearance/llpolyskeletaldistortion.cpp @@ -207,12 +207,13 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex ) LLVector3 offset = (effective_weight - mLastWeight) * scaleDelta; newScale = newScale + offset; //An aspect of attached mesh objects (which contain joint offsets) that need to be cleaned up when detached - // needed? // joint->storeScaleForReset( newScale ); + // needed? + // joint->storeScaleForReset( newScale ); - // BENTO debugging stuff can be pulled. - std::stringstream ostr; - ostr << "LLPolySkeletalDistortion::apply, id " << getID() << " " << getName() << " effective wt " << effective_weight << " last wt " << mLastWeight << " scaleDelta " << scaleDelta << " offset " << offset; - LLScopedContextString str(ostr.str()); + // BENTO for detailed stack tracing of params. + //std::stringstream ostr; + //ostr << "LLPolySkeletalDistortion::apply, id " << getID() << " " << getName() << " effective wt " << effective_weight << " last wt " << mLastWeight << " scaleDelta " << scaleDelta << " offset " << offset; + //LLScopedContextString str(ostr.str()); joint->setScale(newScale); } -- cgit v1.2.3 From 5ebf9b3caeb95f6f196786c37847d409e94df415 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 29 Jun 2016 09:41:06 -0400 Subject: SL-426 - strings.xml fix for pec attachments, SL-402 - diagnostics for investigation --- indra/llappearance/llpolyskeletaldistortion.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/llappearance/llpolyskeletaldistortion.cpp') diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp index a427f7c754..e9750ae6f5 100644 --- a/indra/llappearance/llpolyskeletaldistortion.cpp +++ b/indra/llappearance/llpolyskeletaldistortion.cpp @@ -211,9 +211,9 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex ) // joint->storeScaleForReset( newScale ); // BENTO for detailed stack tracing of params. - //std::stringstream ostr; - //ostr << "LLPolySkeletalDistortion::apply, id " << getID() << " " << getName() << " effective wt " << effective_weight << " last wt " << mLastWeight << " scaleDelta " << scaleDelta << " offset " << offset; - //LLScopedContextString str(ostr.str()); + std::stringstream ostr; + ostr << "LLPolySkeletalDistortion::apply, id " << getID() << " " << getName() << " effective wt " << effective_weight << " last wt " << mLastWeight << " scaleDelta " << scaleDelta << " offset " << offset; + LLScopedContextString str(ostr.str()); joint->setScale(newScale); } -- cgit v1.2.3 From 95d9e85f9539c449f37c438b90a90e6ac73d3b87 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 9 Aug 2016 15:24:09 -0400 Subject: SL-109 - made viewer much less tolerant of bad data in avatar_skeleton.xml or avatar_lad.xml. If either of these is broken, there's no point trying to continue, more informative to just error out with an appropriate message. --- indra/llappearance/llpolyskeletaldistortion.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/llappearance/llpolyskeletaldistortion.cpp') diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp index e9750ae6f5..8d71335175 100644 --- a/indra/llappearance/llpolyskeletaldistortion.cpp +++ b/indra/llappearance/llpolyskeletaldistortion.cpp @@ -150,8 +150,10 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info) LLJoint* joint = mAvatar->getJoint(bone_info->mBoneName); if (!joint) { + // There's no point continuing after this error - means + // that either the skeleton or lad file is broken. LL_WARNS() << "Joint " << bone_info->mBoneName << " not found." << LL_ENDL; - continue; + return FALSE; } // store it -- cgit v1.2.3 From 4c2144e1153fb71544140bb51630b13e17ead6d3 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 18 Nov 2016 09:39:14 -0500 Subject: SL-534 - make handling of other-gender sliders more consistent. Fixes mGroin bug. --- indra/llappearance/llpolyskeletaldistortion.cpp | 82 ++++++++++++------------- 1 file changed, 41 insertions(+), 41 deletions(-) (limited to 'indra/llappearance/llpolyskeletaldistortion.cpp') diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp index 5662fdd6bc..5b77a7433a 100644 --- a/indra/llappearance/llpolyskeletaldistortion.cpp +++ b/indra/llappearance/llpolyskeletaldistortion.cpp @@ -192,52 +192,52 @@ static LLTrace::BlockTimerStatHandle FTM_POLYSKELETAL_DISTORTION_APPLY("Skeletal void LLPolySkeletalDistortion::apply( ESex avatar_sex ) { - LL_RECORD_BLOCK_TIME(FTM_POLYSKELETAL_DISTORTION_APPLY); + LL_RECORD_BLOCK_TIME(FTM_POLYSKELETAL_DISTORTION_APPLY); - F32 effective_weight = ( getSex() & avatar_sex ) ? mCurWeight : getDefaultWeight(); + F32 effective_weight = ( getSex() & avatar_sex ) ? mCurWeight : getDefaultWeight(); - LLJoint* joint; - joint_vec_map_t::iterator iter; + LLJoint* joint; + joint_vec_map_t::iterator iter; - for (iter = mJointScales.begin(); - iter != mJointScales.end(); - iter++) - { - joint = iter->first; - LLVector3 newScale = joint->getScale(); - LLVector3 scaleDelta = iter->second; - LLVector3 offset = (effective_weight - mLastWeight) * scaleDelta; - newScale = newScale + offset; - //An aspect of attached mesh objects (which contain joint offsets) that need to be cleaned up when detached - // needed? - // joint->storeScaleForReset( newScale ); - - // BENTO for detailed stack tracing of params. - std::stringstream ostr; - ostr << "LLPolySkeletalDistortion::apply, id " << getID() << " " << getName() << " effective wt " << effective_weight << " last wt " << mLastWeight << " scaleDelta " << scaleDelta << " offset " << offset; - LLScopedContextString str(ostr.str()); - - joint->setScale(newScale, true); - } + for (iter = mJointScales.begin(); + iter != mJointScales.end(); + iter++) + { + joint = iter->first; + LLVector3 newScale = joint->getScale(); + LLVector3 scaleDelta = iter->second; + LLVector3 offset = (effective_weight - mLastWeight) * scaleDelta; + newScale = newScale + offset; + //An aspect of attached mesh objects (which contain joint offsets) that need to be cleaned up when detached + // needed? + // joint->storeScaleForReset( newScale ); + + // BENTO for detailed stack tracing of params. + std::stringstream ostr; + ostr << "LLPolySkeletalDistortion::apply, id " << getID() << " " << getName() << " effective wt " << effective_weight << " last wt " << mLastWeight << " scaleDelta " << scaleDelta << " offset " << offset; + LLScopedContextString str(ostr.str()); + + joint->setScale(newScale, true); + } - for (iter = mJointOffsets.begin(); - iter != mJointOffsets.end(); - iter++) - { - joint = iter->first; - LLVector3 newPosition = joint->getPosition(); - LLVector3 positionDelta = iter->second; - newPosition = newPosition + (effective_weight * positionDelta) - (mLastWeight * positionDelta); - // SL-315 - bool allow_attachment_pos_overrides = true; - joint->setPosition(newPosition, allow_attachment_pos_overrides); - } + for (iter = mJointOffsets.begin(); + iter != mJointOffsets.end(); + iter++) + { + joint = iter->first; + LLVector3 newPosition = joint->getPosition(); + LLVector3 positionDelta = iter->second; + newPosition = newPosition + (effective_weight * positionDelta) - (mLastWeight * positionDelta); + // SL-315 + bool allow_attachment_pos_overrides = true; + joint->setPosition(newPosition, allow_attachment_pos_overrides); + } - if (mLastWeight != mCurWeight && !mIsAnimating) - { - mAvatar->setSkeletonSerialNum(mAvatar->getSkeletonSerialNum() + 1); - } - mLastWeight = mCurWeight; + if (mLastWeight != effective_weight && !mIsAnimating) + { + mAvatar->setSkeletonSerialNum(mAvatar->getSkeletonSerialNum() + 1); + } + mLastWeight = effective_weight; } -- cgit v1.2.3