From 590d0e35e542fe3d973e5a67e1a7db34c0429701 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 12 Aug 2015 15:23:57 -0400 Subject: SL-109 WIP - brought over work from SL-125 repo that was not dynamic skeleton related --- indra/newview/llvoavatar.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index f753448770..253271322c 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5435,8 +5435,14 @@ BOOL LLVOAvatar::loadSkeletonNode () LLViewerJointAttachment* attachment = new LLViewerJointAttachment(); attachment->setName(info->mName); - LLJoint *parentJoint = getJoint(info->mJointName); - if (!parentJoint) + LLJoint *parent_joint = getJoint(info->mJointName); + if (!parent_joint) + { + // If the intended location for attachment point is unavailable, stick it in a default location. + LL_INFOS() << "attachment pt " << info->mName << " using mPelvis as default parent" << LL_ENDL; + parent_joint = getJoint("mPelvis"); + } + if (!parent_joint) { LL_WARNS() << "No parent joint by name " << info->mJointName << " found for attachment point " << info->mName << LL_ENDL; delete attachment; @@ -5491,7 +5497,7 @@ BOOL LLVOAvatar::loadSkeletonNode () mAttachmentPoints[attachmentID] = attachment; // now add attachment joint - parentJoint->addChild(attachment); + parent_joint->addChild(attachment); } } -- cgit v1.2.3 From 2a57da233423ca3531bfcec2e138023afead4c3f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 14 Aug 2015 15:00:08 -0400 Subject: SL-125 WIP - updated base bento repo excluding dynamic skeleton. --- indra/newview/llvoavatar.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 253271322c..202b63dec0 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5153,7 +5153,10 @@ void LLVOAvatar::clearAttachmentPosOverrides() for (; iter != end; ++iter) { LLJoint* pJoint = (*iter); - pJoint->clearAttachmentPosOverrides(); + if (pJoint) + { + pJoint->clearAttachmentPosOverrides(); + } } } -- cgit v1.2.3 From 97374a5362f097afd3027ea51757de2e36af4798 Mon Sep 17 00:00:00 2001 From: Aura Linden Date: Tue, 27 Oct 2015 15:15:34 -0700 Subject: Fixes SL-202 joint offset and skin weight import. Race condition still exists. --- indra/newview/llvoavatar.cpp | 63 +------------------------------------------- 1 file changed, 1 insertion(+), 62 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 68bb39eb98..3b482e1bc0 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -213,24 +213,6 @@ struct LLTextureMaskData ** **/ -//------------------------------------------------------------------------ -// LLVOAvatarBoneInfo -// Trans/Scale/Rot etc. info about each avatar bone. Used by LLVOAvatarSkeleton. -//------------------------------------------------------------------------ -struct LLVOAvatarCollisionVolumeInfo : public LLInitParam::Block -{ - LLVOAvatarCollisionVolumeInfo() - : name("name"), - pos("pos"), - rot("rot"), - scale("scale") - {} - - Mandatory name; - Mandatory pos, - rot, - scale; -}; struct LLAppearanceMessageContents { @@ -252,49 +234,6 @@ struct LLAppearanceMessageContents bool mHoverOffsetWasSet; }; -struct LLVOAvatarChildJoint : public LLInitParam::ChoiceBlock - { - Alternative > bone; - Alternative collision_volume; - - LLVOAvatarChildJoint() - : bone("bone"), - collision_volume("collision_volume") - {} -}; - - - -struct LLVOAvatarBoneInfo : public LLInitParam::Block -{ - LLVOAvatarBoneInfo() - : pivot("pivot") - {} - - Mandatory pivot; - Multiple children; -}; - -//------------------------------------------------------------------------ -// LLVOAvatarSkeletonInfo -// Overall avatar skeleton -//------------------------------------------------------------------------ -struct LLVOAvatarSkeletonInfo : public LLInitParam::Block -{ - LLVOAvatarSkeletonInfo() - : skeleton_root(""), - num_bones("num_bones"), - num_collision_volumes("num_collision_volumes"), - version("version") - {} - - Mandatory version; - Mandatory num_bones, - num_collision_volumes; - Mandatory skeleton_root; -}; - - //----------------------------------------------------------------------------- // class LLBodyNoiseMotion @@ -1527,7 +1466,7 @@ BOOL LLVOAvatar::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& for (S32 i = 0; i < mNumCollisionVolumes; ++i) { mCollisionVolumes[i].updateWorldMatrix(); - + glh::matrix4f mat((F32*) mCollisionVolumes[i].getXform()->getWorldMatrix().mMatrix); glh::matrix4f inverse = mat.inverse(); glh::matrix4f norm_mat = inverse.transpose(); -- cgit v1.2.3 From 146919fa764bed09bfa5e27bc30d02ce2afb6188 Mon Sep 17 00:00:00 2001 From: Aura Linden Date: Wed, 11 Nov 2015 13:44:51 -0800 Subject: animations and meshes will recognize all joint names in joint_aliases.xml --- indra/newview/llvoavatar.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 3b482e1bc0..d14ec7e55b 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -937,6 +937,29 @@ std::string LLVOAvatar::rezStatusToString(S32 rez_status) return "unknown"; } +void LLVOAvatar::getLegalJointNames(std::deque& legal_joint_names, + bool include_collision_volumes) +{ + // Get all standard skeleton joints from the preview avatar. + const LLVOAvatar::avatar_joint_list_t &skel = getSkeleton(); + for (S32 i=0; igetName()); + } + } + + if (include_collision_volumes) + { + for (S32 i = 0; i < mNumCollisionVolumes; i++) + { + legal_joint_names.push_back(mCollisionVolumes[i].getName()); + } + } +} + // static void LLVOAvatar::dumpBakedStatus() { -- cgit v1.2.3 From cdb96f8044fd609f92b9009450454e356008ca1c Mon Sep 17 00:00:00 2001 From: Aura Linden Date: Fri, 13 Nov 2015 14:31:21 -0800 Subject: Post review changes. --- indra/newview/llvoavatar.cpp | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index b6924e5904..3b482e1bc0 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -937,27 +937,6 @@ std::string LLVOAvatar::rezStatusToString(S32 rez_status) return "unknown"; } -void LLVOAvatar::getLegalJointNames(std::deque& legal_joint_names, - bool include_collision_volumes) -{ - LLAvatarAppearance::joint_alias_map_t alias_map = getJointAliases(); - - std::map::iterator iter; - - for (iter = alias_map.begin(); iter != alias_map.end(); ++iter) - { - legal_joint_names.push_back(iter->first); - } - - if (include_collision_volumes) - { - for (S32 i = 0; i < mNumCollisionVolumes; i++) - { - legal_joint_names.push_back(mCollisionVolumes[i].getName()); - } - } -} - // static void LLVOAvatar::dumpBakedStatus() { -- cgit v1.2.3 From 94d7d6a623d755424c2bd8c2526bff0d46101915 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 17 Nov 2015 16:41:55 -0500 Subject: SL-271 WIP, SL-201 WIP - add support for end point to joints, use for debug rendering display to show bones. --- indra/newview/llvoavatar.cpp | 48 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 3b482e1bc0..5fed8ce938 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1360,6 +1360,54 @@ void LLVOAvatar::renderCollisionVolumes() addDebugText(ostr.str()); } +void LLVOAvatar::renderBones() +{ + std::ostringstream ostr; + std::ostringstream nullstr; + + avatar_joint_list_t::iterator iter = mSkeleton.begin(); + avatar_joint_list_t::iterator end = mSkeleton.end(); + + for (; iter != end; ++iter) + { + LLJoint* jointp = *iter; + if (!jointp) + { + continue; + } + + ostr << jointp->getName() << ", "; + + jointp->updateWorldMatrix(); + + gGL.pushMatrix(); + gGL.multMatrix( &jointp->getXform()->getWorldMatrix().mMatrix[0][0] ); + + gGL.diffuseColor3f( 1.f, 0.f, 1.f ); + + gGL.begin(LLRender::LINES); + + LLVector3 v[] = + { + LLVector3(0,0,0), + LLVector3(0,0,0), + }; + v[1] = jointp->getEnd(); + + gGL.vertex3fv(v[0].mV); + gGL.vertex3fv(v[1].mV); + + gGL.end(); + + gGL.popMatrix(); + } + + mDebugText.clear(); + addDebugText(ostr.str()); + addDebugText(nullstr.str()); +} + + void LLVOAvatar::renderJoints() { std::ostringstream ostr; -- cgit v1.2.3 From 3d66c31156cdde6240f5f27e18275060205f8ce9 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 18 Nov 2015 13:21:15 -0500 Subject: SL-271 WIP, SL-201 WIP - leaf joint attrib is now end. Show bones option now includes occluded portions. --- indra/newview/llvoavatar.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 5fed8ce938..7d38cd116d 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1362,6 +1362,9 @@ void LLVOAvatar::renderCollisionVolumes() void LLVOAvatar::renderBones() { + + LLGLEnable blend(GL_BLEND); + std::ostringstream ostr; std::ostringstream nullstr; @@ -1379,12 +1382,10 @@ void LLVOAvatar::renderBones() ostr << jointp->getName() << ", "; jointp->updateWorldMatrix(); - + gGL.pushMatrix(); gGL.multMatrix( &jointp->getXform()->getWorldMatrix().mMatrix[0][0] ); - gGL.diffuseColor3f( 1.f, 0.f, 1.f ); - gGL.begin(LLRender::LINES); LLVector3 v[] = @@ -1394,6 +1395,19 @@ void LLVOAvatar::renderBones() }; v[1] = jointp->getEnd(); + LLGLDepthTest normal_depth(GL_TRUE); + + // Unoccluded bone portions + gGL.diffuseColor3f( 1.f, 1.f, 1.f ); + + gGL.vertex3fv(v[0].mV); + gGL.vertex3fv(v[1].mV); + + LLGLDepthTest depth_under(GL_TRUE, GL_FALSE, GL_GREATER); + + // Unoccluded bone portions + gGL.diffuseColor3f( 1.0f, 0.f, 0.0f ); + gGL.vertex3fv(v[0].mV); gGL.vertex3fv(v[1].mV); -- cgit v1.2.3 From 2bd8234fe574ec08eed8d9c04e938482315dbc27 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 20 Nov 2015 08:08:57 -0500 Subject: SL-271 WIP - color base and extended bones differently. --- indra/newview/llvoavatar.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7d38cd116d..cf49cd2589 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1382,6 +1382,7 @@ void LLVOAvatar::renderBones() ostr << jointp->getName() << ", "; jointp->updateWorldMatrix(); + LLJoint::SupportCategory sc = jointp->getSupport(); gGL.pushMatrix(); gGL.multMatrix( &jointp->getXform()->getWorldMatrix().mMatrix[0][0] ); @@ -1398,7 +1399,15 @@ void LLVOAvatar::renderBones() LLGLDepthTest normal_depth(GL_TRUE); // Unoccluded bone portions - gGL.diffuseColor3f( 1.f, 1.f, 1.f ); + if (sc == LLJoint::SupportCategory::SUPPORT_BASE) + { + gGL.diffuseColor3f( 1.0f, 0.5f, 0.5f ); + } + else + { + gGL.diffuseColor3f( 0.5f, 1.0f, 0.5f ); + } + gGL.vertex3fv(v[0].mV); gGL.vertex3fv(v[1].mV); @@ -1406,7 +1415,14 @@ void LLVOAvatar::renderBones() LLGLDepthTest depth_under(GL_TRUE, GL_FALSE, GL_GREATER); // Unoccluded bone portions - gGL.diffuseColor3f( 1.0f, 0.f, 0.0f ); + if (sc == LLJoint::SupportCategory::SUPPORT_BASE) + { + gGL.diffuseColor3f( 1.0f, 0.0f, 0.0f ); + } + else + { + gGL.diffuseColor3f( 0.0f, 1.0f, 0.0f ); + } gGL.vertex3fv(v[0].mV); gGL.vertex3fv(v[1].mV); -- cgit v1.2.3 From fff9d936f93cd22efcdcc4b37489d57100d8d261 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 20 Nov 2015 09:21:20 -0500 Subject: SL-273 WIP - possible fix for linux build failure --- indra/newview/llvoavatar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index cf49cd2589..d5b663b6cd 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1399,7 +1399,7 @@ void LLVOAvatar::renderBones() LLGLDepthTest normal_depth(GL_TRUE); // Unoccluded bone portions - if (sc == LLJoint::SupportCategory::SUPPORT_BASE) + if (sc == LLJoint::SUPPORT_BASE) { gGL.diffuseColor3f( 1.0f, 0.5f, 0.5f ); } @@ -1415,7 +1415,7 @@ void LLVOAvatar::renderBones() LLGLDepthTest depth_under(GL_TRUE, GL_FALSE, GL_GREATER); // Unoccluded bone portions - if (sc == LLJoint::SupportCategory::SUPPORT_BASE) + if (sc == LLJoint::SUPPORT_BASE) { gGL.diffuseColor3f( 1.0f, 0.0f, 0.0f ); } -- cgit v1.2.3 From e91a192301db37f99a4f5a817f3b4c47b448417a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 26 Jan 2016 11:11:52 -0500 Subject: SL-315 WIP - added callstack info to joint debugging. Made joint debugging run-time configurable via debug setting DebugAvatarJoints --- indra/newview/llvoavatar.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index efc07fffe5..ffe51ee0ae 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1084,6 +1084,9 @@ void LLVOAvatar::initClass() gAnimLibrary.animStateSetString(ANIM_AGENT_PELVIS_FIX,"pelvis_fix"); gAnimLibrary.animStateSetString(ANIM_AGENT_TARGET,"target"); gAnimLibrary.animStateSetString(ANIM_AGENT_WALK_ADJUST,"walk_adjust"); + + // Where should this be set initially? + LLJoint::setDebugJointNames(gSavedSettings.getString("DebugAvatarJoints")); } -- cgit v1.2.3 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/newview/llvoavatar.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index ffe51ee0ae..ba58dcfe07 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -105,6 +105,7 @@ #include "llsdutil.h" #include "llscenemonitor.h" #include "llsdserialize.h" +#include "llcallstack.h" extern F32 SPEED_ADJUST_MAX; extern F32 SPEED_ADJUST_MAX_SEC; @@ -2097,6 +2098,8 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time) return; } + LLScopedContextString str("avatar_idle_update " + getFullname()); + checkTextureLoading() ; // force immediate pixel area update on avatars using last frames data (before drawable or camera updates) @@ -3098,6 +3101,7 @@ void LLVOAvatar::idleUpdateBelowWater() void LLVOAvatar::slamPosition() { gAgent.setPositionAgent(getPositionAgent()); + // SL-315 mRoot->setWorldPosition(getPositionAgent()); // teleport setChanged(TRANSLATED); if (mDrawable.notNull()) @@ -3450,6 +3454,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) mTimeLast = animation_time; // put the pelvis at slaved position/mRotation + // SL-315 mRoot->setWorldPosition( getPositionAgent() ); // first frame mRoot->setWorldRotation( getRotation() ); } @@ -3504,6 +3509,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) if (newPosition != mRoot->getXform()->getWorldPosition()) { mRoot->touch(); + // SL-315 mRoot->setWorldPosition( newPosition ); // regular update } @@ -3667,6 +3673,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) { LLVector3 pos = mDrawable->getPosition(); pos += getHoverOffset() * mDrawable->getRotation(); + // SL-315 mRoot->setPosition(pos); mRoot->setRotation(mDrawable->getRotation()); } @@ -3697,6 +3704,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) LLVector3 pos = mRoot->getWorldPosition(); pos.mV[VZ] += off_z; mRoot->touch(); + // SL-315 mRoot->setWorldPosition(pos); } } @@ -5171,6 +5179,8 @@ bool LLVOAvatar::getRiggedMeshID(LLViewerObject* pVO, LLUUID& mesh_id) void LLVOAvatar::clearAttachmentPosOverrides() { + LLScopedContextString str("clearAttachmentPosOverrides " + getFullname()); + //Subsequent joints are relative to pelvis avatar_joint_list_t::iterator iter = mSkeleton.begin(); avatar_joint_list_t::iterator end = mSkeleton.end(); @@ -5195,7 +5205,9 @@ void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo) { LL_WARNS("Avatar") << "called with invalid avatar" << LL_ENDL; } - + + LLScopedContextString str("addAttachmentPosOverridesForObject " + av->getFullname()); + // Process all children LLViewerObject::const_child_list_t& children = vo->getChildren(); for (LLViewerObject::const_child_list_t::const_iterator it = children.begin(); @@ -5316,6 +5328,7 @@ void LLVOAvatar::resetJointPositionsOnDetach(const LLUUID& mesh_id) if ( pJoint && pJoint == pJointPelvis) { removePelvisFixup( mesh_id ); + // SL-315 pJoint->setPosition( LLVector3( 0.0f, 0.0f, 0.0f) ); } } @@ -6098,6 +6111,7 @@ void LLVOAvatar::sitOnObject(LLViewerObject *sit_object) // objects to be not rendered for new arrivals. See EXT-6835 and EXT-1655. sitDown(TRUE); mRoot->getXform()->setParent(&sit_object->mDrawable->mXform); // LLVOAvatar::sitOnObject + // SL-315 mRoot->setPosition(getPosition()); mRoot->updateWorldMatrixChildren(); @@ -6156,6 +6170,7 @@ void LLVOAvatar::getOffObject() sitDown(FALSE); mRoot->getXform()->setParent(NULL); // LLVOAvatar::getOffObject + // SL-315 mRoot->setPosition(cur_position_world); mRoot->setRotation(cur_rotation_world); mRoot->getXform()->update(); -- cgit v1.2.3 From f8ee9ffce6f53427b35d344a290deb6efa467463 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 3 Feb 2016 16:52:27 -0500 Subject: SL-333 work - attachment joints now get a valid mJointNum, more checking on valid joint num values. Also reduced log spam slightly. --- indra/newview/llvoavatar.cpp | 60 ++++++++++++++++---------------------------- 1 file changed, 22 insertions(+), 38 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index ba58dcfe07..15e1f88d76 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1054,7 +1054,6 @@ void LLVOAvatar::deleteCachedImages(bool clearAll) { if (LLViewerTexLayerSet::sHasCaches) { - LL_DEBUGS() << "Deleting layer set caches" << LL_ENDL; for (std::vector::iterator iter = LLCharacter::sInstances.begin(); iter != LLCharacter::sInstances.end(); ++iter) { @@ -1175,12 +1174,6 @@ LLAvatarJoint* LLVOAvatar::createAvatarJoint() return new LLViewerJoint(); } -// virtual -LLAvatarJoint* LLVOAvatar::createAvatarJoint(S32 joint_num) -{ - return new LLViewerJoint(joint_num); -} - // virtual LLAvatarJointMesh* LLVOAvatar::createAvatarJointMesh() { @@ -1769,8 +1762,6 @@ void LLVOAvatar::releaseMeshData() return; } - LL_DEBUGS() << "Releasing mesh data" << LL_ENDL; - // cleanup mesh data for (avatar_joint_list_t::iterator iter = mMeshLOD.begin(); iter != mMeshLOD.end(); @@ -1980,17 +1971,12 @@ U32 LLVOAvatar::processUpdateMessage(LLMessageSystem *mesgsys, // Do base class updates... U32 retval = LLViewerObject::processUpdateMessage(mesgsys, user_data, block_num, update_type, dp); - //LLTEContents tec; - //S32 te_retval = parseTEMessage(mesgsys, _PREHASH_ObjectData, block_num, tec); - - LL_DEBUGS("Avatar") << avString() << update_type << LL_ENDL; - // Print out arrival information once we have name of avatar. - if (has_name && getNVPair("FirstName")) - { - mDebugExistenceTimer.reset(); - debugAvatarRezTime("AvatarRezArrivedNotification","avatar arrived"); - } + if (has_name && getNVPair("FirstName")) + { + mDebugExistenceTimer.reset(); + debugAvatarRezTime("AvatarRezArrivedNotification","avatar arrived"); + } if(retval & LLViewerObject::INVALID_UPDATE) { @@ -5474,7 +5460,6 @@ BOOL LLVOAvatar::loadSkeletonNode () } LLViewerJointAttachment* attachment = new LLViewerJointAttachment(); - attachment->setName(info->mName); LLJoint *parent_joint = getJoint(info->mJointName); if (!parent_joint) @@ -5507,7 +5492,7 @@ BOOL LLVOAvatar::loadSkeletonNode () int group = info->mGroup; if (group >= 0) { - if (group < 0 || group >= 9) + if (group < 0 || group > 9) { LL_WARNS() << "Invalid group number (" << group << ") for attachment point " << info->mName << LL_ENDL; } @@ -5534,7 +5519,8 @@ BOOL LLVOAvatar::loadSkeletonNode () attachment->setPieSlice(info->mPieMenuSlice); attachment->setVisibleInFirstPerson(info->mVisibleFirstPerson); attachment->setIsHUDAttachment(info->mIsHUDAttachment); - + // attachment can potentially be animated, needs a number. + attachment->setJointNum(mSkeleton.size() + attachmentID -1); mAttachmentPoints[attachmentID] = attachment; // now add attachment joint @@ -7277,7 +7263,7 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe U8 av_u8; mesgsys->getU8Fast(_PREHASH_AppearanceData, _PREHASH_AppearanceVersion, av_u8, 0); contents.mAppearanceVersion = av_u8; - LL_DEBUGS("Avatar") << "appversion set by AppearanceData field: " << contents.mAppearanceVersion << LL_ENDL; + //LL_DEBUGS("Avatar") << "appversion set by AppearanceData field: " << contents.mAppearanceVersion << LL_ENDL; mesgsys->getS32Fast(_PREHASH_AppearanceData, _PREHASH_CofVersion, contents.mCOFVersion, 0); // For future use: //mesgsys->getU32Fast(_PREHASH_AppearanceData, _PREHASH_Flags, appearance_flags, 0); @@ -7289,7 +7275,7 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe { LLVector3 hover; mesgsys->getVector3Fast(_PREHASH_AppearanceHover, _PREHASH_HoverHeight, hover); - LL_DEBUGS("Avatar") << avString() << " hover received " << hover.mV[ VX ] << "," << hover.mV[ VY ] << "," << hover.mV[ VZ ] << LL_ENDL; + //LL_DEBUGS("Avatar") << avString() << " hover received " << hover.mV[ VX ] << "," << hover.mV[ VY ] << "," << hover.mV[ VZ ] << LL_ENDL; contents.mHoverOffset = hover; contents.mHoverOffsetWasSet = true; } @@ -7299,7 +7285,7 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe bool drop_visual_params_debug = gSavedSettings.getBOOL("BlockSomeAvatarAppearanceVisualParams") && (ll_rand(2) == 0); // pretend that ~12% of AvatarAppearance messages arrived without a VisualParam block, for testing if( num_blocks > 1 && !drop_visual_params_debug) { - LL_DEBUGS("Avatar") << avString() << " handle visual params, num_blocks " << num_blocks << LL_ENDL; + //LL_DEBUGS("Avatar") << avString() << " handle visual params, num_blocks " << num_blocks << LL_ENDL; LLVisualParam* param = getFirstVisualParam(); llassert(param); // if this ever fires, we should do the same as when num_blocks<=1 @@ -7360,7 +7346,7 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe { S32 index = it - contents.mParams.begin(); contents.mParamAppearanceVersion = ll_round(contents.mParamWeights[index]); - LL_DEBUGS("Avatar") << "appversion req by appearance_version param: " << contents.mParamAppearanceVersion << LL_ENDL; + //LL_DEBUGS("Avatar") << "appversion req by appearance_version param: " << contents.mParamAppearanceVersion << LL_ENDL; } } } @@ -7389,9 +7375,9 @@ bool resolve_appearance_version(const LLAppearanceMessageContents& contents, S32 { appearance_version = 1; } - LL_DEBUGS("Avatar") << "appearance version info - field " << contents.mAppearanceVersion - << " param: " << contents.mParamAppearanceVersion - << " final: " << appearance_version << LL_ENDL; + //LL_DEBUGS("Avatar") << "appearance version info - field " << contents.mAppearanceVersion + // << " param: " << contents.mParamAppearanceVersion + // << " final: " << appearance_version << LL_ENDL; return true; } @@ -7400,8 +7386,6 @@ bool resolve_appearance_version(const LLAppearanceMessageContents& contents, S32 //----------------------------------------------------------------------------- void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) { - LL_DEBUGS("Avatar") << "starts" << LL_ENDL; - bool enable_verbose_dumps = gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"); std::string dump_prefix = getFullname() + "_" + (isSelf()?"s":"o") + "_"; if (gSavedSettings.getBOOL("BlockAvatarAppearanceMessages")) @@ -7445,7 +7429,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } else { - LL_DEBUGS("Avatar") << "appearance message received" << LL_ENDL; + //LL_DEBUGS("Avatar") << "appearance message received" << LL_ENDL; } // Check for stale update. @@ -7509,8 +7493,8 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) BOOL is_first_appearance_message = !mFirstAppearanceMessageReceived; mFirstAppearanceMessageReceived = TRUE; - LL_DEBUGS("Avatar") << avString() << "processAvatarAppearance start " << mID - << " first? " << is_first_appearance_message << " self? " << isSelf() << LL_ENDL; + //LL_DEBUGS("Avatar") << avString() << "processAvatarAppearance start " << mID + // << " first? " << is_first_appearance_message << " self? " << isSelf() << LL_ENDL; if (is_first_appearance_message ) { @@ -7523,7 +7507,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) // Apply visual params if( num_params > 1) { - LL_DEBUGS("Avatar") << avString() << " handle visual params, num_params " << num_params << LL_ENDL; + //LL_DEBUGS("Avatar") << avString() << " handle visual params, num_params " << num_params << LL_ENDL; BOOL params_changed = FALSE; BOOL interp_params = FALSE; S32 params_changed_count = 0; @@ -7754,7 +7738,7 @@ void LLVOAvatar::onInitialBakedTextureLoaded( BOOL success, LLViewerFetchedTextu if (selfp) { - LL_DEBUGS("Avatar") << selfp->avString() << "discard_level " << discard_level << " success " << success << " final " << final << LL_ENDL; + //LL_DEBUGS("Avatar") << selfp->avString() << "discard_level " << discard_level << " success " << success << " final " << final << LL_ENDL; } if (!success && selfp) @@ -7772,14 +7756,14 @@ void LLVOAvatar::onBakedTextureLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata) { - LL_DEBUGS("Avatar") << "onBakedTextureLoaded: " << src_vi->getID() << LL_ENDL; + //LL_DEBUGS("Avatar") << "onBakedTextureLoaded: " << src_vi->getID() << LL_ENDL; LLUUID id = src_vi->getID(); LLUUID *avatar_idp = (LLUUID *)userdata; LLVOAvatar *selfp = (LLVOAvatar *)gObjectList.findObject(*avatar_idp); if (selfp) { - LL_DEBUGS("Avatar") << selfp->avString() << "discard_level " << discard_level << " success " << success << " final " << final << " id " << src_vi->getID() << LL_ENDL; + //LL_DEBUGS("Avatar") << selfp->avString() << "discard_level " << discard_level << " success " << success << " final " << final << " id " << src_vi->getID() << LL_ENDL; } if (selfp && !success) -- cgit v1.2.3 From 62d14e1a33edf2df88761969f81e70ecd0081dab Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 12 Feb 2016 15:40:46 -0500 Subject: SL-333 WIP - added back some unused constructors to make the appearance utility happier --- indra/newview/llvoavatar.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 15e1f88d76..762ff95840 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1174,6 +1174,12 @@ LLAvatarJoint* LLVOAvatar::createAvatarJoint() return new LLViewerJoint(); } +// virtual +LLAvatarJoint* LLVOAvatar::createAvatarJoint(S32 joint_num) +{ + return new LLViewerJoint(joint_num); +} + // virtual LLAvatarJointMesh* LLVOAvatar::createAvatarJointMesh() { -- cgit v1.2.3 From 78938c2eac044f8c01574394647b973725842543 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 23 Feb 2016 16:44:32 -0500 Subject: SL-341 - added ellipsoid-based visualization of collision volumes. --- indra/newview/llvoavatar.cpp | 123 ++++++++++++++++++++++++++++++------------- 1 file changed, 85 insertions(+), 38 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 762ff95840..84d585df02 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -106,6 +106,7 @@ #include "llscenemonitor.h" #include "llsdserialize.h" #include "llcallstack.h" +#include "llrendersphere.h" extern F32 SPEED_ADJUST_MAX; extern F32 SPEED_ADJUST_MAX_SEC; @@ -1340,6 +1341,43 @@ void LLVOAvatar::getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) newMax.add(buffer); } +void render_sphere_and_line(const LLVector3& begin_pos, const LLVector3& end_pos, F32 sphere_scale, const LLVector3& occ_color, const LLVector3& visible_color) +{ + // Unoccluded bone portions + LLGLDepthTest normal_depth(GL_TRUE); + + // Draw line segment for unoccluded joint + gGL.diffuseColor3f(visible_color[0], visible_color[1], visible_color[2]); + + gGL.begin(LLRender::LINES); + gGL.vertex3fv(begin_pos.mV); + gGL.vertex3fv(end_pos.mV); + gGL.end(); + + + // Draw sphere representing joint pos + gGL.pushMatrix(); + gGL.scalef(sphere_scale, sphere_scale, sphere_scale); + gSphere.renderGGL(); + gGL.popMatrix(); + + LLGLDepthTest depth_under(GL_TRUE, GL_FALSE, GL_GREATER); + + // Occluded bone portions + gGL.diffuseColor3f(occ_color[0], occ_color[1], occ_color[2]); + + gGL.begin(LLRender::LINES); + gGL.vertex3fv(begin_pos.mV); + gGL.vertex3fv(end_pos.mV); + gGL.end(); + + // Draw sphere representing joint pos + gGL.pushMatrix(); + gGL.scalef(sphere_scale, sphere_scale, sphere_scale); + gSphere.renderGGL(); + gGL.popMatrix(); +} + //----------------------------------------------------------------------------- // renderCollisionVolumes() //----------------------------------------------------------------------------- @@ -1348,10 +1386,36 @@ void LLVOAvatar::renderCollisionVolumes() std::ostringstream ostr; for (S32 i = 0; i < mNumCollisionVolumes; i++) { - mCollisionVolumes[i].renderCollision(); + //mCollisionVolumes[i].renderCollision(); ostr << mCollisionVolumes[i].getName() << ", "; } + for (S32 i = 0; i < mNumCollisionVolumes; i++) + { + LLAvatarJointCollisionVolume& collision_volume = mCollisionVolumes[i]; + + collision_volume.updateWorldMatrix(); + + gGL.pushMatrix(); + gGL.multMatrix( &collision_volume.getXform()->getWorldMatrix().mMatrix[0][0] ); + + LLVector3 begin_pos(0,0,0); + LLVector3 end_pos(collision_volume.getEnd()); + static F32 sphere_scale = 1.0f; + static F32 center_dot_scale = 0.05f; + + static LLVector3 CV_COLOR_OCCLUDED(0.0f, 0.0f, 1.0f); + static LLVector3 CV_COLOR_VISIBLE(0.5f, 0.5f, 1.0f); + static LLVector3 DOT_COLOR_OCCLUDED(1.0f, 1.0f, 1.0f); + static LLVector3 DOT_COLOR_VISIBLE(1.0f, 1.0f, 1.0f); + + render_sphere_and_line(begin_pos, end_pos, sphere_scale, CV_COLOR_OCCLUDED, CV_COLOR_VISIBLE); + render_sphere_and_line(begin_pos, end_pos, center_dot_scale, DOT_COLOR_OCCLUDED, DOT_COLOR_VISIBLE); + + gGL.popMatrix(); + } + + if (mNameText.notNull()) { LLVector4a unused; @@ -1374,6 +1438,13 @@ void LLVOAvatar::renderBones() avatar_joint_list_t::iterator iter = mSkeleton.begin(); avatar_joint_list_t::iterator end = mSkeleton.end(); + static LLVector3 BASE_COLOR_OCCLUDED(1.0f, 0.0f, 0.0f); + static LLVector3 BASE_COLOR_VISIBLE(0.5f, 0.5f, 0.5f); + static LLVector3 EXTENDED_COLOR_OCCLUDED(0.0f, 1.0f, 0.0f); + static LLVector3 EXTENDED_COLOR_VISIBLE(0.5f, 0.5f, 0.5f); + + static F32 SPHERE_SCALEF = 0.003f; + for (; iter != end; ++iter) { LLJoint* jointp = *iter; @@ -1386,52 +1457,28 @@ void LLVOAvatar::renderBones() jointp->updateWorldMatrix(); LLJoint::SupportCategory sc = jointp->getSupport(); + LLVector3 occ_color, visible_color; - gGL.pushMatrix(); - gGL.multMatrix( &jointp->getXform()->getWorldMatrix().mMatrix[0][0] ); - - gGL.begin(LLRender::LINES); - - LLVector3 v[] = - { - LLVector3(0,0,0), - LLVector3(0,0,0), - }; - v[1] = jointp->getEnd(); - - LLGLDepthTest normal_depth(GL_TRUE); - - // Unoccluded bone portions if (sc == LLJoint::SUPPORT_BASE) { - gGL.diffuseColor3f( 1.0f, 0.5f, 0.5f ); + occ_color = BASE_COLOR_OCCLUDED; + visible_color = BASE_COLOR_VISIBLE; } else { - gGL.diffuseColor3f( 0.5f, 1.0f, 0.5f ); + occ_color = EXTENDED_COLOR_OCCLUDED; + visible_color = EXTENDED_COLOR_VISIBLE; } - - - gGL.vertex3fv(v[0].mV); - gGL.vertex3fv(v[1].mV); - - LLGLDepthTest depth_under(GL_TRUE, GL_FALSE, GL_GREATER); + LLVector3 begin_pos(0,0,0); + LLVector3 end_pos(jointp->getEnd()); - // Unoccluded bone portions - if (sc == LLJoint::SUPPORT_BASE) - { - gGL.diffuseColor3f( 1.0f, 0.0f, 0.0f ); - } - else - { - gGL.diffuseColor3f( 0.0f, 1.0f, 0.0f ); - } - - gGL.vertex3fv(v[0].mV); - gGL.vertex3fv(v[1].mV); - - gGL.end(); + F32 sphere_scale = SPHERE_SCALEF; + + gGL.pushMatrix(); + gGL.multMatrix( &jointp->getXform()->getWorldMatrix().mMatrix[0][0] ); + render_sphere_and_line(begin_pos, end_pos, sphere_scale, occ_color, visible_color); + gGL.popMatrix(); } -- cgit v1.2.3 From 80b010b199f3a915cab7654ff3eed5b6d7a66e75 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 26 Feb 2016 16:54:00 -0500 Subject: SL-109 WIP - minor code cleanup --- indra/newview/llvoavatar.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 84d585df02..a8cc797f16 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1384,14 +1384,11 @@ void render_sphere_and_line(const LLVector3& begin_pos, const LLVector3& end_pos void LLVOAvatar::renderCollisionVolumes() { std::ostringstream ostr; + for (S32 i = 0; i < mNumCollisionVolumes; i++) { - //mCollisionVolumes[i].renderCollision(); ostr << mCollisionVolumes[i].getName() << ", "; - } - for (S32 i = 0; i < mNumCollisionVolumes; i++) - { LLAvatarJointCollisionVolume& collision_volume = mCollisionVolumes[i]; collision_volume.updateWorldMatrix(); -- cgit v1.2.3 From 88cb6814f0883cdce15ca1942409da708ab07af5 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 7 Mar 2016 11:24:48 -0500 Subject: SL-315 WIP - more call stack tracing, initial hooks for avatar reset skeleton option. --- indra/newview/llvoavatar.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a8cc797f16..204432dc16 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1801,6 +1801,13 @@ void LLVOAvatar::buildCharacter() mMeshValid = TRUE; } +//----------------------------------------------------------------------------- +// resetSkeleton() +//----------------------------------------------------------------------------- +void LLVOAvatar::resetSkeleton() +{ + LL_DEBUGS("Avatar") << avString() << LL_ENDL; +} //----------------------------------------------------------------------------- // releaseMeshData() -- cgit v1.2.3 From d56533609431b213810928d204e3720fecd42b82 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 8 Mar 2016 11:30:31 -0500 Subject: SL-344.xml - avatar_lad.xml updates. During loading, error out if an attachment_point references an invalid parent. --- indra/newview/llvoavatar.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 204432dc16..4d6f0f78b2 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5521,17 +5521,14 @@ BOOL LLVOAvatar::loadSkeletonNode () LLJoint *parent_joint = getJoint(info->mJointName); if (!parent_joint) { - // If the intended location for attachment point is unavailable, stick it in a default location. - LL_INFOS() << "attachment pt " << info->mName << " using mPelvis as default parent" << LL_ENDL; - parent_joint = getJoint("mPelvis"); - } - if (!parent_joint) - { + // If the intended parent for attachment point is unavailable, avatar_lad.xml is corrupt. LL_WARNS() << "No parent joint by name " << info->mJointName << " found for attachment point " << info->mName << LL_ENDL; - delete attachment; - continue; - } - + LL_ERRS() << "Invalid avatar_lad.xml file" << LL_ENDL; + // If we wanted to continue from this case, we could do: + //delete attachment; + //continue; + // but there's no point. + } if (info->mHasPosition) { attachment->setOriginalPosition(info->mPosition); -- cgit v1.2.3 From 05bd94268d99a34b4f4b1556e3088cbf134034f9 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 10 Mar 2016 10:12:25 -0500 Subject: SL-315 - wip on joint reset --- indra/newview/llvoavatar.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 4d6f0f78b2..9bee4380eb 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1807,6 +1807,27 @@ void LLVOAvatar::buildCharacter() void LLVOAvatar::resetSkeleton() { LL_DEBUGS("Avatar") << avString() << LL_ENDL; + + // Reset params + for (LLVisualParam *param = getFirstVisualParam(); + param; + param = getNextVisualParam()) + { + if (param->isAnimating()) + { + continue; + } + param->setLastWeight(param->getDefaultWeight()); + } + + // Reset all bones and collision volumes to their initial skeleton state. + if( !buildSkeleton(sAvatarSkeletonInfo) ) + { + LL_ERRS() << "Error resetting skeleton" << LL_ENDL; + } + + // Apply params + updateVisualParams(); } //----------------------------------------------------------------------------- -- cgit v1.2.3 From 6e6b247fbe9fb951aa452c1abc0a1b2d38a01756 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 10 Mar 2016 10:50:11 -0500 Subject: SL-315 - avatar XML dump now includes all joints --- indra/newview/llvoavatar.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9bee4380eb..2b588ea0ac 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -8026,6 +8026,7 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara } } + // Bones avatar_joint_list_t::iterator iter = mSkeleton.begin(); avatar_joint_list_t::iterator end = mSkeleton.end(); for (; iter != end; ++iter) @@ -8033,10 +8034,33 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara LLJoint* pJoint = (*iter); const LLVector3& pos = pJoint->getPosition(); const LLVector3& scale = pJoint->getScale(); - apr_file_printf( file, "\t\t\n", + apr_file_printf( file, "\t\t\n", pJoint->getName().c_str(), pos[0], pos[1], pos[2], scale[0], scale[1], scale[2]); } + // Collision volumes + for (S32 i = 0; i < mNumCollisionVolumes; i++) + { + LLAvatarJointCollisionVolume* pJoint = &mCollisionVolumes[i]; + const LLVector3& pos = pJoint->getPosition(); + const LLVector3& scale = pJoint->getScale(); + apr_file_printf( file, "\t\t\n", + pJoint->getName().c_str(), pos[0], pos[1], pos[2], scale[0], scale[1], scale[2]); + } + + // Attachment joints + for (LLVOAvatar::attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); ++iter) + { + LLViewerJointAttachment* pJoint = iter->second; + if (!pJoint) continue; + const LLVector3& pos = pJoint->getPosition(); + const LLVector3& scale = pJoint->getScale(); + apr_file_printf( file, "\t\t\n", + pJoint->getName().c_str(), pos[0], pos[1], pos[2], scale[0], scale[1], scale[2]); + } + + // Joint pos overrides for (iter = mSkeleton.begin(); iter != end; ++iter) { LLJoint* pJoint = (*iter); -- cgit v1.2.3 From 11c9853197312af135a9d7960ee125fc41c423b8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 13 Apr 2016 09:31:23 -0400 Subject: SL-109 - reduced size of the spheres in 'show bones' display, to make it easier to see what's going on in crowded parts of the skeleton. --- indra/newview/llvoavatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 2f0f377c40..d3ea864800 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1440,7 +1440,7 @@ void LLVOAvatar::renderBones() static LLVector3 EXTENDED_COLOR_OCCLUDED(0.0f, 1.0f, 0.0f); static LLVector3 EXTENDED_COLOR_VISIBLE(0.5f, 0.5f, 0.5f); - static F32 SPHERE_SCALEF = 0.003f; + static F32 SPHERE_SCALEF = 0.001f; for (; iter != end; ++iter) { -- cgit v1.2.3 From 223f0907092966e595890830be76ddf77776e123 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 18 Apr 2016 19:31:29 -0400 Subject: SL-371 - more tracking on partial joint overrides --- indra/newview/llvoavatar.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index d3ea864800..a82f92b01a 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5339,6 +5339,49 @@ void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo) { postPelvisSetRecalc(); } + + showAttachmentPosOverrides(); +} + +//----------------------------------------------------------------------------- +// showAttachmentPosOverrides +//----------------------------------------------------------------------------- +void LLVOAvatar::showAttachmentPosOverrides() const +{ + LLVector3 pos; + LLUUID mesh_id; + S32 count = 0; + + // Bones + for (avatar_joint_list_t::const_iterator iter = mSkeleton.begin(); + iter != mSkeleton.end(); ++iter) + { + const LLJoint* pJoint = (*iter); + if (pJoint && pJoint->hasAttachmentPosOverride(pos,mesh_id)) + { + pJoint->showAttachmentPosOverrides(getFullname()); + count++; + } + } + + // Attachment points + for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); + ++iter) + { + const LLViewerJointAttachment *attachment_pt = (*iter).second; + if (attachment_pt && attachment_pt->hasAttachmentPosOverride(pos,mesh_id)) + { + attachment_pt->showAttachmentPosOverrides(getFullname()); + count++; + } + } + + if (count) + { + LL_DEBUGS("Avatar") << avString() << " end of pos overrides" << LL_ENDL; + LL_DEBUGS("Avatar") << "=================================" << LL_ENDL; + } } //----------------------------------------------------------------------------- @@ -5553,6 +5596,7 @@ BOOL LLVOAvatar::loadSkeletonNode () if (info->mHasPosition) { attachment->setOriginalPosition(info->mPosition); + attachment->setDefaultPosition(info->mPosition); } if (info->mHasRotation) -- cgit v1.2.3 From 0447fe5a57c2b3e0406fd28b665ea9f47d689b2f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 20 Apr 2016 13:18:56 -0400 Subject: SL-371 - increased the limit for StackWalker strings, avoid crashing if mesh has wrong number of mAlternateBindMatrix matrices --- indra/newview/llvoavatar.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a82f92b01a..af10af98f2 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5299,9 +5299,13 @@ void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo) if ( vobj && vobj->isAttachment() && vobj->isMesh() && pSkinData ) { const int bindCnt = pSkinData->mAlternateBindMatrix.size(); - if ( bindCnt > 0 ) + const int jointCnt = pSkinData->mJointNames.size(); + if ((bindCnt > 0) && (bindCnt != jointCnt)) + { + LL_WARNS_ONCE() << "invalid mesh, bindCnt " << bindCnt << "!= jointCnt " << jointCnt << ", joint overrides will be ignored." << LL_ENDL; + } + if ((bindCnt > 0) && (bindCnt == jointCnt)) { - const int jointCnt = pSkinData->mJointNames.size(); const F32 pelvisZOffset = pSkinData->mPelvisOffset; const LLUUID& mesh_id = pSkinData->mMeshID; bool fullRig = (jointCnt>=JOINT_COUNT_REQUIRED_FOR_FULLRIG) ? true : false; -- cgit v1.2.3 From 2f346d6b328bd8367ed1c1e689c0db582be13f35 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 21 Apr 2016 17:00:58 -0400 Subject: SL-314 - show bones now colorizes rigged-to joints a different color. Also removed what I think is some redundancy in calculating attachment pos overrides. If it breaks I'll change it back. --- indra/newview/llvoavatar.cpp | 105 +++++++++++++++++++++++++++++++++---------- 1 file changed, 82 insertions(+), 23 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index af10af98f2..b5cf9a6ba3 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1426,12 +1426,8 @@ void LLVOAvatar::renderCollisionVolumes() void LLVOAvatar::renderBones() { - LLGLEnable blend(GL_BLEND); - std::ostringstream ostr; - std::ostringstream nullstr; - avatar_joint_list_t::iterator iter = mSkeleton.begin(); avatar_joint_list_t::iterator end = mSkeleton.end(); @@ -1439,6 +1435,8 @@ void LLVOAvatar::renderBones() static LLVector3 BASE_COLOR_VISIBLE(0.5f, 0.5f, 0.5f); static LLVector3 EXTENDED_COLOR_OCCLUDED(0.0f, 1.0f, 0.0f); static LLVector3 EXTENDED_COLOR_VISIBLE(0.5f, 0.5f, 0.5f); + static LLVector3 RIGGED_COLOR_OCCLUDED(0.0f, 1.0f, 1.0f); + static LLVector3 RIGGED_COLOR_VISIBLE(0.5f, 0.5f, 0.5f); static F32 SPHERE_SCALEF = 0.001f; @@ -1450,21 +1448,27 @@ void LLVOAvatar::renderBones() continue; } - ostr << jointp->getName() << ", "; - jointp->updateWorldMatrix(); LLJoint::SupportCategory sc = jointp->getSupport(); LLVector3 occ_color, visible_color; - if (sc == LLJoint::SUPPORT_BASE) + if (jointIsRiggedTo(jointp->getName())) { - occ_color = BASE_COLOR_OCCLUDED; - visible_color = BASE_COLOR_VISIBLE; + occ_color = RIGGED_COLOR_OCCLUDED; + visible_color = RIGGED_COLOR_VISIBLE; } else { - occ_color = EXTENDED_COLOR_OCCLUDED; - visible_color = EXTENDED_COLOR_VISIBLE; + if (sc == LLJoint::SUPPORT_BASE) + { + occ_color = BASE_COLOR_OCCLUDED; + visible_color = BASE_COLOR_VISIBLE; + } + else + { + occ_color = EXTENDED_COLOR_OCCLUDED; + visible_color = EXTENDED_COLOR_VISIBLE; + } } LLVector3 begin_pos(0,0,0); LLVector3 end_pos(jointp->getEnd()); @@ -1478,10 +1482,6 @@ void LLVOAvatar::renderBones() gGL.popMatrix(); } - - mDebugText.clear(); - addDebugText(ostr.str()); - addDebugText(nullstr.str()); } @@ -5241,6 +5241,62 @@ bool LLVOAvatar::getRiggedMeshID(LLViewerObject* pVO, LLUUID& mesh_id) return false; } +bool LLVOAvatar::jointIsRiggedTo(const std::string& joint_name) +{ + for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); + ++iter) + { + LLViewerJointAttachment* attachment = iter->second; + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); + attachment_iter != attachment->mAttachedObjects.end(); + ++attachment_iter) + { + const LLViewerObject* attached_object = (*attachment_iter); + if (attached_object && jointIsRiggedTo(joint_name, attached_object)) + { + return true; + } + } + } + return false; +} + +bool LLVOAvatar::jointIsRiggedTo(const std::string& joint_name, const LLViewerObject *vo) +{ + // Process all children + LLViewerObject::const_child_list_t& children = vo->getChildren(); + for (LLViewerObject::const_child_list_t::const_iterator it = children.begin(); + it != children.end(); ++it) + { + LLViewerObject *childp = *it; + if (jointIsRiggedTo(joint_name,childp)) + { + return true; + } + } + + const LLVOVolume *vobj = dynamic_cast(vo); + if (!vobj) + { + return false; + } + + LLUUID currentId = vobj->getVolume()->getParams().getSculptID(); + const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( currentId, vobj ); + + if ( vobj && vobj->isAttachment() && vobj->isMesh() && pSkinData ) + { + if (std::find(pSkinData->mJointNames.begin(), pSkinData->mJointNames.end(), joint_name) != + pSkinData->mJointNames.end()) + { + return true; + } + } + + return false; +} + void LLVOAvatar::clearAttachmentPosOverrides() { LLScopedContextString str("clearAttachmentPosOverrides " + getFullname()); @@ -5319,14 +5375,17 @@ void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo) { pJoint->setId( currentId ); const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation(); - //Set the joint position - pJoint->addAttachmentPosOverride( jointPos, mesh_id, avString() ); - - //If joint is a pelvis then handle old/new pelvis to foot values - if ( lookingForJoint == "mPelvis" ) - { - pelvisGotSet = true; - } + if (!jointPos.isNull()) + { + //Set the joint position + pJoint->addAttachmentPosOverride( jointPos, mesh_id, avString() ); + + //If joint is a pelvis then handle old/new pelvis to foot values + if ( lookingForJoint == "mPelvis" ) + { + pelvisGotSet = true; + } + } } } if (pelvisZOffset != 0.0F) -- cgit v1.2.3 From cad96c6d86445f8a0996bc786db6fe225bf3a175 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 21 Apr 2016 17:53:30 -0400 Subject: SL-371 - removed magic-offset check, for now. --- indra/newview/llvoavatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index b5cf9a6ba3..5f030435dc 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5375,7 +5375,7 @@ void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo) { pJoint->setId( currentId ); const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation(); - if (!jointPos.isNull()) + //if (!jointPos.isNull()) { //Set the joint position pJoint->addAttachmentPosOverride( jointPos, mesh_id, avString() ); -- cgit v1.2.3 From e769e76cd3975ea0a936df1130f0b60b592438a4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Sat, 23 Apr 2016 07:36:42 -0400 Subject: SL-375 - ignore joint position overrides if they are equivalent to the default position. --- indra/newview/llvoavatar.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 5f030435dc..e6df4f4fd1 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5375,7 +5375,12 @@ void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo) { pJoint->setId( currentId ); const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation(); - //if (!jointPos.isNull()) + if ((jointPos-pJoint->getDefaultPosition()).isNull()) + { + LL_DEBUGS("Avatar") << "Attachment pos override ignored for " << pJoint->getName() + << ", pos " << jointPos << " is same as default pos" << LL_ENDL; + } + else { //Set the joint position pJoint->addAttachmentPosOverride( jointPos, mesh_id, avString() ); -- cgit v1.2.3 From 041433483ad64c399ffcdf95906eb8e83109ba75 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 26 Apr 2016 17:07:04 -0400 Subject: SL-375 - tolerance and debug output tweaks --- indra/newview/llvoavatar.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e6df4f4fd1..9bfb402b03 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5315,6 +5315,13 @@ void LLVOAvatar::clearAttachmentPosOverrides() } } +bool above_joint_pos_threshold(const LLVector3& diff) +{ + return !diff.isNull(); + //const F32 max_joint_pos_offset = 0.0001f; // 0.1 mm + //return diff.lengthSquared() > max_joint_pos_offset * max_joint_pos_offset; +} + //----------------------------------------------------------------------------- // addAttachmentPosOverridesForObject //----------------------------------------------------------------------------- @@ -5375,7 +5382,7 @@ void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo) { pJoint->setId( currentId ); const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation(); - if ((jointPos-pJoint->getDefaultPosition()).isNull()) + if (!above_joint_pos_threshold(jointPos-pJoint->getDefaultPosition())) { LL_DEBUGS("Avatar") << "Attachment pos override ignored for " << pJoint->getName() << ", pos " << jointPos << " is same as default pos" << LL_ENDL; @@ -5408,7 +5415,10 @@ void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo) postPelvisSetRecalc(); } - showAttachmentPosOverrides(); + if (isSelf()) + { + showAttachmentPosOverrides(); + } } //----------------------------------------------------------------------------- -- cgit v1.2.3 From d1a14cda3470e1f1b95442e39e0f0294c2e67cff Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 27 Apr 2016 14:39:30 -0400 Subject: SL-375 - pos = default pos threshold is now 0.1 mm --- indra/newview/llvoavatar.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9bfb402b03..08c0d9a116 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5317,9 +5317,9 @@ void LLVOAvatar::clearAttachmentPosOverrides() bool above_joint_pos_threshold(const LLVector3& diff) { - return !diff.isNull(); - //const F32 max_joint_pos_offset = 0.0001f; // 0.1 mm - //return diff.lengthSquared() > max_joint_pos_offset * max_joint_pos_offset; + //return !diff.isNull(); + const F32 max_joint_pos_offset = 0.0001f; // 0.1 mm + return diff.lengthSquared() > max_joint_pos_offset * max_joint_pos_offset; } //----------------------------------------------------------------------------- -- cgit v1.2.3 From f3fb80c9479c14b8c9afc8794b053fcf74957f77 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 27 Apr 2016 17:19:09 -0400 Subject: SL-344 - fixed a problem in avatar_lad with some params in wrong group, added diagnostics to make this easier to detect. --- indra/newview/llvoavatar.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 08c0d9a116..5d77b1238a 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7391,9 +7391,10 @@ void dump_visual_param(apr_file_t* file, LLVisualParam* viewer_param, F32 value) wtype = vparam->getWearableType(); } S32 u8_value = F32_to_U8(value,viewer_param->getMinWeight(),viewer_param->getMaxWeight()); - apr_file_printf(file, "\t\t\n", + apr_file_printf(file, "\t\t\n", viewer_param->getID(), viewer_param->getName().c_str(), value, u8_value, type_string.c_str(), - LLWearableType::getTypeName(LLWearableType::EType(wtype)).c_str() + LLWearableType::getTypeName(LLWearableType::EType(wtype)).c_str(), + viewer_param->getGroup() // param_location_name(vparam->getParamLocation()).c_str() ); } -- cgit v1.2.3 From ec471497f5dba41e74afc6864ab0f7100659e1d9 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 29 Apr 2016 11:25:17 -0400 Subject: SL-375, SL-378 - rudimentary logging info to list joint offsets during mesh import. dae_tool.py work to enable joint offset tweaking. --- indra/newview/llvoavatar.cpp | 85 ++++++++++++++++++++++++++++++-------------- 1 file changed, 58 insertions(+), 27 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 5d77b1238a..679ea88a44 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5315,13 +5315,6 @@ void LLVOAvatar::clearAttachmentPosOverrides() } } -bool above_joint_pos_threshold(const LLVector3& diff) -{ - //return !diff.isNull(); - const F32 max_joint_pos_offset = 0.0001f; // 0.1 mm - return diff.lengthSquared() > max_joint_pos_offset * max_joint_pos_offset; -} - //----------------------------------------------------------------------------- // addAttachmentPosOverridesForObject //----------------------------------------------------------------------------- @@ -5382,22 +5375,14 @@ void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo) { pJoint->setId( currentId ); const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation(); - if (!above_joint_pos_threshold(jointPos-pJoint->getDefaultPosition())) - { - LL_DEBUGS("Avatar") << "Attachment pos override ignored for " << pJoint->getName() - << ", pos " << jointPos << " is same as default pos" << LL_ENDL; - } - else - { - //Set the joint position - pJoint->addAttachmentPosOverride( jointPos, mesh_id, avString() ); + //Set the joint position + pJoint->addAttachmentPosOverride( jointPos, mesh_id, avString() ); - //If joint is a pelvis then handle old/new pelvis to foot values - if ( lookingForJoint == "mPelvis" ) - { - pelvisGotSet = true; - } - } + //If joint is a pelvis then handle old/new pelvis to foot values + if ( lookingForJoint == "mPelvis" ) + { + pelvisGotSet = true; + } } } if (pelvisZOffset != 0.0F) @@ -5414,22 +5399,68 @@ void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo) { postPelvisSetRecalc(); } +} - if (isSelf()) - { - showAttachmentPosOverrides(); +//----------------------------------------------------------------------------- +// getAttachmentOverrideNames +//----------------------------------------------------------------------------- +void LLVOAvatar::getAttachmentOverrideNames(std::set& names) const +{ + LLVector3 pos; + LLUUID mesh_id; + + // Bones + for (avatar_joint_list_t::const_iterator iter = mSkeleton.begin(); + iter != mSkeleton.end(); ++iter) + { + const LLJoint* pJoint = (*iter); + if (pJoint && pJoint->hasAttachmentPosOverride(pos,mesh_id)) + { + names.insert(pJoint->getName()); + } + } + + // Attachment points + for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); + ++iter) + { + const LLViewerJointAttachment *attachment_pt = (*iter).second; + if (attachment_pt && attachment_pt->hasAttachmentPosOverride(pos,mesh_id)) + { + names.insert(attachment_pt->getName()); + } } + } //----------------------------------------------------------------------------- // showAttachmentPosOverrides //----------------------------------------------------------------------------- -void LLVOAvatar::showAttachmentPosOverrides() const +void LLVOAvatar::showAttachmentPosOverrides(bool verbose) const { + std::set joint_names; + getAttachmentOverrideNames(joint_names); + if (joint_names.size()) + { + std::stringstream ss; + std::copy(joint_names.begin(), joint_names.end(), std::ostream_iterator(ss, ",")); + LL_INFOS() << getFullname() << " attachment positions defined for joints: " << ss.str() << "\n" << LL_ENDL; + } + else + { + LL_INFOS() << getFullname() << " no attachment positions defined for any joints" << "\n" << LL_ENDL; + } + + if (!verbose) + { + return; + } + LLVector3 pos; LLUUID mesh_id; S32 count = 0; - + // Bones for (avatar_joint_list_t::const_iterator iter = mSkeleton.begin(); iter != mSkeleton.end(); ++iter) -- cgit v1.2.3 From e0cb5438a5055c71191c6ae6b27c7dee63e40562 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 6 May 2016 10:17:56 -0400 Subject: SL-315 - notes on resetSkeleton() --- indra/newview/llvoavatar.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 679ea88a44..d44c7f56f2 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1808,16 +1808,24 @@ void LLVOAvatar::resetSkeleton() { LL_DEBUGS("Avatar") << avString() << LL_ENDL; - // Reset params + // Stop all animations + + // Clear all attachment pos overrides + + // Preserve state of tweakable params + + // Reset all params to default state, without propagating changes downstream. for (LLVisualParam *param = getFirstVisualParam(); param; param = getNextVisualParam()) { +#if 0 if (param->isAnimating()) { continue; } param->setLastWeight(param->getDefaultWeight()); +#endif } // Reset all bones and collision volumes to their initial skeleton state. @@ -1826,8 +1834,15 @@ void LLVOAvatar::resetSkeleton() LL_ERRS() << "Error resetting skeleton" << LL_ENDL; } + // Reset tweakable params to preserved state // Apply params +#if 0 updateVisualParams(); +#endif + + // Restore attachment pos overrides + + // Restart animations } //----------------------------------------------------------------------------- -- cgit v1.2.3 From 184a5fd82be3a4969ac6547367d1aad458129461 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 9 May 2016 10:25:30 -0400 Subject: SL-315 - resetSkeleton() work, dae_tool.py can add random joint positions to models --- indra/newview/llvoavatar.cpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 979bf96151..22df9c43d7 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1811,6 +1811,7 @@ void LLVOAvatar::resetSkeleton() // Stop all animations // Clear all attachment pos overrides + clearAttachmentPosOverrides(); // Preserve state of tweakable params @@ -1841,6 +1842,7 @@ void LLVOAvatar::resetSkeleton() #endif // Restore attachment pos overrides + rebuildAttachmentPosOverrides(); // Restart animations } @@ -5328,8 +5330,43 @@ void LLVOAvatar::clearAttachmentPosOverrides() pJoint->clearAttachmentPosOverrides(); } } + + // Attachment points + for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); + ++iter) + { + LLViewerJointAttachment *attachment_pt = (*iter).second; + if (attachment_pt) + { + attachment_pt->clearAttachmentPosOverrides(); + } + } } +//----------------------------------------------------------------------------- +// rebuildAttachmentPosOverrides +//----------------------------------------------------------------------------- +void LLVOAvatar::rebuildAttachmentPosOverrides() +{ + LLScopedContextString str("rebuildAttachmentPosOverrides " + getFullname()); + + // Attachment points + for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); + ++iter) + { + LLViewerJointAttachment *attachment_pt = (*iter).second; + if (attachment_pt) + { + for (LLViewerJointAttachment::attachedobjs_vec_t::iterator at_it = attachment_pt->mAttachedObjects.begin(); + at_it != attachment_pt->mAttachedObjects.end(); ++at_it) + { + addAttachmentPosOverridesForObject(*at_it); + } + } + } +} //----------------------------------------------------------------------------- // addAttachmentPosOverridesForObject //----------------------------------------------------------------------------- -- cgit v1.2.3 From 41bdfe07bba897aa3217c760b3539f8b7288bab5 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 10 May 2016 16:15:24 -0400 Subject: SL-315 - resetSkeleton() work including attachment points, reapplying appearance message values. --- indra/newview/llvoavatar.cpp | 233 ++++++++++++++++++++++++------------------- 1 file changed, 132 insertions(+), 101 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 22df9c43d7..37c5e84347 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -216,7 +216,7 @@ struct LLTextureMaskData **/ -struct LLAppearanceMessageContents +struct LLAppearanceMessageContents: public LLRefCount { LLAppearanceMessageContents(): mAppearanceVersion(-1), @@ -1804,42 +1804,55 @@ void LLVOAvatar::buildCharacter() //----------------------------------------------------------------------------- // resetSkeleton() //----------------------------------------------------------------------------- -void LLVOAvatar::resetSkeleton() +void LLVOAvatar::resetVisualParams() { - LL_DEBUGS("Avatar") << avString() << LL_ENDL; - - // Stop all animations - - // Clear all attachment pos overrides - clearAttachmentPosOverrides(); - - // Preserve state of tweakable params - - // Reset all params to default state, without propagating changes downstream. +#if 0 for (LLVisualParam *param = getFirstVisualParam(); param; param = getNextVisualParam()) { -#if 0 if (param->isAnimating()) { continue; } param->setLastWeight(param->getDefaultWeight()); -#endif } +#endif +} + +//----------------------------------------------------------------------------- +// resetSkeleton() +//----------------------------------------------------------------------------- +void LLVOAvatar::resetSkeleton() +{ + LL_DEBUGS("Avatar") << avString() << LL_ENDL; + if (!mLastProcessedAppearance) + { + LL_WARNS() << "Can't reset avatar; no appearance message has been received yet." << LL_ENDL; + return; + } + + // Stop all animations + + // Clear all attachment pos overrides + clearAttachmentPosOverrides(); + + // Reset all params to default state, without propagating changes downstream. + resetVisualParams(); // Reset all bones and collision volumes to their initial skeleton state. if( !buildSkeleton(sAvatarSkeletonInfo) ) { LL_ERRS() << "Error resetting skeleton" << LL_ENDL; } + // Reset attachment points + bool ignore_hud_joints = true; + initAttachmentPoints(ignore_hud_joints); // Reset tweakable params to preserved state // Apply params -#if 0 + applyParsedAppearanceMessage(*mLastProcessedAppearance); updateVisualParams(); -#endif // Restore attachment pos overrides rebuildAttachmentPosOverrides(); @@ -5728,87 +5741,99 @@ BOOL LLVOAvatar::loadSkeletonNode () return FALSE; } - // ATTACHMENTS - { - LLAvatarXmlInfo::attachment_info_list_t::iterator iter; - for (iter = sAvatarXmlInfo->mAttachmentInfoList.begin(); - iter != sAvatarXmlInfo->mAttachmentInfoList.end(); - ++iter) - { - LLAvatarXmlInfo::LLAvatarAttachmentInfo *info = *iter; - if (!isSelf() && info->mJointName == "mScreen") - { //don't process screen joint for other avatars - continue; - } + bool ignore_hud_joints = false; + initAttachmentPoints(ignore_hud_joints); - LLViewerJointAttachment* attachment = new LLViewerJointAttachment(); - attachment->setName(info->mName); - LLJoint *parent_joint = getJoint(info->mJointName); - if (!parent_joint) - { - // If the intended parent for attachment point is unavailable, avatar_lad.xml is corrupt. - LL_WARNS() << "No parent joint by name " << info->mJointName << " found for attachment point " << info->mName << LL_ENDL; - LL_ERRS() << "Invalid avatar_lad.xml file" << LL_ENDL; - // If we wanted to continue from this case, we could do: - //delete attachment; - //continue; - // but there's no point. - } - if (info->mHasPosition) - { - attachment->setOriginalPosition(info->mPosition); - attachment->setDefaultPosition(info->mPosition); - } - - if (info->mHasRotation) - { - LLQuaternion rotation; - rotation.setQuat(info->mRotationEuler.mV[VX] * DEG_TO_RAD, - info->mRotationEuler.mV[VY] * DEG_TO_RAD, - info->mRotationEuler.mV[VZ] * DEG_TO_RAD); - attachment->setRotation(rotation); - } + return TRUE; +} - int group = info->mGroup; - if (group >= 0) - { - if (group < 0 || group > 9) - { - LL_WARNS() << "Invalid group number (" << group << ") for attachment point " << info->mName << LL_ENDL; - } - else - { - attachment->setGroup(group); - } - } +//----------------------------------------------------------------------------- +// initAttachmentPoints(): creates attachment points if needed, sets state based on avatar_lad.xml. +//----------------------------------------------------------------------------- +void LLVOAvatar::initAttachmentPoints(bool ignore_hud_joints) +{ + LLAvatarXmlInfo::attachment_info_list_t::iterator iter; + for (iter = sAvatarXmlInfo->mAttachmentInfoList.begin(); + iter != sAvatarXmlInfo->mAttachmentInfoList.end(); + ++iter) + { + LLAvatarXmlInfo::LLAvatarAttachmentInfo *info = *iter; + if (info->mIsHUDAttachment && (!isSelf() || ignore_hud_joints)) + { + //don't process hud joint for other avatars, or when doing a skeleton reset. + continue; + } - S32 attachmentID = info->mAttachmentID; - if (attachmentID < 1 || attachmentID > 255) - { - LL_WARNS() << "Attachment point out of range [1-255]: " << attachmentID << " on attachment point " << info->mName << LL_ENDL; - delete attachment; - continue; - } - if (mAttachmentPoints.find(attachmentID) != mAttachmentPoints.end()) - { - LL_WARNS() << "Attachment point redefined with id " << attachmentID << " on attachment point " << info->mName << LL_ENDL; - delete attachment; - continue; - } + S32 attachmentID = info->mAttachmentID; + if (attachmentID < 1 || attachmentID > 255) + { + LL_WARNS() << "Attachment point out of range [1-255]: " << attachmentID << " on attachment point " << info->mName << LL_ENDL; + continue; + } - attachment->setPieSlice(info->mPieMenuSlice); - attachment->setVisibleInFirstPerson(info->mVisibleFirstPerson); - attachment->setIsHUDAttachment(info->mIsHUDAttachment); - // attachment can potentially be animated, needs a number. - attachment->setJointNum(mSkeleton.size() + attachmentID -1); - mAttachmentPoints[attachmentID] = attachment; + LLViewerJointAttachment* attachment = NULL; + bool newly_created = false; + if (mAttachmentPoints.find(attachmentID) == mAttachmentPoints.end()) + { + attachment = new LLViewerJointAttachment(); + newly_created = true; + } + else + { + attachment = mAttachmentPoints[attachmentID]; + } - // now add attachment joint - parent_joint->addChild(attachment); - } - } + attachment->setName(info->mName); + LLJoint *parent_joint = getJoint(info->mJointName); + if (!parent_joint) + { + // If the intended parent for attachment point is unavailable, avatar_lad.xml is corrupt. + LL_WARNS() << "No parent joint by name " << info->mJointName << " found for attachment point " << info->mName << LL_ENDL; + LL_ERRS() << "Invalid avatar_lad.xml file" << LL_ENDL; + } - return TRUE; + if (info->mHasPosition) + { + attachment->setOriginalPosition(info->mPosition); + attachment->setDefaultPosition(info->mPosition); + } + + if (info->mHasRotation) + { + LLQuaternion rotation; + rotation.setQuat(info->mRotationEuler.mV[VX] * DEG_TO_RAD, + info->mRotationEuler.mV[VY] * DEG_TO_RAD, + info->mRotationEuler.mV[VZ] * DEG_TO_RAD); + attachment->setRotation(rotation); + } + + int group = info->mGroup; + if (group >= 0) + { + if (group < 0 || group > 9) + { + LL_WARNS() << "Invalid group number (" << group << ") for attachment point " << info->mName << LL_ENDL; + } + else + { + attachment->setGroup(group); + } + } + + attachment->setPieSlice(info->mPieMenuSlice); + attachment->setVisibleInFirstPerson(info->mVisibleFirstPerson); + attachment->setIsHUDAttachment(info->mIsHUDAttachment); + // attachment can potentially be animated, needs a number. + attachment->setJointNum(mSkeleton.size() + attachmentID - 1); + + if (newly_created) + { + mAttachmentPoints[attachmentID] = attachment; + + // now add attachment joint + parent_joint->addChild(attachment); + } + } } //----------------------------------------------------------------------------- @@ -7679,17 +7704,15 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) mLastAppearanceMessageTimer.reset(); - ESex old_sex = getSex(); - - LLAppearanceMessageContents contents; - parseAppearanceMessage(mesgsys, contents); + LLPointer contents(new LLAppearanceMessageContents); + parseAppearanceMessage(mesgsys, *contents); if (enable_verbose_dumps) { - dumpAppearanceMsgParams(dump_prefix + "appearance_msg", contents); + dumpAppearanceMsgParams(dump_prefix + "appearance_msg", *contents); } S32 appearance_version; - if (!resolve_appearance_version(contents, appearance_version)) + if (!resolve_appearance_version(*contents, appearance_version)) { LL_WARNS() << "bad appearance version info, discarding" << LL_ENDL; return; @@ -7701,7 +7724,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) return; } - S32 this_update_cof_version = contents.mCOFVersion; + S32 this_update_cof_version = contents->mCOFVersion; S32 last_update_request_cof_version = mLastUpdateRequestCOFVersion; if( isSelf() ) @@ -7740,7 +7763,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } // SUNSHINE CLEANUP - is this case OK now? - S32 num_params = contents.mParamWeights.size(); + S32 num_params = contents->mParamWeights.size(); if (num_params <= 1) { // In this case, we have no reliable basis for knowing @@ -7759,7 +7782,16 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) // assumes that cof version is only updated with server-bake // appearance messages. mLastUpdateReceivedCOFVersion = this_update_cof_version; - + mLastProcessedAppearance = contents; + + applyParsedAppearanceMessage(*contents); +} + +void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& contents) +{ + S32 num_params = contents.mParamWeights.size(); + ESex old_sex = getSex(); + applyParsedTEMessage(contents.mTEContents); // prevent the overwriting of valid baked textures with invalid baked textures @@ -7900,7 +7932,6 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } updateMeshTextures(); - //if (enable_verbose_dumps) dumpArchetypeXML(dump_prefix + "process_end"); } // static -- 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/newview/llvoavatar.cpp | 48 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 7 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 37c5e84347..e82f24a069 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1802,22 +1802,56 @@ void LLVOAvatar::buildCharacter() } //----------------------------------------------------------------------------- -// resetSkeleton() +// resetVisualParams() //----------------------------------------------------------------------------- void LLVOAvatar::resetVisualParams() { + // SKELETAL DISTORTIONS + { + LLAvatarXmlInfo::skeletal_distortion_info_list_t::iterator iter; + for (iter = sAvatarXmlInfo->mSkeletalDistortionInfoList.begin(); + iter != sAvatarXmlInfo->mSkeletalDistortionInfoList.end(); + ++iter) + { + LLPolySkeletalDistortionInfo *info = (LLPolySkeletalDistortionInfo*)*iter; + LLPolySkeletalDistortion *param = dynamic_cast(getVisualParam(info->getID())); + *param = LLPolySkeletalDistortion(this); + llassert(param); + if (!param->setInfo(info)) + { + llassert(false); + } + } + } #if 0 - for (LLVisualParam *param = getFirstVisualParam(); - param; - param = getNextVisualParam()) + // avatar_lad.xml : + for (LLAvatarXmlInfo::driver_info_list_t::iterator iter = sAvatarXmlInfo->mDriverInfoList.begin(); + iter != sAvatarXmlInfo->mDriverInfoList.end(); + ++iter) { - if (param->isAnimating()) + LLDriverParamInfo *info = *iter; + LLDriverParam* driver_param = new LLDriverParam( this ); + if (driver_param->setInfo(info)) { - continue; + addVisualParam( driver_param ); + driver_param->setParamLocation(isSelf() ? LOC_AV_SELF : LOC_AV_OTHER); + LLVisualParam*(LLAvatarAppearance::*avatar_function)(S32)const = &LLAvatarAppearance::getVisualParam; + if( !driver_param->linkDrivenParams(boost::bind(avatar_function,(LLAvatarAppearance*)this,_1 ), false)) + { + LL_WARNS() << "could not link driven params for avatar " << getID().asString() << " param id: " << driver_param->getID() << LL_ENDL; + continue; + } + } + else + { + delete driver_param; + LL_WARNS() << "avatar file: driver_param->parseData() failed" << LL_ENDL; + return FALSE; } - param->setLastWeight(param->getDefaultWeight()); } #endif + + } //----------------------------------------------------------------------------- -- cgit v1.2.3 From d0dea44c010ec4e747b139ce55013e3203ba980a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 12 May 2016 10:57:08 -0400 Subject: SL-315 - resetSkeleton(). Still some small scale discrepancies, visually pretty good. --- indra/newview/llvoavatar.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e82f24a069..9286a70886 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1859,7 +1859,7 @@ void LLVOAvatar::resetVisualParams() //----------------------------------------------------------------------------- void LLVOAvatar::resetSkeleton() { - LL_DEBUGS("Avatar") << avString() << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << " reset starts" << LL_ENDL; if (!mLastProcessedAppearance) { LL_WARNS() << "Can't reset avatar; no appearance message has been received yet." << LL_ENDL; @@ -1883,15 +1883,34 @@ void LLVOAvatar::resetSkeleton() bool ignore_hud_joints = true; initAttachmentPoints(ignore_hud_joints); + // Fix up collision volumes + for (LLVisualParam *param = getFirstVisualParam(); + param; + param = getNextVisualParam()) + { + LLPolyMorphTarget *poly_morph = dynamic_cast(param); + if (poly_morph) + { + // This is a kludgy way to correct for the fact that the + // collision volumes have been reset out from under the + // poly morph sliders. + F32 delta_weight = poly_morph->getLastWeight() - poly_morph->getDefaultWeight(); + poly_morph->applyVolumeChanges(delta_weight); + } + } + // Reset tweakable params to preserved state // Apply params applyParsedAppearanceMessage(*mLastProcessedAppearance); + updateVisualParams(); // Restore attachment pos overrides rebuildAttachmentPosOverrides(); // Restart animations + + LL_DEBUGS("Avatar") << avString() << " reset ends" << LL_ENDL; } //----------------------------------------------------------------------------- -- cgit v1.2.3 From 82111ecbde4bacd4cbd5ae5d076876d0ddedd04d Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 17 May 2016 16:06:27 -0400 Subject: SL-315 - resetSkeleton() fixes, mostly to get better behavior with non-self avs --- indra/newview/llvoavatar.cpp | 49 +++++++++++++++++--------------------------- 1 file changed, 19 insertions(+), 30 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9286a70886..23008839ee 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1806,7 +1806,7 @@ void LLVOAvatar::buildCharacter() //----------------------------------------------------------------------------- void LLVOAvatar::resetVisualParams() { - // SKELETAL DISTORTIONS + // Skeletal params { LLAvatarXmlInfo::skeletal_distortion_info_list_t::iterator iter; for (iter = sAvatarXmlInfo->mSkeletalDistortionInfoList.begin(); @@ -1823,35 +1823,23 @@ void LLVOAvatar::resetVisualParams() } } } -#if 0 - // avatar_lad.xml : + + // Driver parameters for (LLAvatarXmlInfo::driver_info_list_t::iterator iter = sAvatarXmlInfo->mDriverInfoList.begin(); iter != sAvatarXmlInfo->mDriverInfoList.end(); ++iter) { LLDriverParamInfo *info = *iter; - LLDriverParam* driver_param = new LLDriverParam( this ); - if (driver_param->setInfo(info)) - { - addVisualParam( driver_param ); - driver_param->setParamLocation(isSelf() ? LOC_AV_SELF : LOC_AV_OTHER); - LLVisualParam*(LLAvatarAppearance::*avatar_function)(S32)const = &LLAvatarAppearance::getVisualParam; - if( !driver_param->linkDrivenParams(boost::bind(avatar_function,(LLAvatarAppearance*)this,_1 ), false)) - { - LL_WARNS() << "could not link driven params for avatar " << getID().asString() << " param id: " << driver_param->getID() << LL_ENDL; - continue; - } - } - else - { - delete driver_param; - LL_WARNS() << "avatar file: driver_param->parseData() failed" << LL_ENDL; - return FALSE; - } + LLDriverParam *param = dynamic_cast(getVisualParam(info->getID())); + LLDriverParam::entry_list_t driven_list = param->getDrivenList(); + *param = LLDriverParam(this); + llassert(param); + if (!param->setInfo(info)) + { + llassert(false); + } + param->setDrivenList(driven_list); } -#endif - - } //----------------------------------------------------------------------------- @@ -1871,7 +1859,7 @@ void LLVOAvatar::resetSkeleton() // Clear all attachment pos overrides clearAttachmentPosOverrides(); - // Reset all params to default state, without propagating changes downstream. + // Reset some params to default state, without propagating changes downstream. resetVisualParams(); // Reset all bones and collision volumes to their initial skeleton state. @@ -1900,8 +1888,8 @@ void LLVOAvatar::resetSkeleton() } // Reset tweakable params to preserved state - // Apply params - applyParsedAppearanceMessage(*mLastProcessedAppearance); + bool slam_params = true; + applyParsedAppearanceMessage(*mLastProcessedAppearance, slam_params); updateVisualParams(); @@ -7837,10 +7825,11 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) mLastUpdateReceivedCOFVersion = this_update_cof_version; mLastProcessedAppearance = contents; - applyParsedAppearanceMessage(*contents); + bool slam_params = false; + applyParsedAppearanceMessage(*contents, slam_params); } -void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& contents) +void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& contents, bool slam_params) { S32 num_params = contents.mParamWeights.size(); ESex old_sex = getSex(); @@ -7900,7 +7889,7 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte params_changed = TRUE; params_changed_count++; - if(is_first_appearance_message) + if(is_first_appearance_message || slam_params) { //LL_DEBUGS("Avatar") << "param slam " << i << " " << newWeight << LL_ENDL; param->setWeight(newWeight); -- 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/newview/llvoavatar.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 23008839ee..fb7b7d3ef8 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1854,20 +1854,30 @@ void LLVOAvatar::resetSkeleton() return; } - // Stop all animations - // Clear all attachment pos overrides clearAttachmentPosOverrides(); + // Note that we call buildSkeleton twice in this function. The first time is + // just to get the right scale for the collision volumes, because + // this will be used in setting the mJointScales for the + // LLPolySkeletalDistortions of which the CVs are children. + if( !buildSkeleton(sAvatarSkeletonInfo) ) + { + LL_ERRS() << "Error resetting skeleton" << LL_ENDL; + } + // Reset some params to default state, without propagating changes downstream. resetVisualParams(); - // Reset all bones and collision volumes to their initial skeleton state. + // Now we have to reset the skeleton again, because its state + // got clobbered by the resetVisualParams() calls + // above. if( !buildSkeleton(sAvatarSkeletonInfo) ) { LL_ERRS() << "Error resetting skeleton" << LL_ENDL; } - // Reset attachment points + + // Reset attachment points (buildSkeleton only does bones and CVs) bool ignore_hud_joints = true; initAttachmentPoints(ignore_hud_joints); @@ -1897,6 +1907,7 @@ void LLVOAvatar::resetSkeleton() rebuildAttachmentPosOverrides(); // Restart animations + resetAnimations(); LL_DEBUGS("Avatar") << avString() << " reset ends" << LL_ENDL; } -- cgit v1.2.3 From 7a7973c6a25c8a2ba08969b11f93a2c701051855 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 25 May 2016 16:40:08 -0400 Subject: SL-315 - arche_tool.py updates, resetSkeleton() now preserves mPelvis state, forces all params to be updated. --- indra/newview/llvoavatar.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 0728509bcd..25565715c2 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1851,6 +1851,10 @@ void LLVOAvatar::resetSkeleton() return; } + // Save mPelvis state + LLVector3 pelvis_pos = getJoint("mPelvis")->getPosition(); + LLQuaternion pelvis_rot = getJoint("mPelvis")->getRotation(); + // Clear all attachment pos overrides clearAttachmentPosOverrides(); @@ -1903,6 +1907,10 @@ void LLVOAvatar::resetSkeleton() // Restore attachment pos overrides rebuildAttachmentPosOverrides(); + // Restore mPelvis state + getJoint("mPelvis")->setRotation(pelvis_rot); + getJoint("mPelvis")->setPosition(pelvis_pos); + // Restart animations resetAnimations(); @@ -7855,7 +7863,7 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte LLVisualParam* param = contents.mParams[i]; F32 newWeight = contents.mParamWeights[i]; - if (is_first_appearance_message || (param->getWeight() != newWeight)) + if (slam_params || is_first_appearance_message || (param->getWeight() != newWeight)) { params_changed = TRUE; params_changed_count++; -- cgit v1.2.3 From b5f4eab65bf458db9247562fd0b265687259890e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 26 May 2016 12:52:09 -0400 Subject: SL-117, SL-315 - resetSkeleton() tweaks, additional validation of skeleton file --- indra/newview/llvoavatar.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 25565715c2..0423f0e380 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1852,8 +1852,8 @@ void LLVOAvatar::resetSkeleton() } // Save mPelvis state - LLVector3 pelvis_pos = getJoint("mPelvis")->getPosition(); - LLQuaternion pelvis_rot = getJoint("mPelvis")->getRotation(); + //LLVector3 pelvis_pos = getJoint("mPelvis")->getPosition(); + //LLQuaternion pelvis_rot = getJoint("mPelvis")->getRotation(); // Clear all attachment pos overrides clearAttachmentPosOverrides(); @@ -1908,11 +1908,14 @@ void LLVOAvatar::resetSkeleton() rebuildAttachmentPosOverrides(); // Restore mPelvis state - getJoint("mPelvis")->setRotation(pelvis_rot); - getJoint("mPelvis")->setPosition(pelvis_pos); + //getJoint("mPelvis")->setRotation(pelvis_rot); + //getJoint("mPelvis")->setPosition(pelvis_pos); - // Restart animations - resetAnimations(); + // Restart animations BENTO - not needed? Removing this fixes a + // problem seen if avatar is sitting and animated relative to sit + // point. + + //resetAnimations(); LL_DEBUGS("Avatar") << avString() << " reset ends" << LL_ENDL; } -- 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/newview/llvoavatar.cpp | 107 ++++++++++++++++++++++++++++++------------- 1 file changed, 76 insertions(+), 31 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 0423f0e380..94d54a0660 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1855,8 +1855,8 @@ void LLVOAvatar::resetSkeleton() //LLVector3 pelvis_pos = getJoint("mPelvis")->getPosition(); //LLQuaternion pelvis_rot = getJoint("mPelvis")->getRotation(); - // Clear all attachment pos overrides - clearAttachmentPosOverrides(); + // Clear all attachment pos and scale overrides + clearAttachmentOverrides(); // Note that we call buildSkeleton twice in this function. The first time is // just to get the right scale for the collision volumes, because @@ -1905,7 +1905,7 @@ void LLVOAvatar::resetSkeleton() updateVisualParams(); // Restore attachment pos overrides - rebuildAttachmentPosOverrides(); + rebuildAttachmentOverrides(); // Restore mPelvis state //getJoint("mPelvis")->setRotation(pelvis_rot); @@ -5338,9 +5338,9 @@ bool LLVOAvatar::jointIsRiggedTo(const std::string& joint_name, const LLViewerOb return false; } -void LLVOAvatar::clearAttachmentPosOverrides() +void LLVOAvatar::clearAttachmentOverrides() { - LLScopedContextString str("clearAttachmentPosOverrides " + getFullname()); + LLScopedContextString str("clearAttachmentOverrides " + getFullname()); //Subsequent joints are relative to pelvis avatar_joint_list_t::iterator iter = mSkeleton.begin(); @@ -5353,6 +5353,10 @@ void LLVOAvatar::clearAttachmentPosOverrides() { pJoint->clearAttachmentPosOverrides(); } + if (pJoint) + { + pJoint->clearAttachmentScaleOverrides(); + } } // Attachment points @@ -5369,11 +5373,11 @@ void LLVOAvatar::clearAttachmentPosOverrides() } //----------------------------------------------------------------------------- -// rebuildAttachmentPosOverrides +// rebuildAttachmentOverrides //----------------------------------------------------------------------------- -void LLVOAvatar::rebuildAttachmentPosOverrides() +void LLVOAvatar::rebuildAttachmentOverrides() { - LLScopedContextString str("rebuildAttachmentPosOverrides " + getFullname()); + LLScopedContextString str("rebuildAttachmentOverrides " + getFullname()); // Attachment points for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); @@ -5386,7 +5390,7 @@ void LLVOAvatar::rebuildAttachmentPosOverrides() for (LLViewerJointAttachment::attachedobjs_vec_t::iterator at_it = attachment_pt->mAttachedObjects.begin(); at_it != attachment_pt->mAttachedObjects.end(); ++at_it) { - addAttachmentPosOverridesForObject(*at_it); + addAttachmentOverridesForObject(*at_it); } } } @@ -5394,7 +5398,7 @@ void LLVOAvatar::rebuildAttachmentPosOverrides() //----------------------------------------------------------------------------- // addAttachmentPosOverridesForObject //----------------------------------------------------------------------------- -void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo) +void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo) { LLVOAvatar *av = vo->getAvatarAncestor(); if (!av || (av != this)) @@ -5402,7 +5406,7 @@ void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo) LL_WARNS("Avatar") << "called with invalid avatar" << LL_ENDL; } - LLScopedContextString str("addAttachmentPosOverridesForObject " + av->getFullname()); + LLScopedContextString str("addAttachmentOverridesForObject " + av->getFullname()); // Process all children LLViewerObject::const_child_list_t& children = vo->getChildren(); @@ -5410,7 +5414,7 @@ void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo) it != children.end(); ++it) { LLViewerObject *childp = *it; - addAttachmentPosOverridesForObject(childp); + addAttachmentOverridesForObject(childp); } LLVOVolume *vobj = dynamic_cast(vo); @@ -5453,7 +5457,7 @@ void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo) const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation(); //Set the joint position pJoint->addAttachmentPosOverride( jointPos, mesh_id, avString() ); - + //If joint is a pelvis then handle old/new pelvis to foot values if ( lookingForJoint == "mPelvis" ) { @@ -5468,6 +5472,25 @@ void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo) } } } + // Set the joint scales + // FIXME replace with real logic for finding scale, probably inside the bindcnt loop above + const LLUUID& mesh_id = pSkinData->mMeshID; + for (int i = 0; i < jointCnt; ++i) + { + std::string lookingForJoint = pSkinData->mJointNames[i].c_str(); + LLJoint* pJoint = getJoint(lookingForJoint); + if (pJoint) + { + if (pJoint->getName() == "mCollarRight" || + pJoint->getName() == "mShoulderRight" || + pJoint->getName() == "mElbowRight" || + pJoint->getName() == "mHandRight") + { + LLVector3 jointScale(2.0f, 2.0f, 2.0f); + pJoint->addAttachmentScaleOverride(jointScale, mesh_id, avString()); + } + } + } } //Rebuild body data if we altered joints/pelvis @@ -5480,9 +5503,10 @@ void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo) //----------------------------------------------------------------------------- // getAttachmentOverrideNames //----------------------------------------------------------------------------- -void LLVOAvatar::getAttachmentOverrideNames(std::set& names) const +void LLVOAvatar::getAttachmentOverrideNames(std::set& pos_names, std::set& scale_names) const { LLVector3 pos; + LLVector3 scale; LLUUID mesh_id; // Bones @@ -5492,7 +5516,11 @@ void LLVOAvatar::getAttachmentOverrideNames(std::set& names) const const LLJoint* pJoint = (*iter); if (pJoint && pJoint->hasAttachmentPosOverride(pos,mesh_id)) { - names.insert(pJoint->getName()); + pos_names.insert(pJoint->getName()); + } + if (pJoint && pJoint->hasAttachmentScaleOverride(scale,mesh_id)) + { + scale_names.insert(pJoint->getName()); } } @@ -5504,36 +5532,47 @@ void LLVOAvatar::getAttachmentOverrideNames(std::set& names) const const LLViewerJointAttachment *attachment_pt = (*iter).second; if (attachment_pt && attachment_pt->hasAttachmentPosOverride(pos,mesh_id)) { - names.insert(attachment_pt->getName()); + pos_names.insert(attachment_pt->getName()); } + // Attachment points don't have scales. } } //----------------------------------------------------------------------------- -// showAttachmentPosOverrides +// showAttachmentOverrides //----------------------------------------------------------------------------- -void LLVOAvatar::showAttachmentPosOverrides(bool verbose) const +void LLVOAvatar::showAttachmentOverrides(bool verbose) const { - std::set joint_names; - getAttachmentOverrideNames(joint_names); - if (joint_names.size()) + std::set pos_names, scale_names; + getAttachmentOverrideNames(pos_names, scale_names); + if (pos_names.size()) { std::stringstream ss; - std::copy(joint_names.begin(), joint_names.end(), std::ostream_iterator(ss, ",")); + std::copy(pos_names.begin(), pos_names.end(), std::ostream_iterator(ss, ",")); LL_INFOS() << getFullname() << " attachment positions defined for joints: " << ss.str() << "\n" << LL_ENDL; } else { LL_INFOS() << getFullname() << " no attachment positions defined for any joints" << "\n" << LL_ENDL; } + if (scale_names.size()) + { + std::stringstream ss; + std::copy(scale_names.begin(), scale_names.end(), std::ostream_iterator(ss, ",")); + LL_INFOS() << getFullname() << " attachment scales defined for joints: " << ss.str() << "\n" << LL_ENDL; + } + else + { + LL_INFOS() << getFullname() << " no attachment scales defined for any joints" << "\n" << LL_ENDL; + } if (!verbose) { return; } - LLVector3 pos; + LLVector3 pos, scale; LLUUID mesh_id; S32 count = 0; @@ -5547,6 +5586,11 @@ void LLVOAvatar::showAttachmentPosOverrides(bool verbose) const pJoint->showAttachmentPosOverrides(getFullname()); count++; } + if (pJoint && pJoint->hasAttachmentScaleOverride(scale,mesh_id)) + { + pJoint->showAttachmentScaleOverrides(getFullname()); + count++; + } } // Attachment points @@ -5564,15 +5608,15 @@ void LLVOAvatar::showAttachmentPosOverrides(bool verbose) const if (count) { - LL_DEBUGS("Avatar") << avString() << " end of pos overrides" << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << " end of pos, scale overrides" << LL_ENDL; LL_DEBUGS("Avatar") << "=================================" << LL_ENDL; } } //----------------------------------------------------------------------------- -// resetJointPositionsOnDetach +// resetJointsOnDetach //----------------------------------------------------------------------------- -void LLVOAvatar::resetJointPositionsOnDetach(LLViewerObject *vo) +void LLVOAvatar::resetJointsOnDetach(LLViewerObject *vo) { LLVOAvatar *av = vo->getAvatarAncestor(); if (!av || (av != this)) @@ -5586,21 +5630,21 @@ void LLVOAvatar::resetJointPositionsOnDetach(LLViewerObject *vo) it != children.end(); ++it) { LLViewerObject *childp = *it; - resetJointPositionsOnDetach(childp); + resetJointsOnDetach(childp); } // Process self. LLUUID mesh_id; if (getRiggedMeshID(vo,mesh_id)) { - resetJointPositionsOnDetach(mesh_id); + resetJointsOnDetach(mesh_id); } } //----------------------------------------------------------------------------- -// resetJointPositionsOnDetach +// resetJointsOnDetach //----------------------------------------------------------------------------- -void LLVOAvatar::resetJointPositionsOnDetach(const LLUUID& mesh_id) +void LLVOAvatar::resetJointsOnDetach(const LLUUID& mesh_id) { //Subsequent joints are relative to pelvis avatar_joint_list_t::iterator iter = mSkeleton.begin(); @@ -5616,6 +5660,7 @@ void LLVOAvatar::resetJointPositionsOnDetach(const LLUUID& mesh_id) { pJoint->setId( LLUUID::null ); pJoint->removeAttachmentPosOverride(mesh_id, avString()); + pJoint->removeAttachmentScaleOverride(mesh_id, avString()); } if ( pJoint && pJoint == pJointPelvis) { @@ -6316,7 +6361,7 @@ void LLVOAvatar::cleanupAttachedMesh( LLViewerObject* pVO ) LLUUID mesh_id; if (getRiggedMeshID(pVO, mesh_id)) { - resetJointPositionsOnDetach(mesh_id); + resetJointsOnDetach(mesh_id); if ( gAgentCamera.cameraCustomizeAvatar() ) { gAgent.unpauseAnimation(); -- cgit v1.2.3 From c978542a068578091eb43cab024bd929f0eaaedd Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 7 Jun 2016 15:06:49 -0400 Subject: MAINT-6484 - make the attachment pos updates a bit smarter, so we don't flag the pelvis has having changed unless it has actually changed. Avoid excess calls to computeBodySize(), which can cause a vertical position glitch. --- indra/newview/llvoavatar.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 0423f0e380..137d172c14 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5452,19 +5452,29 @@ void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo) pJoint->setId( currentId ); const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation(); //Set the joint position + LLUUID curr_mesh_id; + LLVector3 curr_joint_pos; + if (!pJoint->hasAttachmentPosOverride( curr_joint_pos, curr_mesh_id ) || + curr_joint_pos != jointPos) + { + //If joint is a pelvis then handle old/new pelvis to foot values + if ( lookingForJoint == "mPelvis" ) + { + pelvisGotSet = true; + } + } pJoint->addAttachmentPosOverride( jointPos, mesh_id, avString() ); - //If joint is a pelvis then handle old/new pelvis to foot values - if ( lookingForJoint == "mPelvis" ) - { - pelvisGotSet = true; - } } } if (pelvisZOffset != 0.0F) { + F32 curr_pelvis_fixup; + if (!hasPelvisFixup(curr_pelvis_fixup) || (curr_pelvis_fixup != pelvisZOffset)) + { + pelvisGotSet = true; + } addPelvisFixup( pelvisZOffset, mesh_id ); - pelvisGotSet = true; } } } -- cgit v1.2.3 From 593d925831c6f2210db3a387db21277940ac06b0 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 7 Jun 2016 15:47:18 -0400 Subject: MAINT-6484 - more on pelvis update detection when attachments get updated. --- indra/newview/llvoavatar.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 137d172c14..7a3a72d789 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5453,9 +5453,15 @@ void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo) const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation(); //Set the joint position LLUUID curr_mesh_id; - LLVector3 curr_joint_pos; - if (!pJoint->hasAttachmentPosOverride( curr_joint_pos, curr_mesh_id ) || - curr_joint_pos != jointPos) + LLVector3 joint_pos_before; + bool has_pos_before = pJoint->hasAttachmentPosOverride( joint_pos_before, curr_mesh_id ); + + pJoint->addAttachmentPosOverride( jointPos, mesh_id, avString() ); + + LLVector3 joint_pos_after; + pJoint->hasAttachmentPosOverride( joint_pos_after, curr_mesh_id ); + + if (!has_pos_before || joint_pos_before != joint_pos_after) { //If joint is a pelvis then handle old/new pelvis to foot values if ( lookingForJoint == "mPelvis" ) @@ -5463,18 +5469,21 @@ void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo) pelvisGotSet = true; } } - pJoint->addAttachmentPosOverride( jointPos, mesh_id, avString() ); } } if (pelvisZOffset != 0.0F) { - F32 curr_pelvis_fixup; - if (!hasPelvisFixup(curr_pelvis_fixup) || (curr_pelvis_fixup != pelvisZOffset)) + F32 pelvis_fixup_before; + bool has_fixup_before = hasPelvisFixup(pelvis_fixup_before); + addPelvisFixup( pelvisZOffset, mesh_id ); + F32 pelvis_fixup_after; + hasPelvisFixup(pelvis_fixup_after); // Don't have to check bool here because we just added it... + if (!has_fixup_before || (pelvis_fixup_before != pelvis_fixup_after)) { pelvisGotSet = true; } - addPelvisFixup( pelvisZOffset, mesh_id ); + } } } -- cgit v1.2.3 From d2302886bc132f5afe96612c8f13702775f0a303 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 15 Jun 2016 15:24:54 -0400 Subject: MAINT-6380, SL-399 - vertical flicker related to joint offsets for mPelvis. Having a joint offset for mPelvis is still a bad idea, but it won't cause as much flickering now. --- indra/newview/llvoavatar.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7a3a72d789..0448fc6138 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5451,17 +5451,11 @@ void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo) { pJoint->setId( currentId ); const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation(); - //Set the joint position - LLUUID curr_mesh_id; - LLVector3 joint_pos_before; - bool has_pos_before = pJoint->hasAttachmentPosOverride( joint_pos_before, curr_mesh_id ); - pJoint->addAttachmentPosOverride( jointPos, mesh_id, avString() ); + bool override_changed; + pJoint->addAttachmentPosOverride( jointPos, mesh_id, avString(), override_changed ); - LLVector3 joint_pos_after; - pJoint->hasAttachmentPosOverride( joint_pos_after, curr_mesh_id ); - - if (!has_pos_before || joint_pos_before != joint_pos_after) + if (override_changed) { //If joint is a pelvis then handle old/new pelvis to foot values if ( lookingForJoint == "mPelvis" ) @@ -5633,8 +5627,9 @@ void LLVOAvatar::resetJointPositionsOnDetach(const LLUUID& mesh_id) //Reset joints except for pelvis if ( pJoint ) { + bool dummy; // unused pJoint->setId( LLUUID::null ); - pJoint->removeAttachmentPosOverride(mesh_id, avString()); + pJoint->removeAttachmentPosOverride(mesh_id, avString(), dummy); } if ( pJoint && pJoint == pJointPelvis) { -- 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/newview/llvoavatar.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 0448fc6138..340f19c39e 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1907,16 +1907,6 @@ void LLVOAvatar::resetSkeleton() // Restore attachment pos overrides rebuildAttachmentPosOverrides(); - // Restore mPelvis state - //getJoint("mPelvis")->setRotation(pelvis_rot); - //getJoint("mPelvis")->setPosition(pelvis_pos); - - // Restart animations BENTO - not needed? Removing this fixes a - // problem seen if avatar is sitting and animated relative to sit - // point. - - //resetAnimations(); - LL_DEBUGS("Avatar") << avString() << " reset ends" << LL_ENDL; } -- 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/newview/llvoavatar.cpp | 88 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 87 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 340f19c39e..734f3287b3 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3913,13 +3913,90 @@ void LLVOAvatar::updateHeadOffset() mHeadOffset = lerp(midEyePt, mHeadOffset, u); } } + +void LLVOAvatar::debugBodySize() const +{ + LLVector3 pelvis_scale = mPelvisp->getScale(); + + // some of the joints have not been cached + LLVector3 skull = mSkullp->getPosition(); + LL_DEBUGS("Avatar") << "skull pos " << skull << LL_ENDL; + //LLVector3 skull_scale = mSkullp->getScale(); + + LLVector3 neck = mNeckp->getPosition(); + LLVector3 neck_scale = mNeckp->getScale(); + LL_DEBUGS("Avatar") << "neck pos " << neck << " neck_scale " << neck_scale << LL_ENDL; + + LLVector3 chest = mChestp->getPosition(); + LLVector3 chest_scale = mChestp->getScale(); + LL_DEBUGS("Avatar") << "chest pos " << chest << " chest_scale " << chest_scale << LL_ENDL; + + // the rest of the joints have been cached + LLVector3 head = mHeadp->getPosition(); + LLVector3 head_scale = mHeadp->getScale(); + LL_DEBUGS("Avatar") << "head pos " << head << " head_scale " << head_scale << LL_ENDL; + + LLVector3 torso = mTorsop->getPosition(); + LLVector3 torso_scale = mTorsop->getScale(); + LL_DEBUGS("Avatar") << "torso pos " << torso << " torso_scale " << torso_scale << LL_ENDL; + + LLVector3 hip = mHipLeftp->getPosition(); + LLVector3 hip_scale = mHipLeftp->getScale(); + LL_DEBUGS("Avatar") << "hip pos " << hip << " hip_scale " << hip_scale << LL_ENDL; + + LLVector3 knee = mKneeLeftp->getPosition(); + LLVector3 knee_scale = mKneeLeftp->getScale(); + LL_DEBUGS("Avatar") << "knee pos " << knee << " knee_scale " << knee_scale << LL_ENDL; + + LLVector3 ankle = mAnkleLeftp->getPosition(); + LLVector3 ankle_scale = mAnkleLeftp->getScale(); + LL_DEBUGS("Avatar") << "ankle pos " << ankle << " ankle_scale " << ankle_scale << LL_ENDL; + + LLVector3 foot = mFootLeftp->getPosition(); + LL_DEBUGS("Avatar") << "foot pos " << foot << LL_ENDL; + + F32 new_offset = (const_cast(this))->getVisualParamWeight(AVATAR_HOVER); + LL_DEBUGS("Avatar") << "new_offset " << new_offset << LL_ENDL; + + F32 new_pelvis_to_foot = hip.mV[VZ] * pelvis_scale.mV[VZ] - + knee.mV[VZ] * hip_scale.mV[VZ] - + ankle.mV[VZ] * knee_scale.mV[VZ] - + foot.mV[VZ] * ankle_scale.mV[VZ]; + LL_DEBUGS("Avatar") << "new_pelvis_to_foot " << new_pelvis_to_foot << LL_ENDL; + + LLVector3 new_body_size; + new_body_size.mV[VZ] = new_pelvis_to_foot + + // the sqrt(2) correction below is an approximate + // correction to get to the top of the head + F_SQRT2 * (skull.mV[VZ] * head_scale.mV[VZ]) + + head.mV[VZ] * neck_scale.mV[VZ] + + neck.mV[VZ] * chest_scale.mV[VZ] + + chest.mV[VZ] * torso_scale.mV[VZ] + + torso.mV[VZ] * pelvis_scale.mV[VZ]; + + // TODO -- measure the real depth and width + new_body_size.mV[VX] = DEFAULT_AGENT_DEPTH; + new_body_size.mV[VY] = DEFAULT_AGENT_WIDTH; + + LL_DEBUGS("Avatar") << "new_body_size " << new_body_size << LL_ENDL; +} + //------------------------------------------------------------------------ // postPelvisSetRecalc //------------------------------------------------------------------------ -void LLVOAvatar::postPelvisSetRecalc( void ) +void LLVOAvatar::postPelvisSetRecalc() { mRoot->updateWorldMatrixChildren(); + // BENTO extra tracing around computeBodySize() + LLVector3 body_size = mBodySize; + LLVector3 avatar_offset = mAvatarOffset; computeBodySize(); + if (mBodySize != body_size || mAvatarOffset != avatar_offset) + { + debugBodySize(); + LL_DEBUGS("Avatar") << avString() << "old mBodySize " << body_size << " old mAvatarOffset " << avatar_offset << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << "new mBodySize " << mBodySize << " new mAvatarOffset " << mAvatarOffset << LL_ENDL; + } dirtyMesh(2); } //------------------------------------------------------------------------ @@ -5862,7 +5939,16 @@ void LLVOAvatar::updateVisualParams() if (mLastSkeletonSerialNum != mSkeletonSerialNum) { + // BENTO extra tracing around computeBodySize() + LLVector3 body_size = mBodySize; + LLVector3 avatar_offset = mAvatarOffset; computeBodySize(); + if (mBodySize != body_size || mAvatarOffset != avatar_offset) + { + debugBodySize(); + LL_DEBUGS("Avatar") << avString() << "old mBodySize " << body_size << " old mAvatarOffset " << avatar_offset << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << "new mBodySize " << mBodySize << " new mAvatarOffset " << mAvatarOffset << LL_ENDL; + } mLastSkeletonSerialNum = mSkeletonSerialNum; mRoot->updateWorldMatrixChildren(); } -- cgit v1.2.3 From 99250b4e0c26e20d9162ab10d999827f006da256 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 1 Jul 2016 15:12:55 -0400 Subject: SL-402 - more avatar height tracing in debug text --- indra/newview/llvoavatar.cpp | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 734f3287b3..11b6fec96e 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3346,23 +3346,31 @@ void LLVOAvatar::updateDebugText() { debug_line += llformat(" - cof rcv:%d", last_received_cof_version); } - debug_line += llformat(" bsz-z: %f avofs-z: %f", mBodySize[2], mAvatarOffset[2]); + debug_line += llformat(" bsz-z: %.3f", mBodySize[2]); + if (mAvatarOffset[2] != 0.0f) + { + debug_line += llformat("avofs-z: %.3f", mAvatarOffset[2]); + } bool hover_enabled = getRegion() && getRegion()->avatarHoverHeightEnabled(); debug_line += hover_enabled ? " H" : " h"; const LLVector3& hover_offset = getHoverOffset(); if (hover_offset[2] != 0.0) { - debug_line += llformat(" hov_z: %f", hover_offset[2]); + debug_line += llformat(" hov_z: %.3f", hover_offset[2]); debug_line += llformat(" %s", (mIsSitting ? "S" : "T")); debug_line += llformat("%s", (isMotionActive(ANIM_AGENT_SIT_GROUND_CONSTRAINED) ? "G" : "-")); } - F32 elapsed = mLastAppearanceMessageTimer.getElapsedTimeF32(); - static const char *elapsed_chars = "Xx*..."; - U32 bucket = U32(elapsed*2); - if (bucket < strlen(elapsed_chars)) - { - debug_line += llformat(" %c", elapsed_chars[bucket]); - } + LLVector3 ankle_right_pos_agent = mFootRightp->getWorldPosition(); + LLVector3 normal; + LLVector3 ankle_right_ground_agent = ankle_right_pos_agent; + resolveHeightAgent(ankle_right_pos_agent, ankle_right_ground_agent, normal); + F32 rightElev = llmax(-0.2f, ankle_right_pos_agent.mV[VZ] - ankle_right_ground_agent.mV[VZ]); + debug_line += llformat(" relev %.3f", rightElev); + + LLVector3 root_pos = mRoot->getPosition(); + LLVector3 pelvis_pos = mPelvisp->getPosition(); + debug_line += llformat(" rp %.3f pp %.3f", root_pos[2], pelvis_pos[2]); + addDebugText(debug_line); } if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked")) -- cgit v1.2.3 From 3bc8a974400bccc05d05984adb103f98c43c86ab Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 5 Jul 2016 14:42:47 -0400 Subject: SL-402 - update mBodySize more frequently to avoid inconsistent vertical positioning of avatar. --- indra/newview/llvoavatar.cpp | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 11b6fec96e..e3eff15815 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3596,6 +3596,12 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) } mInAir = in_air; + // SL-402: with the ability to animate the position of joints + // that affect the body size calculation, computed body size + // can get stale much more easily. Simplest fix is to update + // it frequently. + computeBodySize(); + // correct for the fact that the pelvis is not necessarily the center // of the agent's physical representation root_pos.mdV[VZ] -= (0.5f * mBodySize.mV[VZ]) - mPelvisToFoot; @@ -3995,16 +4001,7 @@ void LLVOAvatar::debugBodySize() const void LLVOAvatar::postPelvisSetRecalc() { mRoot->updateWorldMatrixChildren(); - // BENTO extra tracing around computeBodySize() - LLVector3 body_size = mBodySize; - LLVector3 avatar_offset = mAvatarOffset; computeBodySize(); - if (mBodySize != body_size || mAvatarOffset != avatar_offset) - { - debugBodySize(); - LL_DEBUGS("Avatar") << avString() << "old mBodySize " << body_size << " old mAvatarOffset " << avatar_offset << LL_ENDL; - LL_DEBUGS("Avatar") << avString() << "new mBodySize " << mBodySize << " new mAvatarOffset " << mAvatarOffset << LL_ENDL; - } dirtyMesh(2); } //------------------------------------------------------------------------ @@ -5947,16 +5944,7 @@ void LLVOAvatar::updateVisualParams() if (mLastSkeletonSerialNum != mSkeletonSerialNum) { - // BENTO extra tracing around computeBodySize() - LLVector3 body_size = mBodySize; - LLVector3 avatar_offset = mAvatarOffset; computeBodySize(); - if (mBodySize != body_size || mAvatarOffset != avatar_offset) - { - debugBodySize(); - LL_DEBUGS("Avatar") << avString() << "old mBodySize " << body_size << " old mAvatarOffset " << avatar_offset << LL_ENDL; - LL_DEBUGS("Avatar") << avString() << "new mBodySize " << mBodySize << " new mAvatarOffset " << mAvatarOffset << LL_ENDL; - } mLastSkeletonSerialNum = mSkeletonSerialNum; mRoot->updateWorldMatrixChildren(); } @@ -8397,6 +8385,12 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara } } + // Root joint + const LLVector3& pos = mRoot->getPosition(); + const LLVector3& scale = mRoot->getScale(); + apr_file_printf( file, "\t\t\n", + mRoot->getName().c_str(), pos[0], pos[1], pos[2], scale[0], scale[1], scale[2]); + // Bones avatar_joint_list_t::iterator iter = mSkeleton.begin(); avatar_joint_list_t::iterator end = mSkeleton.end(); -- cgit v1.2.3 From cba0bb30380baef9ecb753149fcb1779c0c96a8e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 5 Jul 2016 16:18:50 -0400 Subject: SL-109 - little bit of log spam cleanup --- indra/newview/llvoavatar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e3eff15815..d3cd85e9f4 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -8974,7 +8974,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity() && (all_textures.find(image_id) == all_textures.end())) { // attachment texture not previously seen. - LL_INFOS() << "attachment_texture: " << image_id.asString() << LL_ENDL; + LL_DEBUGS("ARCdetail") << "attachment_texture: " << image_id.asString() << LL_ENDL; all_textures.insert(image_id); } } @@ -8994,7 +8994,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity() continue; if (all_textures.find(image_id) == all_textures.end()) { - LL_INFOS() << "local_texture: " << texture_dict->mName << ": " << image_id << LL_ENDL; + LL_DEBUGS("ARCdetail") << "local_texture: " << texture_dict->mName << ": " << image_id << LL_ENDL; all_textures.insert(image_id); } } -- cgit v1.2.3 From b7a0d441a35193cdeb604a491b266d2f54babb7f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 9 Aug 2016 09:17:37 -0400 Subject: SL-126 - attachment logging under avatar at DEBUG level. Also fixed a typo in avatar_lad.xml --- indra/newview/llvoavatar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index d3cd85e9f4..b1282fb4de 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5606,11 +5606,11 @@ void LLVOAvatar::showAttachmentPosOverrides(bool verbose) const { std::stringstream ss; std::copy(joint_names.begin(), joint_names.end(), std::ostream_iterator(ss, ",")); - LL_INFOS() << getFullname() << " attachment positions defined for joints: " << ss.str() << "\n" << LL_ENDL; + LL_DEBUGS("Avatar") << getFullname() << " attachment positions defined for joints: " << ss.str() << "\n" << LL_ENDL; } else { - LL_INFOS() << getFullname() << " no attachment positions defined for any joints" << "\n" << LL_ENDL; + LL_DEBUGS("Avatar") << getFullname() << " no attachment positions defined for any joints" << "\n" << LL_ENDL; } if (!verbose) -- cgit v1.2.3 From 85a13b53f5570c44c476a7af70846874dfc3ecbf Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 12 Aug 2016 14:20:44 -0400 Subject: MAINT-6631 - reluctantly, added support for animation of collision volumes, to avoid breaking existing content. --- indra/newview/llvoavatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index b1282fb4de..6e436e85e9 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5921,7 +5921,7 @@ void LLVOAvatar::initAttachmentPoints(bool ignore_hud_joints) attachment->setVisibleInFirstPerson(info->mVisibleFirstPerson); attachment->setIsHUDAttachment(info->mIsHUDAttachment); // attachment can potentially be animated, needs a number. - attachment->setJointNum(mSkeleton.size() + attachmentID - 1); + attachment->setJointNum(mNextJointNum++); if (newly_created) { -- cgit v1.2.3 From 72d5ff36f56c4afee85f5863f64f237980341014 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 17 Aug 2016 16:31:28 -0400 Subject: MAINT-6647 - ignore previously created slm files on model upload. SL-442 - change coloring for show bones, to highlight joint positions and rigging --- indra/newview/llvoavatar.cpp | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index db0316ebcd..946db6713e 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1428,12 +1428,15 @@ void LLVOAvatar::renderBones() avatar_joint_list_t::iterator iter = mSkeleton.begin(); avatar_joint_list_t::iterator end = mSkeleton.end(); - static LLVector3 BASE_COLOR_OCCLUDED(1.0f, 0.0f, 0.0f); - static LLVector3 BASE_COLOR_VISIBLE(0.5f, 0.5f, 0.5f); - static LLVector3 EXTENDED_COLOR_OCCLUDED(0.0f, 1.0f, 0.0f); - static LLVector3 EXTENDED_COLOR_VISIBLE(0.5f, 0.5f, 0.5f); + // For bones with position overrides defined + static LLVector3 OVERRIDE_COLOR_OCCLUDED(1.0f, 0.0f, 0.0f); + static LLVector3 OVERRIDE_COLOR_VISIBLE(0.5f, 0.5f, 0.5f); + // For bones which are rigged to by at least one attachment static LLVector3 RIGGED_COLOR_OCCLUDED(0.0f, 1.0f, 1.0f); static LLVector3 RIGGED_COLOR_VISIBLE(0.5f, 0.5f, 0.5f); + // For bones not otherwise colored + static LLVector3 OTHER_COLOR_OCCLUDED(0.0f, 1.0f, 0.0f); + static LLVector3 OTHER_COLOR_VISIBLE(0.5f, 0.5f, 0.5f); static F32 SPHERE_SCALEF = 0.001f; @@ -1446,25 +1449,27 @@ void LLVOAvatar::renderBones() } jointp->updateWorldMatrix(); - LLJoint::SupportCategory sc = jointp->getSupport(); + LLVector3 occ_color, visible_color; - if (jointIsRiggedTo(jointp->getName())) + LLVector3 pos; + LLUUID mesh_id; + if (jointp->hasAttachmentPosOverride(pos,mesh_id)) { - occ_color = RIGGED_COLOR_OCCLUDED; - visible_color = RIGGED_COLOR_VISIBLE; + occ_color = OVERRIDE_COLOR_OCCLUDED; + visible_color = OVERRIDE_COLOR_VISIBLE; } else { - if (sc == LLJoint::SUPPORT_BASE) + if (jointIsRiggedTo(jointp->getName())) { - occ_color = BASE_COLOR_OCCLUDED; - visible_color = BASE_COLOR_VISIBLE; + occ_color = RIGGED_COLOR_OCCLUDED; + visible_color = RIGGED_COLOR_VISIBLE; } else { - occ_color = EXTENDED_COLOR_OCCLUDED; - visible_color = EXTENDED_COLOR_VISIBLE; + occ_color = OTHER_COLOR_OCCLUDED; + visible_color = OTHER_COLOR_VISIBLE; } } LLVector3 begin_pos(0,0,0); -- cgit v1.2.3 From 2de32f2485a5a9c570f4437056bc1486f6fe8da0 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 24 Aug 2016 10:50:23 -0400 Subject: SL-427 - trying less frequent computeBodySize() updates to avoid 'camera at sea' and related issues. --- indra/newview/llvoavatar.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 946db6713e..9a26d8f78f 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3605,7 +3605,8 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // that affect the body size calculation, computed body size // can get stale much more easily. Simplest fix is to update // it frequently. - computeBodySize(); + // SL-427: this appears to be too frequent, moving to only do on animation state change. + // computeBodySize(); // correct for the fact that the pelvis is not necessarily the center // of the agent's physical representation @@ -5093,6 +5094,12 @@ void LLVOAvatar::processAnimationStateChanges() //----------------------------------------------------------------------------- BOOL LLVOAvatar::processSingleAnimationStateChange( const LLUUID& anim_id, BOOL start ) { + // SL-402, SL-427 - we need to update body size often enough to + // keep appearances in sync, but not so often that animations + // cause constant jiggling of the body or camera. Possible + // compromise is to do it on animation changes: + computeBodySize(); + BOOL result = FALSE; if ( start ) // start animation -- cgit v1.2.3 From 1848a9267bf2cd4352a80e1e27059194518dc344 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 25 Aug 2016 10:42:34 -0400 Subject: SL-427 - debug logging for AvatarBodySize will give details about when and why body size changed --- indra/newview/llvoavatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9a26d8f78f..e9f00f04fa 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3606,7 +3606,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // can get stale much more easily. Simplest fix is to update // it frequently. // SL-427: this appears to be too frequent, moving to only do on animation state change. - // computeBodySize(); + //computeBodySize(); // correct for the fact that the pelvis is not necessarily the center // of the agent's physical representation -- cgit v1.2.3 From 34ced1aa2cc286db26e2866cfc7a53ef72d828a4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 2 Sep 2016 16:44:57 -0400 Subject: SL-395 - partial support for joint scale locking via flag in skin info --- indra/newview/llvoavatar.cpp | 60 +++++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 28 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 3354678af9..7af15fb351 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5539,16 +5539,25 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo) { pJoint->setId( currentId ); const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation(); - bool override_changed; - pJoint->addAttachmentPosOverride( jointPos, mesh_id, avString(), override_changed ); - - if (override_changed) + if (pJoint->aboveJointPosThreshold(jointPos)) { - //If joint is a pelvis then handle old/new pelvis to foot values - if ( lookingForJoint == "mPelvis" ) - { - pelvisGotSet = true; - } + bool override_changed; + pJoint->addAttachmentPosOverride( jointPos, mesh_id, avString(), override_changed ); + + if (override_changed) + { + //If joint is a pelvis then handle old/new pelvis to foot values + if ( lookingForJoint == "mPelvis" ) + { + pelvisGotSet = true; + } + } + if (pSkinData->mLockScaleIfJointPosition) + { + // Note that unlike positions, there's no threshold check here, + // just a lock at the default value. + pJoint->addAttachmentScaleOverride(pJoint->getDefaultScale(), mesh_id, avString()); + } } } } @@ -5567,25 +5576,6 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo) } } } - // Set the joint scales - // FIXME replace with real logic for finding scale, probably inside the bindcnt loop above - const LLUUID& mesh_id = pSkinData->mMeshID; - for (int i = 0; i < jointCnt; ++i) - { - std::string lookingForJoint = pSkinData->mJointNames[i].c_str(); - LLJoint* pJoint = getJoint(lookingForJoint); - if (pJoint) - { - if (pJoint->getName() == "mCollarRight" || - pJoint->getName() == "mShoulderRight" || - pJoint->getName() == "mElbowRight" || - pJoint->getName() == "mHandRight") - { - LLVector3 jointScale(2.0f, 2.0f, 2.0f); - pJoint->addAttachmentScaleOverride(jointScale, mesh_id, avString()); - } - } - } } //Rebuild body data if we altered joints/pelvis @@ -8491,6 +8481,20 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara pJoint->getName().c_str(), pos[0], pos[1], pos[2], mesh_id.asString().c_str()); } } + // Joint scale overrides + for (iter = mSkeleton.begin(); iter != end; ++iter) + { + LLJoint* pJoint = (*iter); + + LLVector3 scale; + LLUUID mesh_id; + + if (pJoint->hasAttachmentScaleOverride(scale,mesh_id)) + { + apr_file_printf( file, "\t\t\n", + pJoint->getName().c_str(), scale[0], scale[1], scale[2], mesh_id.asString().c_str()); + } + } F32 pelvis_fixup; LLUUID mesh_id; if (hasPelvisFixup(pelvis_fixup, mesh_id)) -- cgit v1.2.3 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/llvoavatar.cpp | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7af15fb351..1ff4c1f681 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5324,18 +5324,52 @@ LLJoint *LLVOAvatar::getJoint( const std::string &name ) LLJoint* jointp = NULL; if (iter == mJointMap.end() || iter->second == NULL) - { //search for joint and cache found joint in lookup table + { //search for joint and cache found joint in lookup table jointp = mRoot->findJoint(name); mJointMap[name] = jointp; } else - { //return cached pointer + { //return cached pointer jointp = iter->second; } +#ifndef LL_RELEASE_FOR_DOWNLOAD + if (jointp && jointp->getName()!="mScreen" && jointp->getName()!="mRoot") + { + llassert(getJoint(jointp->getJointNum())==jointp); + } +#endif return jointp; } +LLJoint *LLVOAvatar::getJoint( S32 joint_num ) +{ + LLJoint *pJoint = NULL; + S32 collision_start = mNumBones; + S32 attachment_start = mNumBones + mNumCollisionVolumes; + if (joint_num>=attachment_start) + { + // Attachment IDs start at 1 + S32 attachment_id = joint_num - attachment_start + 1; + attachment_map_t::iterator iter = mAttachmentPoints.find(attachment_id); + if (iter != mAttachmentPoints.end()) + { + pJoint = iter->second; + } + } + else if (joint_num>=collision_start) + { + S32 collision_id = joint_num-collision_start; + pJoint = &mCollisionVolumes[collision_id]; + } + else if (joint_num>=0) + { + pJoint = mSkeleton[joint_num]; + } + llassert(!pJoint || pJoint->getJointNum() == joint_num); + return pJoint; +} + //----------------------------------------------------------------------------- // getRiggedMeshID // @@ -5966,7 +6000,8 @@ void LLVOAvatar::initAttachmentPoints(bool ignore_hud_joints) attachment->setVisibleInFirstPerson(info->mVisibleFirstPerson); attachment->setIsHUDAttachment(info->mIsHUDAttachment); // attachment can potentially be animated, needs a number. - attachment->setJointNum(mNextJointNum++); + attachment->setJointNum(mNumBones + mNumCollisionVolumes + attachmentID - 1); + LL_WARNS() << "Initialized attachment" << attachment->getName() << " joint_num " << attachment->getJointNum() << LL_ENDL; if (newly_created) { @@ -6647,7 +6682,6 @@ LLVOAvatar* LLVOAvatar::findAvatarFromAttachment( LLViewerObject* obj ) return NULL; } -// warning: order(N) not order(1) S32 LLVOAvatar::getAttachmentCount() { S32 count = mAttachmentPoints.size(); -- cgit v1.2.3 From 8230a9937f3bded847dae6c33e01b44158a7f8ee Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 18 Oct 2016 16:05:35 -0400 Subject: MAINT-6841 - removed the joint remapping code, since it was designed to support a feature we no longer have. This also incidentally fixes any bugs caused by the joint remapping code. --- indra/newview/llvoavatar.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 1ff4c1f681..46c367b4e6 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6001,7 +6001,6 @@ void LLVOAvatar::initAttachmentPoints(bool ignore_hud_joints) attachment->setIsHUDAttachment(info->mIsHUDAttachment); // attachment can potentially be animated, needs a number. attachment->setJointNum(mNumBones + mNumCollisionVolumes + attachmentID - 1); - LL_WARNS() << "Initialized attachment" << attachment->getName() << " joint_num " << attachment->getJointNum() << LL_ENDL; if (newly_created) { -- cgit v1.2.3 From 386719b7dd347e43e62c64a63af929d8ce4f7936 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 24 Oct 2016 10:22:14 -0400 Subject: SL-504 - try to prevent an intermittent crash in addAttachmentOverridesForObject() --- indra/newview/llvoavatar.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 46c367b4e6..b68a7774a5 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5522,6 +5522,7 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo) if (!av || (av != this)) { LL_WARNS("Avatar") << "called with invalid avatar" << LL_ENDL; + return; } LLScopedContextString str("addAttachmentOverridesForObject " + av->getFullname()); -- cgit v1.2.3 From 9b1d8bd3899efeb4a7f167d80bc3d0650c1fb747 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 24 Oct 2016 16:03:08 -0400 Subject: SL-503 - dumpArchetypeXML sort joints by name within each type --- indra/newview/llvoavatar.cpp | 84 +++++++++++++++++++++++++++++++++----------- 1 file changed, 64 insertions(+), 20 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index b68a7774a5..d7d6d875f6 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -8382,6 +8382,40 @@ void dump_sequential_xml(const std::string outprefix, const LLSD& content) LL_DEBUGS("Avatar") << "results saved to: " << fullpath << LL_ENDL; } +void LLVOAvatar::getSortedJointNames(S32 joint_type, std::vector& result) const +{ + result.clear(); + if (joint_type==0) + { + avatar_joint_list_t::const_iterator iter = mSkeleton.begin(); + avatar_joint_list_t::const_iterator end = mSkeleton.end(); + for (; iter != end; ++iter) + { + LLJoint* pJoint = (*iter); + result.push_back(pJoint->getName()); + } + } + else if (joint_type==1) + { + for (S32 i = 0; i < mNumCollisionVolumes; i++) + { + LLAvatarJointCollisionVolume* pJoint = &mCollisionVolumes[i]; + result.push_back(pJoint->getName()); + } + } + else if (joint_type==2) + { + for (LLVOAvatar::attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); + iter != mAttachmentPoints.end(); ++iter) + { + LLViewerJointAttachment* pJoint = iter->second; + if (!pJoint) continue; + result.push_back(pJoint->getName()); + } + } + std::sort(result.begin(), result.end()); +} + void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_wearables ) { std::string outprefix(prefix); @@ -8468,21 +8502,29 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara mRoot->getName().c_str(), pos[0], pos[1], pos[2], scale[0], scale[1], scale[2]); // Bones - avatar_joint_list_t::iterator iter = mSkeleton.begin(); - avatar_joint_list_t::iterator end = mSkeleton.end(); - for (; iter != end; ++iter) - { - LLJoint* pJoint = (*iter); + std::vector bone_names, cv_names, attach_names, all_names; + getSortedJointNames(0, bone_names); + getSortedJointNames(1, cv_names); + getSortedJointNames(2, attach_names); + all_names.insert(all_names.end(), bone_names.begin(), bone_names.end()); + all_names.insert(all_names.end(), cv_names.begin(), cv_names.end()); + all_names.insert(all_names.end(), attach_names.begin(), attach_names.end()); + + for (std::vector::iterator name_iter = bone_names.begin(); + name_iter != bone_names.end(); ++name_iter) + { + LLJoint *pJoint = getJoint(*name_iter); const LLVector3& pos = pJoint->getPosition(); const LLVector3& scale = pJoint->getScale(); apr_file_printf( file, "\t\t\n", pJoint->getName().c_str(), pos[0], pos[1], pos[2], scale[0], scale[1], scale[2]); - } + } // Collision volumes - for (S32 i = 0; i < mNumCollisionVolumes; i++) + for (std::vector::iterator name_iter = cv_names.begin(); + name_iter != cv_names.end(); ++name_iter) { - LLAvatarJointCollisionVolume* pJoint = &mCollisionVolumes[i]; + LLJoint *pJoint = getJoint(*name_iter); const LLVector3& pos = pJoint->getPosition(); const LLVector3& scale = pJoint->getScale(); apr_file_printf( file, "\t\t\n", @@ -8490,10 +8532,10 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara } // Attachment joints - for (LLVOAvatar::attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); - iter != mAttachmentPoints.end(); ++iter) - { - LLViewerJointAttachment* pJoint = iter->second; + for (std::vector::iterator name_iter = attach_names.begin(); + name_iter != attach_names.end(); ++name_iter) + { + LLJoint *pJoint = getJoint(*name_iter); if (!pJoint) continue; const LLVector3& pos = pJoint->getPosition(); const LLVector3& scale = pJoint->getScale(); @@ -8502,28 +8544,30 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara } // Joint pos overrides - for (iter = mSkeleton.begin(); iter != end; ++iter) - { - LLJoint* pJoint = (*iter); + for (std::vector::iterator name_iter = all_names.begin(); + name_iter != all_names.end(); ++name_iter) + { + LLJoint *pJoint = getJoint(*name_iter); LLVector3 pos; LLUUID mesh_id; - if (pJoint->hasAttachmentPosOverride(pos,mesh_id)) + if (pJoint && pJoint->hasAttachmentPosOverride(pos,mesh_id)) { apr_file_printf( file, "\t\t\n", pJoint->getName().c_str(), pos[0], pos[1], pos[2], mesh_id.asString().c_str()); } } // Joint scale overrides - for (iter = mSkeleton.begin(); iter != end; ++iter) - { - LLJoint* pJoint = (*iter); + for (std::vector::iterator name_iter = all_names.begin(); + name_iter != all_names.end(); ++name_iter) + { + LLJoint *pJoint = getJoint(*name_iter); LLVector3 scale; LLUUID mesh_id; - if (pJoint->hasAttachmentScaleOverride(scale,mesh_id)) + if (pJoint && pJoint->hasAttachmentScaleOverride(scale,mesh_id)) { apr_file_printf( file, "\t\t\n", pJoint->getName().c_str(), scale[0], scale[1], scale[2], mesh_id.asString().c_str()); -- cgit v1.2.3 From 7447da6943842a5af31787b2bbee3255b45ba88e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 27 Oct 2016 09:39:39 -0400 Subject: SL-503 - more info in archetype dump files --- indra/newview/llvoavatar.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index d7d6d875f6..ec90321139 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7684,12 +7684,10 @@ void dump_visual_param(apr_file_t* file, LLVisualParam* viewer_param, F32 value) wtype = vparam->getWearableType(); } S32 u8_value = F32_to_U8(value,viewer_param->getMinWeight(),viewer_param->getMaxWeight()); - apr_file_printf(file, "\t\t\n", - viewer_param->getID(), viewer_param->getName().c_str(), value, u8_value, type_string.c_str(), + apr_file_printf(file, "\t\t\n", + viewer_param->getID(), viewer_param->getName().c_str(), viewer_param->getDisplayName().c_str(), value, u8_value, type_string.c_str(), LLWearableType::getTypeName(LLWearableType::EType(wtype)).c_str(), - viewer_param->getGroup() -// param_location_name(vparam->getParamLocation()).c_str() - ); + viewer_param->getGroup()); } @@ -8554,8 +8552,12 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara if (pJoint && pJoint->hasAttachmentPosOverride(pos,mesh_id)) { - apr_file_printf( file, "\t\t\n", - pJoint->getName().c_str(), pos[0], pos[1], pos[2], mesh_id.asString().c_str()); + S32 num_pos_overrides; + std::set distinct_pos_overrides; + pJoint->getAllAttachmentPosOverrides(num_pos_overrides, distinct_pos_overrides); + apr_file_printf( file, "\t\t\n", + pJoint->getName().c_str(), pos[0], pos[1], pos[2], mesh_id.asString().c_str(), + num_pos_overrides, distinct_pos_overrides.size()); } } // Joint scale overrides @@ -8569,8 +8571,12 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara if (pJoint && pJoint->hasAttachmentScaleOverride(scale,mesh_id)) { - apr_file_printf( file, "\t\t\n", - pJoint->getName().c_str(), scale[0], scale[1], scale[2], mesh_id.asString().c_str()); + S32 num_scale_overrides; + std::set distinct_scale_overrides; + pJoint->getAllAttachmentPosOverrides(num_scale_overrides, distinct_scale_overrides); + apr_file_printf( file, "\t\t\n", + pJoint->getName().c_str(), scale[0], scale[1], scale[2], mesh_id.asString().c_str(), + num_scale_overrides, distinct_scale_overrides.size()); } } F32 pelvis_fixup; -- cgit v1.2.3 From dd2caad496b6a1fd34f987044f25223311ca3d46 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 27 Oct 2016 10:30:58 -0400 Subject: SL-503 - fix for mac build whinging --- indra/newview/llvoavatar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index ec90321139..fb1bbb2137 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -8557,7 +8557,7 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara pJoint->getAllAttachmentPosOverrides(num_pos_overrides, distinct_pos_overrides); apr_file_printf( file, "\t\t\n", pJoint->getName().c_str(), pos[0], pos[1], pos[2], mesh_id.asString().c_str(), - num_pos_overrides, distinct_pos_overrides.size()); + num_pos_overrides, (S32) distinct_pos_overrides.size()); } } // Joint scale overrides @@ -8576,7 +8576,7 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara pJoint->getAllAttachmentPosOverrides(num_scale_overrides, distinct_scale_overrides); apr_file_printf( file, "\t\t\n", pJoint->getName().c_str(), scale[0], scale[1], scale[2], mesh_id.asString().c_str(), - num_scale_overrides, distinct_scale_overrides.size()); + num_scale_overrides, (S32) distinct_scale_overrides.size()); } } F32 pelvis_fixup; -- cgit v1.2.3 From 204e474225c652fcd00ffc3de56171594d768afb Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 4 Nov 2016 14:24:03 -0400 Subject: SL-524 - resetSkeleton() now includes collision volume joint positions. Also removed no-longer-needed LLJoint::mId field --- indra/newview/llvoavatar.cpp | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index fb1bbb2137..cbd941dd40 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1906,7 +1906,6 @@ void LLVOAvatar::resetSkeleton() // Reset tweakable params to preserved state bool slam_params = true; applyParsedAppearanceMessage(*mLastProcessedAppearance, slam_params); - updateVisualParams(); // Restore attachment pos overrides @@ -5460,32 +5459,13 @@ void LLVOAvatar::clearAttachmentOverrides() { LLScopedContextString str("clearAttachmentOverrides " + getFullname()); - //Subsequent joints are relative to pelvis - avatar_joint_list_t::iterator iter = mSkeleton.begin(); - avatar_joint_list_t::iterator end = mSkeleton.end(); - - for (; iter != end; ++iter) - { - LLJoint* pJoint = (*iter); - if (pJoint) - { + for (S32 i=0; iclearAttachmentPosOverrides(); - } - if (pJoint) - { pJoint->clearAttachmentScaleOverrides(); - } - } - - // Attachment points - for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); - iter != mAttachmentPoints.end(); - ++iter) - { - LLViewerJointAttachment *attachment_pt = (*iter).second; - if (attachment_pt) - { - attachment_pt->clearAttachmentPosOverrides(); } } } @@ -5570,9 +5550,8 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo) { std::string lookingForJoint = pSkinData->mJointNames[i].c_str(); LLJoint* pJoint = getJoint( lookingForJoint ); - if ( pJoint && pJoint->getId() != currentId ) + if (pJoint) { - pJoint->setId( currentId ); const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation(); if (pJoint->aboveJointPosThreshold(jointPos)) { @@ -5779,7 +5758,6 @@ void LLVOAvatar::resetJointsOnDetach(const LLUUID& mesh_id) if ( pJoint ) { bool dummy; // unused - pJoint->setId( LLUUID::null ); pJoint->removeAttachmentPosOverride(mesh_id, avString(),dummy); pJoint->removeAttachmentScaleOverride(mesh_id, avString()); } -- cgit v1.2.3 From a6d9323c7266cf496bc1db6df8ce5bcb58f84ede Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 9 Nov 2016 16:10:04 -0500 Subject: MAINT-6915 - option for Reset Skeleton And Animations. --- indra/newview/llvoavatar.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index cbd941dd40..77a526f518 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1847,7 +1847,7 @@ void LLVOAvatar::resetVisualParams() //----------------------------------------------------------------------------- // resetSkeleton() //----------------------------------------------------------------------------- -void LLVOAvatar::resetSkeleton() +void LLVOAvatar::resetSkeleton(bool reset_animations) { LL_DEBUGS("Avatar") << avString() << " reset starts" << LL_ENDL; if (!mLastProcessedAppearance) @@ -1911,6 +1911,12 @@ void LLVOAvatar::resetSkeleton() // Restore attachment pos overrides rebuildAttachmentOverrides(); + // Animations + if (reset_animations) + { + resetAnimations(); + } + LL_DEBUGS("Avatar") << avString() << " reset ends" << LL_ENDL; } -- cgit v1.2.3 From de487038fc034c470a21e9d6c5bf78e5085ae4a2 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 11 Nov 2016 10:17:03 -0500 Subject: MAINT-6915 - fixed a bug in Reset Skeletons And Animations. For self avatar, this will now be equivalent to reset skeleton + stop animating me. --- indra/newview/llvoavatar.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvoavatar.cpp') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 77a526f518..b25ced4b7e 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1914,7 +1914,18 @@ void LLVOAvatar::resetSkeleton(bool reset_animations) // Animations if (reset_animations) { - resetAnimations(); + if (isSelf()) + { + // This is equivalent to "Stop Animating Me". Will reset + // all animations and propagate the changes to other + // viewers. + gAgent.stopCurrentAnimations(); + } + else + { + // Local viewer-side reset for non-self avatars. + resetAnimations(); + } } LL_DEBUGS("Avatar") << avString() << " reset ends" << LL_ENDL; -- cgit v1.2.3