summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatermodelpreview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloatermodelpreview.cpp')
-rw-r--r--indra/newview/llfloatermodelpreview.cpp38
1 files changed, 24 insertions, 14 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 7aae48cf5d..c654817849 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -1197,6 +1197,7 @@ void LLFloaterModelPreview::onMouseCaptureLostModelPreview(LLMouseHandler* handl
LLModelPreview::LLModelPreview(S32 width, S32 height, LLFloater* fmp)
: LLViewerDynamicTexture(width, height, 3, ORDER_MIDDLE, FALSE), LLMutex(NULL)
, mLodsQuery()
+, mLodsWithParsingError()
, mPelvisZOffset( 0.0f )
, mLegacyRigValid( false )
, mRigValidJointUpload( false )
@@ -1780,8 +1781,8 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable
// this is the initial file picking. Close the whole floater
// if we don't have a base model to show for high LOD.
mFMP->closeFloater(false);
- mLoading = false;
}
+ mLoading = false;
return;
}
@@ -1938,9 +1939,16 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod)
{
mLoading = false ;
mModelLoader = NULL;
+ mLodsWithParsingError.push_back(loaded_lod);
return ;
}
+ mLodsWithParsingError.erase(std::remove(mLodsWithParsingError.begin(), mLodsWithParsingError.end(), loaded_lod), mLodsWithParsingError.end());
+ if(mLodsWithParsingError.empty())
+ {
+ mFMP->childEnable( "calculate_btn" );
+ }
+
// Copy determinations about rig so UI will reflect them
//
setRigValidForJointPositionUpload(mModelLoader->isRigValidForJointPositionUpload());
@@ -2162,7 +2170,11 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod)
if (!mBaseModel.empty())
{
const std::string& model_name = mBaseModel[0]->getName();
- mFMP->getChild<LLUICtrl>("description_form")->setValue(model_name);
+ LLLineEditor* description_form = mFMP->getChild<LLLineEditor>("description_form");
+ if (description_form->getText().empty())
+ {
+ description_form->setText(model_name);
+ }
}
}
refresh();
@@ -2687,17 +2699,7 @@ void LLModelPreview::updateStatusMessages()
setLoadState( LLModelLoader::ERROR_MATERIALS );
mFMP->childDisable( "calculate_btn" );
}
-
- int refFaceCnt = 0;
- int modelFaceCnt = 0;
-
- if (!lod_model->matchMaterialOrder(model_high_lod, refFaceCnt, modelFaceCnt ) )
- {
- setLoadState( LLModelLoader::ERROR_MATERIALS );
- mFMP->childDisable( "calculate_btn" );
- }
-
- if (lod_model)
+ else
{
//for each model in the lod
S32 cur_tris = 0;
@@ -3630,7 +3632,7 @@ BOOL LLModelPreview::render()
}
}
- if (has_skin_weights)
+ if (has_skin_weights && lodsReady())
{ //model has skin weights, enable view options for skin weights and joint positions
if (fmp && isLegacyRigValid() )
{
@@ -4555,4 +4557,12 @@ void LLFloaterModelPreview::setPermissonsErrorStatus(S32 status, const std::stri
LLNotificationsUtil::add("MeshUploadPermError");
}
+bool LLFloaterModelPreview::isModelLoading()
+{
+ if(mModelPreview)
+ {
+ return mModelPreview->mLoading;
+ }
+ return false;
+}