diff options
author | prep linden <prep@lindenlab.com> | 2010-09-24 17:19:44 -0400 |
---|---|---|
committer | prep linden <prep@lindenlab.com> | 2010-09-24 17:19:44 -0400 |
commit | 40150f31ce9b0af4b58c2bd195c9cf571fb5b549 (patch) | |
tree | 816d0cd672618eeb60f3bcaed9fd31934a0a3885 /indra/newview/llfloatermodelpreview.cpp | |
parent | c7f5a9419b4b93efdc04ebfbb8e05a2ef0e09142 (diff) |
Fixed a mesh upload issue where if the asset did not contain a rig the avatar would disappear for the current session.
Diffstat (limited to 'indra/newview/llfloatermodelpreview.cpp')
-rwxr-xr-x | indra/newview/llfloatermodelpreview.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 3fe5d08bb3..0cdd5b9898 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -318,7 +318,10 @@ LLFloaterModelPreview::~LLFloaterModelPreview() { sInstance = NULL; - gAgentAvatarp->resetJointPositions(); + if ( mModelPreview->containsRiggedAsset() ) + { + gAgentAvatarp->resetJointPositions(); + } delete mModelPreview; @@ -2461,6 +2464,21 @@ void LLModelPreview::scrubMaterials() refresh(); } +bool LLModelPreview::containsRiggedAsset( void ) +{ + //loop through the models and determine if any of them contained a rigged asset, and if so + //return true. + //This is used to cleanup the joint positions after a preview. + for (LLModelLoader::model_list::iterator iter = mBaseModel.begin(); iter != mBaseModel.end(); ++iter) + { + LLModel* pModel = *iter; + if ( pModel->mAlternateBindMatrix.size() > 0 ) + { + return true; + } + } + return false; +} void LLModelPreview::genLODs(S32 which_lod) { if (mBaseModel.empty()) |