summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatermodelpreview.cpp
diff options
context:
space:
mode:
authorprep <prep@lindenlab.com>2010-12-08 14:50:25 -0500
committerprep <prep@lindenlab.com>2010-12-08 14:50:25 -0500
commita1e59112d028469870c7d1b38c8dbb56f556959d (patch)
treeb99cbcc6f879b7439313cbf8ce7da6546008fa7f /indra/newview/llfloatermodelpreview.cpp
parent9d165362201f38f8722227ad72f23bba28125119 (diff)
Fix for SH-424
Diffstat (limited to 'indra/newview/llfloatermodelpreview.cpp')
-rw-r--r--indra/newview/llfloatermodelpreview.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 07af8382a3..1e0624f8c4 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -284,6 +284,7 @@ BOOL LLFloaterModelPreview::postBuild()
childDisable("upload_skin");
childDisable("upload_joints");
+ childDisable("ok_btn");
initDecompControls();
@@ -1554,9 +1555,11 @@ void LLModelLoader::run()
}
daeElement* scene = root->getDescendant("visual_scene");
+
if (!scene)
{
llwarns << "document has no visual_scene" << llendl;
+ setLoadState( ERROR_PARSING );
return;
}
@@ -2001,6 +2004,11 @@ LLModelPreview::~LLModelPreview()
U32 LLModelPreview::calcResourceCost()
{
rebuildUploadData();
+
+ if ( mModelLoader->getLoadState() != LLModelLoader::ERROR_PARSING )
+ {
+ mFMP->childEnable("ok_btn");
+ }
U32 cost = 0;
std::set<LLModel*> accounted;
@@ -2095,6 +2103,11 @@ void LLModelPreview::rebuildUploadData()
F32 max_scale = 0.f;
+ if ( mBaseScene.size() > 0 )
+ {
+ mFMP->childEnable("ok_btn");
+ }
+
for (LLModelLoader::scene::iterator iter = mBaseScene.begin(); iter != mBaseScene.end(); ++iter)
{ //for each transform in scene
LLMatrix4 mat = iter->first;
@@ -2235,6 +2248,11 @@ void LLModelPreview::loadModel(std::string filename, S32 lod)
setPreviewLOD(lod);
+ if ( mModelLoader->getLoadState() == LLModelLoader::ERROR_PARSING )
+ {
+ mFMP->childDisable("ok_btn");
+ }
+
if (lod == mPreviewLOD)
{
mFMP->childSetText("lod_file", mLODFile[mPreviewLOD]);
@@ -3001,7 +3019,9 @@ void LLModelPreview::updateStatusMessages()
mFMP->childSetText(lod_status_name[lod], message);
}
- if (upload_ok)
+ bool errorStateFromLoader = mModelLoader->getLoadState() == LLModelLoader::ERROR_PARSING ? true : false;
+
+ if ( upload_ok && !errorStateFromLoader )
{
mFMP->childEnable("ok_btn");
}
@@ -3888,4 +3908,3 @@ void LLFloaterModelPreview::DecompRequest::completed()
sInstance->mCurRequest = NULL;
}
}
-