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 | |
| 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.
| -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 ); | 
