summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/CMakeLists.txt1
-rwxr-xr-xindra/newview/app_settings/joint_aliases.xml97
-rwxr-xr-xindra/newview/character/avatar_skeleton.xml40
-rwxr-xr-xindra/newview/llfloaterbvhpreview.cpp13
-rwxr-xr-xindra/newview/llfloaterbvhpreview.h3
-rwxr-xr-xindra/newview/llfloatermodelpreview.cpp34
-rwxr-xr-xindra/newview/llfloatermodelpreview.h5
-rw-r--r--indra/newview/llskinningutil.cpp18
-rwxr-xr-xindra/newview/llviewercontrol.cpp1
-rwxr-xr-xindra/newview/llvoavatar.cpp14
10 files changed, 60 insertions, 166 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index b371939fb5..3c6b1c7903 100755
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1605,7 +1605,6 @@ set(viewer_APPSETTINGS_FILES
app_settings/grass.xml
app_settings/high_graphics.xml
app_settings/ignorable_dialogs.xml
- app_settings/joint_aliases.xml
app_settings/keys.xml
app_settings/keywords_lsl_default.xml
app_settings/logcontrol.xml
diff --git a/indra/newview/app_settings/joint_aliases.xml b/indra/newview/app_settings/joint_aliases.xml
deleted file mode 100755
index 1e4a233837..0000000000
--- a/indra/newview/app_settings/joint_aliases.xml
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="US-ASCII" standalone="yes"?>
-<llsd>
-<map>
- <key>avatar_mPelvis</key>
- <string>mPelvis</string>
- <key>avatar_mTorso</key>
- <string>mTorso</string>
- <key>avatar_mChest</key>
- <string>mChest</string>
- <key>avatar_mNeck</key>
- <string>mNeck</string>
- <key>avatar_mHead</key>
- <string>mHead</string>
- <key>avatar_mSkull</key>
- <string>mSkull</string>
- <key>avatar_mEyeRight</key>
- <string>mEyeRight</string>
- <key>avatar_mEyeLeft</key>
- <string>mEyeLeft</string>
- <key>avatar_mCollarLeft</key>
- <string>mCollarLeft</string>
- <key>avatar_mShoulderLeft</key>
- <string>mShoulderLeft</string>
- <key>avatar_mElbowLeft</key>
- <string>mElbowLeft</string>
- <key>avatar_mWristLeft</key>
- <string>mWristLeft</string>
- <key>avatar_mCollarRight</key>
- <string>mCollarRight</string>
- <key>avatar_mShoulderRight</key>
- <string>mShoulderRight</string>
- <key>avatar_mElbowRight</key>
- <string>mElbowRight</string>
- <key>avatar_mWristRight</key>
- <string>mWristRight</string>
- <key>avatar_mHipRight</key>
- <string>mHipRight</string>
- <key>avatar_mKneeRight</key>
- <string>mKneeRight</string>
- <key>avatar_mAnkleRight</key>
- <string>mAnkleRight</string>
- <key>avatar_mFootRight</key>
- <string>mFootRight</string>
- <key>avatar_mToeRight</key>
- <string>mToeRight</string>
- <key>avatar_mHipLeft</key>
- <string>mHipLeft</string>
- <key>avatar_mKneeLeft</key>
- <string>mKneeLeft</string>
- <key>avatar_mAnkleLeft</key>
- <string>mAnkleLeft</string>
- <key>avatar_mFootLeft</key>
- <string>mFootLeft</string>
- <key>avatar_mToeLeft</key>
- <string>mToeLeft</string>
- <key>hip</key>
- <string>mPelvis</string>
- <key>abdomen</key>
- <string>mTorso</string>
- <key>chest</key>
- <string>mChest</string>
- <key>neck</key>
- <string>mNeck</string>
- <key>head</key>
- <string>mHead</string>
- <key>figureHair</key>
- <string>mSkull</string>
- <key>lCollar</key>
- <string>mCollarLeft</string>
- <key>lShldr</key>
- <string>mShoulderLeft</string>
- <key>lForeArm</key>
- <string>mElbowLeft</string>
- <key>lHand</key>
- <string>mWristLeft</string>
- <key>rCollar</key>
- <string>mCollarRight</string>
- <key>rShldr</key>
- <string>mShoulderRight</string>
- <key>rForeArm</key>
- <string>mElbowRight</string>
- <key>rHand</key>
- <string>mWristRight</string>
- <key>rThigh</key>
- <string>mHipRight</string>
- <key>rShin</key>
- <string>mKneeRight</string>
- <key>rFoot</key>
- <string>mFootRight</string>
- <key>lThigh</key>
- <string>mHipLeft</string>
- <key>lShin</key>
- <string>mKneeLeft</string>
- <key>lFoot</key>
- <string>mFootLeft</string>
-</map>
-</llsd>
diff --git a/indra/newview/character/avatar_skeleton.xml b/indra/newview/character/avatar_skeleton.xml
index 7a088484d8..47182620d2 100755
--- a/indra/newview/character/avatar_skeleton.xml
+++ b/indra/newview/character/avatar_skeleton.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="US-ASCII" standalone="yes"?>
<linden_skeleton version="1.0" num_bones="53" num_collision_volumes="29">
-<bone name="mPelvis" pos="0.000 0.000 1.067" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.000000 1.067015">
+<bone name="mPelvis" pos="0.000 0.000 1.067" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.000000 1.067015" aliases="hip pelvis">
<bone name="mTail_1" pos="0.000 0.000 0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-0.25 0.000000 0.000000">
<bone name="mTail_2" pos="-0.2500 0.000 0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-.25000000 0.000000 0.000000">
<bone name="mTail_3" pos="-0.2500 0.000 0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-0.2500000 0.000000 0.000000">
@@ -11,12 +11,12 @@
</bone>
<collision_volume name="PELVIS" pos = "-0.01 0 -0.02" rot="0.000000 8.00000 0.000000" scale="0.12 0.16 0.17"/>
<collision_volume name="BUTT" pos = "-0.06 0 -0.1" rot="0.000000 0.00000 0.000000" scale="0.1 0.1 0.1"/>
- <bone name="mTorso" pos="0.000 0.000 0.084" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.000000 0.084073">
+ <bone name="mTorso" pos="0.000 0.000 0.084" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.000000 0.084073" aliases="abdomen">
<collision_volume name="BELLY" pos = "0.028 0 0.04" rot="0.000000 8.00000 0.000000" scale="0.09 0.13 0.15"/>
<collision_volume name="LOWER_BACK" pos = "0.0 0.0 0.023" rot="0.000000 0.00000 0.000000" scale="0.09 0.13 0.15"/>
<collision_volume name="LEFT_HANDLE" pos = "0.0 0.10 0.058" rot="0.000000 0.00000 0.000000" scale="0.05 0.05 0.05"/>
<collision_volume name="RIGHT_HANDLE" pos = "0.0 -0.10 0.058" rot="0.000000 0.00000 0.000000" scale="0.05 0.05 0.05"/>
- <bone name="mChest" pos="-0.015 0.000 0.205" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-0.015368 0.000000 0.204877">
+ <bone name="mChest" pos="-0.015 0.000 0.205" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-0.015368 0.000000 0.204877" aliases="chest">
<bone name="mRightWingShoulder" pos="-0.07 -0.082 0.165" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-0.07 -0.082 0.165">
<bone name="mRightWingElbow" pos="-0.085 -0.115 0" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-0.085 -0.115 0">
<bone name="mRightWingWrist" pos="0.000 -0.231 -0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 -.231 -0.000000">
@@ -37,11 +37,11 @@
<collision_volume name="UPPER_BACK" pos = "0.0 0.0 0.017" rot="0.000000 0.00000 0.000000" scale="0.09 0.13 0.15"/>
<collision_volume name="LEFT_PEC" pos = "0.119 0.082 0.042" rot="0.000000 4.29000 0.000000" scale="0.05 0.05 0.05"/>
<collision_volume name="RIGHT_PEC" pos = "0.119 -0.082 0.042" rot="0.000000 4.29000 0.000000" scale="0.05 0.05 0.05"/>
- <bone name="mNeck" pos="-0.010 0.000 0.251" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-0.009507 0.000000 0.251108">
+ <bone name="mNeck" pos="-0.010 0.000 0.251" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-0.009507 0.000000 0.251108" aliases="neck">
<collision_volume name="NECK" pos = "0.0 0 0.02" rot="0.000000 0.000000 0.000000" scale="0.05 0.06 0.08"/>
- <bone name="mHead" pos="0.000 -0.000 0.076" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 -0.000000 0.075630">
+ <bone name="mHead" pos="0.000 -0.000 0.076" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 -0.000000 0.075630" aliases="head">
<collision_volume name="HEAD" pos = "0.02 0 0.07" rot="0.000000 0.000000 0.000000" scale="0.11 0.09 0.12"/>
- <bone name="mSkull" pos="0.000 0.000 0.079" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.000000 0.079000">
+ <bone name="mSkull" pos="0.000 0.000 0.079" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.000000 0.079000" aliases="figureHair">
</bone>
<bone name="mEyeRight" pos="0.098 -0.036 0.079" rot="0.000000 0.000000 -0.000000" scale="1.000 1.000 1.000" pivot="0.098466 -0.036000 0.079000">
</bone>
@@ -49,25 +49,25 @@
</bone>
</bone>
</bone>
- <bone name="mCollarLeft" pos="-0.021 0.085 0.165" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-0.020927 0.084665 0.165396">
+ <bone name="mCollarLeft" pos="-0.021 0.085 0.165" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-0.020927 0.084665 0.165396" aliases="lCollar">
<collision_volume name="L_CLAVICLE" pos = "0.02 0 0.02" rot="0.000000 0.00000 0.000000" scale="0.07 0.14 0.05"/>
- <bone name="mShoulderLeft" pos="0.000 0.079 -0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.079000 -0.000000">
+ <bone name="mShoulderLeft" pos="0.000 0.079 -0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.079000 -0.000000" aliases="lShldr">
<collision_volume name="L_UPPER_ARM" pos = "0.0 0.12 0.01" rot="-5.000000 0.00000 0.000000" scale="0.05 0.17 0.05"/>
- <bone name="mElbowLeft" pos="0.000 0.248 0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.248000 0.000000">
+ <bone name="mElbowLeft" pos="0.000 0.248 0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 0.248000 0.000000" aliases="lForeArm">
<collision_volume name="L_LOWER_ARM" pos = "0.0 0.1 0.0" rot="-3.000000 0.00000 0.000000" scale="0.04 0.14 0.04"/>
- <bone name="mWristLeft" pos="-0.000 0.205 0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-0.000000 0.204846 0.000000">
+ <bone name="mWristLeft" pos="-0.000 0.205 0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-0.000000 0.204846 0.000000" aliases="lHand">
<collision_volume name="L_HAND" pos = "0.01 0.05 0.0" rot="-3.000000 0.00000 -10.000000" scale="0.05 0.08 0.03"/>
</bone>
</bone>
</bone>
</bone>
- <bone name="mCollarRight" pos="-0.021 -0.085 0.165" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-0.020927 -0.085000 0.165396">
+ <bone name="mCollarRight" pos="-0.021 -0.085 0.165" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-0.020927 -0.085000 0.165396" aliases="rCollar">
<collision_volume name="R_CLAVICLE" pos = "0.02 0 0.02" rot="0.000000 0.00000 0.000000" scale="0.07 0.14 0.05"/>
- <bone name="mShoulderRight" pos="0.000 -0.079 -0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 -0.079418 -0.000000">
+ <bone name="mShoulderRight" pos="0.000 -0.079 -0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 -0.079418 -0.000000" aliases="rShldr">
<collision_volume name="R_UPPER_ARM" pos = "0.0 -0.12 0.01" rot="5.000000 0.00000 0.000000" scale="0.05 0.17 0.05"/>
- <bone name="mElbowRight" pos="0.000 -0.248 -0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 -0.248000 -0.000000">
+ <bone name="mElbowRight" pos="0.000 -0.248 -0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.000000 -0.248000 -0.000000" aliases="rForeArm">
<collision_volume name="R_LOWER_ARM" pos = "0.0 -0.1 0.0" rot="3.000000 0.00000 0.000000" scale="0.04 0.14 0.04"/>
- <bone name="mWristRight" pos="0.000 -0.205 -0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-0.000000 -0.205000 -0.000000">
+ <bone name="mWristRight" pos="0.000 -0.205 -0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-0.000000 -0.205000 -0.000000" aliases="rHand">
<collision_volume name="R_HAND" pos = "0.01 -0.05 0.0" rot="3.000000 0.00000 10.000000" scale="0.05 0.08 0.03"/>
</bone>
</bone>
@@ -75,26 +75,26 @@
</bone>
</bone>
</bone>
- <bone name="mHipRight" pos="0.034 -0.129 -0.041" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.033620 -0.128806 -0.041086">
+ <bone name="mHipRight" pos="0.034 -0.129 -0.041" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.033620 -0.128806 -0.041086" aliases="rThigh">
<collision_volume name="R_UPPER_LEG" pos = "-0.02 0.05 -0.22" rot="0.000000 0.00000 0.000000" scale="0.09 0.09 0.32"/>
- <bone name="mKneeRight" pos="-0.001 0.049 -0.491" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-0.000780 0.048635 -0.490922">
+ <bone name="mKneeRight" pos="-0.001 0.049 -0.491" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-0.000780 0.048635 -0.490922" aliases="rShin">
<collision_volume name="R_LOWER_LEG" pos = "-0.02 0.0 -0.2" rot="0.000000 0.00000 0.000000" scale="0.06 0.06 0.25"/>
<bone name="mAnkleRight" pos="-0.029 0.000 -0.468" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-0.028869 0.000000 -0.468494">
<collision_volume name="R_FOOT" pos = "0.077 0.0 -0.041" rot="0.000000 10.00000 0.000000" scale="0.13 0.05 0.05"/>
- <bone name="mFootRight" pos="0.112 -0.000 -0.061" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.111956 -0.000000 -0.060637">
+ <bone name="mFootRight" pos="0.112 -0.000 -0.061" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.111956 -0.000000 -0.060637" aliases="rFoot">
<bone name="mToeRight" pos="0.109 0.000 0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.105399 -0.010408 -0.000104">
</bone>
</bone>
</bone>
</bone>
</bone>
- <bone name="mHipLeft" pos="0.034 0.127 -0.041" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.033757 0.126765 -0.040998">
+ <bone name="mHipLeft" pos="0.034 0.127 -0.041" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.033757 0.126765 -0.040998" aliases="lThigh">
<collision_volume name="L_UPPER_LEG" pos = "-0.02 -0.05 -0.22" rot="0.000000 0.00000 0.000000" scale="0.09 0.09 0.32"/>
- <bone name="mKneeLeft" pos="-0.001 -0.046 -0.491" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-0.000887 -0.045568 -0.491053">
+ <bone name="mKneeLeft" pos="-0.001 -0.046 -0.491" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-0.000887 -0.045568 -0.491053" aliases="lShin">
<collision_volume name="L_LOWER_LEG" pos = "-0.02 0.0 -0.2" rot="0.000000 0.00000 0.000000" scale="0.06 0.06 0.25"/>
<bone name="mAnkleLeft" pos="-0.029 0.001 -0.468" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="-0.028887 0.001378 -0.468449">
<collision_volume name="L_FOOT" pos = "0.077 0.0 -0.041" rot="0.000000 10.00000 0.000000" scale="0.13 0.05 0.05"/>
- <bone name="mFootLeft" pos="0.112 -0.000 -0.061" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.111956 -0.000000 -0.060620">
+ <bone name="mFootLeft" pos="0.112 -0.000 -0.061" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.111956 -0.000000 -0.060620" aliases="lFoot">
<bone name="mToeLeft" pos="0.109 0.000 0.000" rot="0.000000 0.000000 0.000000" scale="1.000 1.000 1.000" pivot="0.105387 0.008270 0.000871">
</bone>
</bone>
diff --git a/indra/newview/llfloaterbvhpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp
index 97769838e8..543b6ff813 100755
--- a/indra/newview/llfloaterbvhpreview.cpp
+++ b/indra/newview/llfloaterbvhpreview.cpp
@@ -178,14 +178,12 @@ void LLFloaterBvhPreview::setAnimCallbacks()
getChild<LLUICtrl>("ease_out_time")->setValidateBeforeCommit( boost::bind(&LLFloaterBvhPreview::validateEaseOut, this, _1));
}
-void LLFloaterBvhPreview::getLegalJointNames(std::deque<std::string>& legal_joint_names)
+std::map <std::string, std::string> LLFloaterBvhPreview::getJointAliases()
{
- // Get all standard skeleton joints from the preview avatar.
LLPointer<LLVOAvatar> av = (LLVOAvatar*)mAnimPreview->getDummyAvatar();
- av->getLegalJointNames(legal_joint_names, false);
+ return av->getJointAliases();
}
-
//-----------------------------------------------------------------------------
// postBuild()
//-----------------------------------------------------------------------------
@@ -252,9 +250,10 @@ BOOL LLFloaterBvhPreview::postBuild()
LL_INFOS() << "Loading BVH file " << mFilename << LL_ENDL;
ELoadStatus load_status = E_ST_OK;
S32 line_number = 0;
- std::deque<std::string> legal_joint_names;
- getLegalJointNames(legal_joint_names);
- loaderp = new LLBVHLoader(file_buffer, load_status, line_number, legal_joint_names);
+
+ std::map<std::string, std::string> joint_alias_map = getJointAliases();
+
+ loaderp = new LLBVHLoader(file_buffer, load_status, line_number, joint_alias_map);
std::string status = getString(STATUS[load_status]);
if(load_status == E_ST_NO_XLT_FILE)
diff --git a/indra/newview/llfloaterbvhpreview.h b/indra/newview/llfloaterbvhpreview.h
index 74d77d0004..20d15d9603 100755
--- a/indra/newview/llfloaterbvhpreview.h
+++ b/indra/newview/llfloaterbvhpreview.h
@@ -109,7 +109,8 @@ public:
S32 status, LLExtStat ext_status);
private:
void setAnimCallbacks() ;
- void getLegalJointNames(std::deque<std::string>& legal_joint_names);
+ std::map <std::string, std::string> getJointAliases();
+
protected:
void draw();
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 30051a79f1..9ab81a74a1 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -1184,7 +1184,6 @@ LLModelPreview::LLModelPreview(S32 width, S32 height, LLFloater* fmp)
, mPhysicsSearchLOD( LLModel::LOD_PHYSICS )
, mResetJoints( false )
, mModelNoErrors( true )
-, mRigParityWithScene( false )
, mLastJointUpdate( false )
{
mNeedsUpdate = TRUE;
@@ -1708,27 +1707,17 @@ void LLModelPreview::clearModel(S32 lod)
mScene[lod].clear();
}
-void LLModelPreview::getLegalJointNames(JointNameSet& legal_joint_names)
+void LLModelPreview::getJointAliases( JointMap& joint_map)
{
// Get all standard skeleton joints from the preview avatar.
LLVOAvatar *av = getPreviewAvatar();
-
- av->getLegalJointNames(legal_joint_names, true);
- const LLVOAvatar::avatar_joint_list_t &skel = av->getSkeleton();
- for (S32 i=0; i<skel.size(); i++)
- {
- LLAvatarJoint *joint = skel[i];
- if (joint)
- {
- legal_joint_names.push_back(joint->getName());
- }
- }
- std::stringstream cvstr;
+ //Joint names and aliases come from avatar_skeleton.xml
+
+ joint_map = av->getJointAliases();
for (S32 i = 0; i < av->mNumCollisionVolumes; i++)
{
- legal_joint_names.push_back(av->mCollisionVolumes[i].getName());
- cvstr << legal_joint_names[i];
+ joint_map[av->mCollisionVolumes[i].getName()] = av->mCollisionVolumes[i].getName();
}
}
@@ -1774,13 +1763,9 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable
clearGLODGroup();
}
- JointNameSet legal_joint_names;
- getLegalJointNames(legal_joint_names);
+ std::map<std::string, std::string> joint_alias_map;
+ getJointAliases(joint_alias_map);
- std::string joint_aliases_filename =
- gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"joint_aliases.xml");
-
-
mModelLoader = new LLDAELoader(
filename,
lod,
@@ -1791,8 +1776,8 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable
this,
mJointTransformMap,
mJointsFromNode,
- legal_joint_names,
- joint_aliases_filename,
+ joint_alias_map,
+ LLSkinningUtil::getMaxJointCount(),
gSavedSettings.getU32("ImporterModelLimit"));
if (force_disable_slm)
@@ -3584,6 +3569,7 @@ BOOL LLModelPreview::render()
fmp->enableViewOption("show_skin_weight");
fmp->setViewOptionEnabled("show_joint_positions", skin_weight);
mFMP->childEnable("upload_skin");
+ mFMP->childSetValue("show_skin_weight", skin_weight);
}
}
else
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index d9351029ec..a0aeda0a3c 100755
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -259,7 +259,7 @@ public:
virtual BOOL needsRender() { return mNeedsUpdate; }
void setPreviewLOD(S32 lod);
void clearModel(S32 lod);
- void getLegalJointNames(JointNameSet& legal_joint_names);
+ void getJointAliases(JointMap& joint_map);
void loadModel(std::string filename, S32 lod, bool force_disable_slm = false);
void loadModelCallback(S32 lod);
void genLODs(S32 which_lod = -1, U32 decimation = 3, bool enforce_tri_limit = false);
@@ -297,8 +297,6 @@ public:
void setLoadState( U32 state ) { mLoadState = state; }
U32 getLoadState() { return mLoadState; }
- void setRigWithSceneParity( bool state ) { mRigParityWithScene = state; }
- const bool getRigWithSceneParity( void ) const { return mRigParityWithScene; }
static bool sIgnoreLoadedCallback;
@@ -346,7 +344,6 @@ private:
bool mLoading;
U32 mLoadState;
bool mResetJoints;
- bool mRigParityWithScene;
bool mModelNoErrors;
std::map<std::string, bool> mViewOption;
diff --git a/indra/newview/llskinningutil.cpp b/indra/newview/llskinningutil.cpp
index 5fd2248060..279035d769 100644
--- a/indra/newview/llskinningutil.cpp
+++ b/indra/newview/llskinningutil.cpp
@@ -85,9 +85,7 @@ U32 get_proxy_joint_index(U32 joint_index, LLVOAvatar *avatar, std::vector<std::
U32 j_proxy = get_valid_joint_index(joint_names[joint_index], avatar, joint_names);
LLJoint *joint = avatar->getJoint(joint_names[j_proxy]);
llassert(joint);
- // BENTO - test of simple push-to-base-ancestor
- // complexity reduction scheme. Find the first
- // ancestor that's not flagged as extended, or the
+ // Find the first ancestor that's not flagged as extended, or the
// last ancestor that's rigged in this mesh, whichever
// comes first.
while (1)
@@ -113,6 +111,7 @@ U32 get_proxy_joint_index(U32 joint_index, LLVOAvatar *avatar, std::vector<std::
void LLSkinningUtil::initClass()
{
sIncludeEnhancedSkeleton = gSavedSettings.getBOOL("IncludeEnhancedSkeleton");
+ // BENTO - remove MaxJointsPerMeshObject before release.
sMaxJointsPerMeshObject = gSavedSettings.getU32("MaxJointsPerMeshObject");
}
@@ -233,7 +232,18 @@ void LLSkinningUtil::initSkinningMatrixPalette(
{
LLJoint* joint = avatar->getJoint(skin->mJointNames[j]);
mat[j] = skin->mInvBindMatrix[j];
- mat[j] *= joint->getWorldMatrix();
+ if (joint)
+ {
+ mat[j] *= joint->getWorldMatrix();
+ }
+ else
+ {
+ // This shouldn't happen - in mesh upload, skinned
+ // rendering should be disabled unless all joints are
+ // valid. In other cases of skinned rendering, invalid
+ // joints should already have been removed during remap.
+ LL_WARNS_ONCE("Avatar") << "Rigged to invalid joint name " << skin->mJointNames[j] << LL_ENDL;
+ }
}
}
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index 4e4aaf5f8e..7af76259a8 100755
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -768,6 +768,7 @@ void settings_setup_listeners()
gSavedSettings.getControl("SpellCheck")->getSignal()->connect(boost::bind(&handleSpellCheckChanged));
gSavedSettings.getControl("SpellCheckDictionary")->getSignal()->connect(boost::bind(&handleSpellCheckChanged));
gSavedSettings.getControl("LoginLocation")->getSignal()->connect(boost::bind(&handleLoginLocationChanged));
+ // BENTO - remove MaxJointsPerMeshObject before release
gSavedSettings.getControl("MaxJointsPerMeshObject")->getCommitSignal()->connect(boost::bind(&handleDeferredDebugSettingChanged, _2));
gSavedSettings.getControl("IncludeEnhancedSkeleton")->getCommitSignal()->connect(boost::bind(&handleDeferredDebugSettingChanged, _2));
}
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index d14ec7e55b..b6924e5904 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -940,15 +940,13 @@ std::string LLVOAvatar::rezStatusToString(S32 rez_status)
void LLVOAvatar::getLegalJointNames(std::deque<std::string>& 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; i<skel.size(); i++)
+ LLAvatarAppearance::joint_alias_map_t alias_map = getJointAliases();
+
+ std::map<std::string, std::string>::iterator iter;
+
+ for (iter = alias_map.begin(); iter != alias_map.end(); ++iter)
{
- LLAvatarJoint *joint = skel[i];
- if (joint)
- {
- legal_joint_names.push_back(joint->getName());
- }
+ legal_joint_names.push_back(iter->first);
}
if (include_collision_volumes)