diff options
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/CMakeLists.txt | 2 | ||||
-rwxr-xr-x | indra/newview/app_settings/anim.ini | 87 | ||||
-rwxr-xr-x | indra/newview/app_settings/joint_aliases.xml | 97 | ||||
-rwxr-xr-x | indra/newview/llfloaterbvhpreview.cpp | 18 | ||||
-rwxr-xr-x | indra/newview/llfloaterbvhpreview.h | 3 | ||||
-rwxr-xr-x | indra/newview/llfloatermodelpreview.cpp | 7 | ||||
-rwxr-xr-x | indra/newview/llstartup.cpp | 2 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.cpp | 23 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.h | 3 |
9 files changed, 148 insertions, 94 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index a006611a45..b371939fb5 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1600,12 +1600,12 @@ set_source_files_properties(${viewer_XUI_FILES} list(APPEND viewer_SOURCE_FILES ${viewer_XUI_FILES}) set(viewer_APPSETTINGS_FILES - app_settings/anim.ini app_settings/cmd_line.xml app_settings/commands.xml 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/anim.ini b/indra/newview/app_settings/anim.ini deleted file mode 100755 index 63c84e544d..0000000000 --- a/indra/newview/app_settings/anim.ini +++ /dev/null @@ -1,87 +0,0 @@ -Translations 1.0 - -[hip] - relativepos = firstkey - relativerot = firstkey - outname = mPelvis - frame = 0 1 0, 0 0 1, 1 0 0 - -[abdomen] - outname = mTorso - frame = 0 1 0, 0 0 1, 1 0 0 - -[chest] - outname = mChest - frame = 0 1 0, 0 0 1, 1 0 0 - -[neckDummy] - ignore = true - frame = 0 1 0, 0 0 1, 1 0 0 - -[neck] - outname = mNeck - frame = 0 1 0, 0 0 1, 1 0 0 - -[head] - outname = mHead - frame = 0 1 0, 0 0 1, 1 0 0 - -[figureHair] - ignore = true - frame = 0 1 0, 0 0 1, 1 0 0 - -[lCollar] - outname = mCollarLeft - frame = 0 1 0, 0 0 1, 1 0 0 - -[lShldr] - outname = mShoulderLeft - frame = 0 1 0, 0 0 1, 1 0 0 - -[lForeArm] - outname = mElbowLeft - frame = 0 1 0, 0 0 1, 1 0 0 - -[lHand] - outname = mWristLeft - frame = 0 1 0, 0 0 1, 1 0 0 - -[rCollar] - outname = mCollarRight - frame = 0 1 0, 0 0 1, 1 0 0 - -[rShldr] - outname = mShoulderRight - frame = 0 1 0, 0 0 1, 1 0 0 - -[rForeArm] - outname = mElbowRight - frame = 0 1 0, 0 0 1, 1 0 0 - -[rHand] - outname = mWristRight - frame = 0 1 0, 0 0 1, 1 0 0 - -[lThigh] - outname = mHipLeft - frame = 0 1 0, 0 0 1, 1 0 0 - -[lShin] - outname = mKneeLeft - frame = 0 1 0, 0 0 1, 1 0 0 - -[lFoot] - outname = mAnkleLeft - frame = 0 1 0, 0 0 1, 1 0 0 - -[rThigh] - outname = mHipRight - frame = 0 1 0, 0 0 1, 1 0 0 - -[rShin] - outname = mKneeRight - frame = 0 1 0, 0 0 1, 1 0 0 - -[rFoot] - outname = mAnkleRight - frame = 0 1 0, 0 0 1, 1 0 0
\ No newline at end of file diff --git a/indra/newview/app_settings/joint_aliases.xml b/indra/newview/app_settings/joint_aliases.xml new file mode 100755 index 0000000000..1e4a233837 --- /dev/null +++ b/indra/newview/app_settings/joint_aliases.xml @@ -0,0 +1,97 @@ +<?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/llfloaterbvhpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp index a800a3ca14..97769838e8 100755 --- a/indra/newview/llfloaterbvhpreview.cpp +++ b/indra/newview/llfloaterbvhpreview.cpp @@ -178,6 +178,14 @@ 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) +{ + // Get all standard skeleton joints from the preview avatar. + LLPointer<LLVOAvatar> av = (LLVOAvatar*)mAnimPreview->getDummyAvatar(); + av->getLegalJointNames(legal_joint_names, false); +} + + //----------------------------------------------------------------------------- // postBuild() //----------------------------------------------------------------------------- @@ -215,6 +223,8 @@ BOOL LLFloaterBvhPreview::postBuild() getChildView("bad_animation_text")->setVisible(FALSE); + mAnimPreview = new LLPreviewAnimation(256, 256); + std::string exten = gDirUtilp->getExtension(mFilename); if (exten == "bvh") { @@ -241,8 +251,10 @@ BOOL LLFloaterBvhPreview::postBuild() file_buffer[file_size] = '\0'; LL_INFOS() << "Loading BVH file " << mFilename << LL_ENDL; ELoadStatus load_status = E_ST_OK; - S32 line_number = 0; - loaderp = new LLBVHLoader(file_buffer, load_status, line_number); + 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::string status = getString(STATUS[load_status]); if(load_status == E_ST_NO_XLT_FILE) @@ -266,8 +278,6 @@ BOOL LLFloaterBvhPreview::postBuild() mTransactionID.generate(); mMotionID = mTransactionID.makeAssetID(gAgent.getSecureSessionID()); - mAnimPreview = new LLPreviewAnimation(256, 256); - // motion will be returned, but it will be in a load-pending state, as this is a new motion // this motion will not request an asset transfer until next update, so we have a chance to // load the keyframe data locally diff --git a/indra/newview/llfloaterbvhpreview.h b/indra/newview/llfloaterbvhpreview.h index b81cc6e3a5..74d77d0004 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); + protected: void draw(); void resetMotion(); diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 9c72238d87..30051a79f1 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -1712,6 +1712,8 @@ void LLModelPreview::getLegalJointNames(JointNameSet& legal_joint_names) { // 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++) { @@ -1775,6 +1777,10 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable JointNameSet legal_joint_names; getLegalJointNames(legal_joint_names); + std::string joint_aliases_filename = + gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"joint_aliases.xml"); + + mModelLoader = new LLDAELoader( filename, lod, @@ -1786,6 +1792,7 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable mJointTransformMap, mJointsFromNode, legal_joint_names, + joint_aliases_filename, gSavedSettings.getU32("ImporterModelLimit")); if (force_disable_slm) diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 54ecc76867..6610330a56 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1258,7 +1258,7 @@ bool idle_startup() LLPostProcess::initClass(); display_startup(); - LLAvatarAppearance::initClass(gSavedSettings.getString("AvatarFileName"),gSavedSettings.getString("SkeletonFileName")); + LLAvatarAppearance::initClass(gSavedSettings.getString("AvatarFileName"),gSavedSettings.getString("SkeletonFileName")); display_startup(); LLViewerObject::initVOClasses(); 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<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++) + { + LLAvatarJoint *joint = skel[i]; + if (joint) + { + legal_joint_names.push_back(joint->getName()); + } + } + + if (include_collision_volumes) + { + for (S32 i = 0; i < mNumCollisionVolumes; i++) + { + legal_joint_names.push_back(mCollisionVolumes[i].getName()); + } + } +} + // static void LLVOAvatar::dumpBakedStatus() { diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 7a2355b447..29f70fca18 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -72,6 +72,7 @@ class LLTexGlobalColor; struct LLAppearanceMessageContents; class LLViewerJointMesh; + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // LLVOAvatar // @@ -146,6 +147,8 @@ public: void collectBakedTextureUUIDs(std::set<LLUUID>& ids) const; void collectTextureUUIDs(std::set<LLUUID>& ids); void releaseOldTextures(); + void getLegalJointNames(std::deque<std::string>& legal_joint_names, + bool include_collision_volumes); /*virtual*/ void updateTextures(); LLViewerFetchedTexture* getBakedTextureImage(const U8 te, const LLUUID& uuid); /*virtual*/ S32 setTETexture(const U8 te, const LLUUID& uuid); // If setting a baked texture, need to request it from a non-local sim. |