diff options
-rw-r--r-- | indra/newview/llfloatermodelpreview.cpp | 26 | ||||
-rw-r--r-- | indra/newview/llfloatermodelpreview.h | 1 | ||||
-rw-r--r-- | indra/newview/llmodelpreview.cpp | 30 |
3 files changed, 29 insertions, 28 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index f609e8a91a..a52cf981c7 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -166,6 +166,7 @@ BOOL LLFloaterModelPreview::postBuild() getChild<LLSpinCtrl>("lod_triangle_limit_" + lod_name[lod])->setCommitCallback(boost::bind(&LLFloaterModelPreview::onLODParamCommit, this, lod, true)); } + // Upload/avatar options, they need to refresh errors/notifications childSetCommitCallback("upload_skin", boost::bind(&LLFloaterModelPreview::onUploadOptionChecked, this, _1), NULL); childSetCommitCallback("upload_joints", boost::bind(&LLFloaterModelPreview::onUploadOptionChecked, this, _1), NULL); childSetCommitCallback("lock_scale_if_joint_position", boost::bind(&LLFloaterModelPreview::onUploadOptionChecked, this, _1), NULL); @@ -180,9 +181,6 @@ BOOL LLFloaterModelPreview::postBuild() childSetCommitCallback("preview_lod_combo", onPreviewLODCommit, this); - childSetCommitCallback("upload_joints", onUploadJointsCommit, this); - childSetCommitCallback("lock_scale_if_joint_position", onUploadJointsCommit, this); - childSetCommitCallback("import_scale", onImportScaleCommit, this); childSetCommitCallback("pelvis_offset", onPelvisOffsetCommit, this); @@ -330,12 +328,15 @@ void LLFloaterModelPreview::onUploadOptionChecked(LLUICtrl* ctrl) if (mModelPreview) { auto name = ctrl->getName(); + // update the option and notifications + // (this is a bit convoluted, because of the current structure of mModelPreview) mModelPreview->mViewOption[name] = !mModelPreview->mViewOption[name]; - mModelPreview->refresh(); - mModelPreview->resetPreviewTarget(); + mModelPreview->refresh(); // a 'dirty' flag for render + mModelPreview->resetPreviewTarget(); mModelPreview->clearBuffers(); mModelPreview->mDirty = true; - } + } + // set the button visible, it will be refreshed later toggleCalculateButton(true); } @@ -606,19 +607,6 @@ void LLFloaterModelPreview::onPelvisOffsetCommit( LLUICtrl*, void* userdata ) } //static -void LLFloaterModelPreview::onUploadJointsCommit(LLUICtrl*,void* userdata) -{ - LLFloaterModelPreview *fp =(LLFloaterModelPreview *)userdata; - - if (!fp->mModelPreview) - { - return; - } - - fp->mModelPreview->refresh(); -} - -//static void LLFloaterModelPreview::onPreviewLODCommit(LLUICtrl* ctrl, void* userdata) { LLFloaterModelPreview *fp =(LLFloaterModelPreview *)userdata; diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 6ecc279365..7b344ef2b2 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -139,7 +139,6 @@ protected: static void onImportScaleCommit(LLUICtrl*, void*); static void onPelvisOffsetCommit(LLUICtrl*, void*); - static void onUploadJointsCommit(LLUICtrl*,void*); static void onPreviewLODCommit(LLUICtrl*,void*); diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index dbb2c162a3..9530e02c06 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -361,6 +361,7 @@ void LLModelPreview::rebuildUploadData() F32 max_scale = 0.f; BOOL legacyMatching = gSavedSettings.getBOOL("ImporterLegacyMatching"); + U32 load_state = 0; for (LLModelLoader::scene::iterator iter = mBaseScene.begin(); iter != mBaseScene.end(); ++iter) { //for each transform in scene @@ -563,7 +564,7 @@ void LLModelPreview::rebuildUploadData() if (!high_lod_model) { LLFloaterModelPreview::addStringToLog("Model " + instance.mLabel + " has no High Lod (LOD3).", true); - setLoadState(LLModelLoader::ERROR_MATERIALS); + load_state = LLModelLoader::ERROR_MATERIALS; mFMP->childDisable("calculate_btn"); } else @@ -576,7 +577,7 @@ void LLModelPreview::rebuildUploadData() if (instance.mLOD[i] && !instance.mLOD[i]->matchMaterialOrder(high_lod_model, refFaceCnt, modelFaceCnt)) { LLFloaterModelPreview::addStringToLog("Model " + instance.mLabel + " has mismatching materials between lods." , true); - setLoadState(LLModelLoader::ERROR_MATERIALS); + load_state = LLModelLoader::ERROR_MATERIALS; mFMP->childDisable("calculate_btn"); } } @@ -588,6 +589,8 @@ void LLModelPreview::rebuildUploadData() LLQuaternion identity; if (!bind_rot.isEqualEps(identity, 0.01)) { + // Bind shape matrix is not in standard X-forward orientation. + // Might be good idea to only show this once. It can be spammy. std::ostringstream out; out << "non-identity bind shape rot. mat is "; out << high_lod_model->mSkinInfo.mBindShapeMatrix; @@ -596,13 +599,9 @@ void LLModelPreview::rebuildUploadData() LL_WARNS() << out.str() << LL_ENDL; LLFloaterModelPreview::addStringToLog(out, getLoadState() != LLModelLoader::WARNING_BIND_SHAPE_ORIENTATION); - setLoadState(LLModelLoader::WARNING_BIND_SHAPE_ORIENTATION); + load_state = LLModelLoader::WARNING_BIND_SHAPE_ORIENTATION; } } - else if (getLoadState() == LLModelLoader::WARNING_BIND_SHAPE_ORIENTATION) - { - setLoadState(LLModelLoader::DONE); - } } instance.mTransform = mat; mUploadData.push_back(instance); @@ -634,12 +633,27 @@ void LLModelPreview::rebuildUploadData() LL_INFOS() << out.str() << LL_ENDL; LLFloaterModelPreview::addStringToLog(out, true); } - setLoadState(LLModelLoader::ERROR_MATERIALS); + load_state = LLModelLoader::ERROR_MATERIALS; mFMP->childDisable("calculate_btn"); } } } + // Update state for notifications + if (load_state > 0) + { + // encountered issues + setLoadState(load_state); + } + else if (getLoadState() == LLModelLoader::ERROR_MATERIALS + || getLoadState() == LLModelLoader::WARNING_BIND_SHAPE_ORIENTATION) + { + // This is only valid for these two error types because they are + // only used inside rebuildUploadData() and updateStatusMessages() + // updateStatusMessages() is called after rebuildUploadData() + setLoadState(LLModelLoader::DONE); + } + F32 max_import_scale = (DEFAULT_MAX_PRIM_SCALE - 0.1f) / max_scale; F32 max_axis = llmax(mPreviewScale.mV[0], mPreviewScale.mV[1]); |