diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloatermodelpreview.cpp | 23 | ||||
-rw-r--r-- | indra/newview/llfloatermodelpreview.h | 5 |
2 files changed, 25 insertions, 3 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; } } - diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 05106644dc..2e98b8eb18 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -60,6 +60,7 @@ public: GENERATING_VERTEX_BUFFERS, GENERATING_LOD, DONE, + ERROR_PARSING, //basically loading failed } eLoadState; U32 mState; @@ -103,7 +104,9 @@ public: void extractTranslation( domTranslate* pTranslate, LLMatrix4& transform ); void extractTranslationViaElement( daeElement* pTranslateElement, LLMatrix4& transform ); - + void setLoadState( U32 state ) { mState = state; } + U32 getLoadState( void ) { return mState; } + //map of avatar joints as named in COLLADA assets to internal joint names std::map<std::string, std::string> mJointMap; }; |