diff options
author | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-02-23 20:05:15 +0200 |
---|---|---|
committer | AndreyL ProductEngine <alihatskiy@productengine.com> | 2019-02-23 20:05:15 +0200 |
commit | 54b444c5d5e4e7ee80801e5eeed6b32227096580 (patch) | |
tree | 4654cebd1826918daff471c6710de20ba93aab9c | |
parent | ba8f261fdf83108cf5bc48442876916d7c32b666 (diff) |
Backed out changeset: d531bea24d6e
-rw-r--r-- | indra/newview/llfloatermodelpreview.cpp | 62 | ||||
-rw-r--r-- | indra/newview/llfloatermodelpreview.h | 5 |
2 files changed, 14 insertions, 53 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index e39e210939..616bee84fd 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -304,10 +304,10 @@ BOOL LLFloaterModelPreview::postBuild() getChild<LLSpinCtrl>("lod_triangle_limit_" + lod_name[lod])->setCommitCallback(boost::bind(&LLFloaterModelPreview::onLODParamCommit, this, lod, true)); } - 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); - childSetCommitCallback("upload_textures", boost::bind(&LLFloaterModelPreview::onUploadOptionChecked, this, _1), NULL); + childSetCommitCallback("upload_skin", boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this), NULL); + childSetCommitCallback("upload_joints", boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this), NULL); + childSetCommitCallback("lock_scale_if_joint_position", boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this), NULL); + childSetCommitCallback("upload_textures", boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this), NULL); childSetTextArg("status", "[STATUS]", getString("status_idle")); @@ -449,16 +449,6 @@ void LLFloaterModelPreview::initModelPreview() mModelPreview->setModelUpdatedCallback(boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this, _1)); } -void LLFloaterModelPreview::onUploadOptionChecked(LLUICtrl* ctrl) -{ - if (mModelPreview) - { - auto name = ctrl->getName(); - mModelPreview->mViewOption[name] = !mModelPreview->mViewOption[name]; - } - toggleCalculateButton(true); -} - void LLFloaterModelPreview::onViewOptionChecked(LLUICtrl* ctrl) { if (mModelPreview) @@ -641,7 +631,6 @@ void LLFloaterModelPreview::onGenerateNormalsCommit(LLUICtrl* ctrl, void* userda void LLFloaterModelPreview::toggleGenarateNormals() { bool enabled = childGetValue("gen_normals").asBoolean(); - mModelPreview->mViewOption["gen_normals"] = enabled; childSetEnabled("crease_angle", enabled); if(enabled) { mModelPreview->generateNormals(); @@ -1167,8 +1156,10 @@ void LLFloaterModelPreview::initDecompControls() std::string label = llformat("%.1f", value); combo_box->add(label, value, ADD_BOTTOM, true); } + combo_box->setValue(param[i].mDefault.mFloat); + } - combo_box->setValue(param[i].mDefault.mFloat); + combo_box->setCommitCallback(onPhysicsParamCommit, (void*) ¶m[i]); } } @@ -1240,7 +1231,7 @@ void LLFloaterModelPreview::initDecompControls() //LL_INFOS() << "-----------------------------" << LL_ENDL; } } - mDefaultDecompParams = mDecompParams; + childSetCommitCallback("physics_explode", LLFloaterModelPreview::onExplodeCommit, this); } @@ -4429,7 +4420,6 @@ void LLFloaterModelPreview::onReset(void* user_data) std::string filename = mp->mLODFile[LLModel::LOD_HIGH]; fmp->resetDisplayOptions(); - fmp->resetUploadOptions(); //reset model preview fmp->initModelPreview(); @@ -4543,6 +4533,11 @@ void LLFloaterModelPreview::setStatusMessage(const std::string& msg) mStatusMessage = msg; } +void LLFloaterModelPreview::toggleCalculateButton() +{ + toggleCalculateButton(true); +} + void LLFloaterModelPreview::toggleCalculateButton(bool visible) { mCalculateBtn->setVisible(visible); @@ -4604,37 +4599,6 @@ void LLFloaterModelPreview::resetDisplayOptions() } } -void LLFloaterModelPreview::resetUploadOptions() -{ - childSetValue("import_scale", 1); - childSetValue("pelvis_offset", 0); - childSetValue("physics_explode", 0); - childSetValue("physics_file", ""); - childSetVisible("Retain%", false); - childSetVisible("Retain%_label", false); - childSetVisible("Detail Scale", true); - childSetVisible("Detail Scale label", true); - - getChild<LLComboBox>("lod_source_" + lod_name[NUM_LOD - 1])->setCurrentByIndex(LLModelPreview::LOD_FROM_FILE); - for (S32 lod = 0; lod < NUM_LOD - 1; ++lod) - { - getChild<LLComboBox>("lod_source_" + lod_name[lod])->setCurrentByIndex(LLModelPreview::GENERATE); - childSetValue("lod_file_" + lod_name[lod], ""); - } - - getChild<LLComboBox>("physics_lod_combo")->setCurrentByIndex(0); - - for(auto& p : mDefaultDecompParams) - { - std::string ctrl_name(p.first); - LLUICtrl* ctrl = getChild<LLUICtrl>(ctrl_name); - if (ctrl) - { - ctrl->setValue(p.second); - } - } -} - void LLFloaterModelPreview::onModelPhysicsFeeReceived(const LLSD& result, std::string upload_url) { mModelPhysicsFee = result; diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index 41208daa64..564f4c39de 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -109,7 +109,6 @@ public: void loadModel(S32 lod, const std::string& file_name, bool force_disable_slm = false); void onViewOptionChecked(LLUICtrl* ctrl); - void onUploadOptionChecked(LLUICtrl* ctrl); bool isViewOptionChecked(const LLSD& userdata); bool isViewOptionEnabled(const LLSD& userdata); void setViewOptionEnabled(const std::string& option, bool enabled); @@ -180,7 +179,6 @@ protected: LLModelPreview* mModelPreview; LLPhysicsDecomp::decomp_params mDecompParams; - LLPhysicsDecomp::decomp_params mDefaultDecompParams; S32 mLastMouseX; S32 mLastMouseY; @@ -205,6 +203,7 @@ protected: private: void onClickCalculateBtn(); + void toggleCalculateButton(); void onLoDSourceCommit(S32 lod); @@ -214,8 +213,6 @@ private: // resets display options of model preview to their defaults. void resetDisplayOptions(); - void resetUploadOptions(); - void createSmoothComboBox(LLComboBox* combo_box, float min, float max); LLButton* mUploadBtn; |