summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2016-05-17 16:06:27 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2016-05-17 16:06:27 -0400
commit82111ecbde4bacd4cbd5ae5d076876d0ddedd04d (patch)
tree197c9172917d24dd98cc611ae3f3753df2b2400d /indra
parentd0dea44c010ec4e747b139ce55013e3203ba980a (diff)
SL-315 - resetSkeleton() fixes, mostly to get better behavior with non-self avs
Diffstat (limited to 'indra')
-rwxr-xr-xindra/llappearance/llavatarappearance.cpp2
-rwxr-xr-xindra/llappearance/lldriverparam.h4
-rwxr-xr-xindra/newview/character/avatar_lad.xml2
-rwxr-xr-xindra/newview/llvoavatar.cpp49
-rwxr-xr-xindra/newview/llvoavatar.h2
5 files changed, 26 insertions, 33 deletions
diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp
index 4f01665449..2ce43436db 100755
--- a/indra/llappearance/llavatarappearance.cpp
+++ b/indra/llappearance/llavatarappearance.cpp
@@ -601,7 +601,7 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
}
// add to parent
- if (parent)
+ if (parent && (joint->getParent()!=parent))
{
parent->addChild( joint );
}
diff --git a/indra/llappearance/lldriverparam.h b/indra/llappearance/lldriverparam.h
index f71c930e5e..05b4f2252e 100755
--- a/indra/llappearance/lldriverparam.h
+++ b/indra/llappearance/lldriverparam.h
@@ -128,6 +128,10 @@ public:
S32 getDrivenParamsCount() const;
const LLViewerVisualParam* getDrivenParam(S32 index) const;
+ typedef std::vector<LLDrivenEntry> entry_list_t;
+ entry_list_t& getDrivenList() { return mDriven; }
+ void setDrivenList(entry_list_t& driven_list) { mDriven = driven_list; }
+
protected:
LLDriverParam(const LLDriverParam& pOther);
F32 getDrivenWeight(const LLDrivenEntry* driven, F32 input_weight);
diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml
index 53faf1149b..fcb4709c6c 100755
--- a/indra/newview/character/avatar_lad.xml
+++ b/indra/newview/character/avatar_lad.xml
@@ -3204,7 +3204,7 @@
id="30024"
group="1"
name="Wide_Eyes"
- value_min="-2"
+ value_min="-1.5"
value_max="2">
<param_skeleton>
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>
+
+ // 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<LLDriverParam*>(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);
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 91de5c4217..cca9f0dd1a 100755
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -679,7 +679,7 @@ protected:
public:
void parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMessageContents& msg);
void processAvatarAppearance(LLMessageSystem* mesgsys);
- void applyParsedAppearanceMessage(LLAppearanceMessageContents& contents);
+ void applyParsedAppearanceMessage(LLAppearanceMessageContents& contents, bool slam_params);
void hideSkirt();
void startAppearanceAnimation();