diff options
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/llfloatermodelpreview.cpp | 20 | ||||
-rwxr-xr-x | indra/newview/llfloatermodelpreview.h | 1 |
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 ); |