diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp
index 484969a9d95d940aa2c637ccc2ba368ebb835d94..f75603e083c8eca424c42021c14a73b9b562f76c 100644
--- a/indra/llappearance/llpolyskeletaldistortion.cpp
+++ b/indra/llappearance/llpolyskeletaldistortion.cpp
@@ -134,55 +134,57 @@ LLPolySkeletalDistortion::~LLPolySkeletalDistortion()
 
 BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
 {
-        llassert(mInfo == NULL);
-        if (info->mID < 0)
-                return FALSE;
-        mInfo = info;
-        mID = info->mID;
-        setWeight(getDefaultWeight());
-
-        LLPolySkeletalDistortionInfo::bone_info_list_t::iterator iter;
-        for (iter = getInfo()->mBoneInfoList.begin(); iter != getInfo()->mBoneInfoList.end(); iter++)
+    //llassert(mInfo == NULL);
+    if (info->mID < 0)
+    {
+        return FALSE;
+    }
+    mInfo = info;
+    mID = info->mID;
+    setWeight(getDefaultWeight());
+
+    LLPolySkeletalDistortionInfo::bone_info_list_t::iterator iter;
+    for (iter = getInfo()->mBoneInfoList.begin(); iter != getInfo()->mBoneInfoList.end(); iter++)
+    {
+        LLPolySkeletalBoneInfo *bone_info = &(*iter);
+        LLJoint* joint = mAvatar->getJoint(bone_info->mBoneName);
+        if (!joint)
         {
-                LLPolySkeletalBoneInfo *bone_info = &(*iter);
-                LLJoint* joint = mAvatar->getJoint(bone_info->mBoneName);
-                if (!joint)
-                {
-                        LL_WARNS() << "Joint " << bone_info->mBoneName << " not found." << LL_ENDL;
-                        continue;
-                }
+            LL_WARNS() << "Joint " << bone_info->mBoneName << " not found." << LL_ENDL;
+            continue;
+        }
 
-                if (mJointScales.find(joint) != mJointScales.end())
-                {
-                        LL_WARNS() << "Scale deformation already supplied for joint " << joint->getName() << "." << LL_ENDL;
-                }
+        //if (mJointScales.find(joint) != mJointScales.end())
+        //{
+        //    LL_WARNS() << "Scale deformation already supplied for joint " << joint->getName() << "." << LL_ENDL;
+        //}
 
-                // store it
-                mJointScales[joint] = bone_info->mScaleDeformation;
+        // store it
+        mJointScales[joint] = bone_info->mScaleDeformation;
 
-                // apply to children that need to inherit it
-                for (LLJoint::child_list_t::iterator iter = joint->mChildren.begin();
-                     iter != joint->mChildren.end(); ++iter)
-                {
-                        LLAvatarJoint* child_joint = (LLAvatarJoint*)(*iter);
-                        if (child_joint->inheritScale())
-                        {
-                                LLVector3 childDeformation = LLVector3(child_joint->getScale());
-                                childDeformation.scaleVec(bone_info->mScaleDeformation);
-                                mJointScales[child_joint] = childDeformation;
-                        }
-                }
+        // apply to children that need to inherit it
+        for (LLJoint::child_list_t::iterator iter = joint->mChildren.begin();
+             iter != joint->mChildren.end(); ++iter)
+        {
+            LLAvatarJoint* child_joint = (LLAvatarJoint*)(*iter);
+            if (child_joint->inheritScale())
+            {
+                LLVector3 childDeformation = LLVector3(child_joint->getScale());
+                childDeformation.scaleVec(bone_info->mScaleDeformation);
+                mJointScales[child_joint] = childDeformation;
+            }
+        }
 
-                if (bone_info->mHasPositionDeformation)
-                {
-                        if (mJointOffsets.find(joint) != mJointOffsets.end())
-                        {
-                                LL_WARNS() << "Offset deformation already supplied for joint " << joint->getName() << "." << LL_ENDL;
-                        }
-                        mJointOffsets[joint] = bone_info->mPositionDeformation;
-                }
+        if (bone_info->mHasPositionDeformation)
+        {
+            //if (mJointOffsets.find(joint) != mJointOffsets.end())
+            //{
+            //    LL_WARNS() << "Offset deformation already supplied for joint " << joint->getName() << "." << LL_ENDL;
+            //}
+            mJointOffsets[joint] = bone_info->mPositionDeformation;
         }
-        return TRUE;
+    }
+    return TRUE;
 }
 
 /*virtual*/ LLViewerVisualParam* LLPolySkeletalDistortion::cloneParam(LLWearable* wearable) const
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 37c5e84347eee4e83b8c6d17ff5df202ec8ae8e3..e82f24a0693c8ed38302736ff1330c7639664489 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<LLPolySkeletalDistortion*>(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 : <driver_parameters>
+	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
+
+
 }
 
 //-----------------------------------------------------------------------------