summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorprep linden <prep@lindenlab.com>2010-09-24 17:19:44 -0400
committerprep linden <prep@lindenlab.com>2010-09-24 17:19:44 -0400
commit40150f31ce9b0af4b58c2bd195c9cf571fb5b549 (patch)
tree816d0cd672618eeb60f3bcaed9fd31934a0a3885 /indra/newview
parentc7f5a9419b4b93efdc04ebfbb8e05a2ef0e09142 (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')
-rwxr-xr-xindra/newview/llfloatermodelpreview.cpp20
-rwxr-xr-xindra/newview/llfloatermodelpreview.h1
2 files changed, 20 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())
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index d8f06295ac..5de3ebf5e3 100755
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -135,6 +135,7 @@ class LLModelPreview : public LLViewerDynamicTexture, public LLMutex
void rebuildUploadData();
void clearIncompatible(S32 lod);
void updateStatusMessages();
+ bool containsRiggedAsset( void );
static void textureLoadedCallback( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata );