Backed out changeset: d531bea24d6e

meow-7.2.2
AndreyL ProductEngine 2019-02-23 20:05:15 +02:00
parent ba8f261fdf
commit 54b444c5d5
2 changed files with 14 additions and 53 deletions

View File

@ -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*) &param[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;

View File

@ -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;