SL-10328 FIXED Some parameters are not reset in the Upload Model menu when pressing button 'Clear settings & reset form'
parent
6f1e08f22d
commit
00a6c069f2
|
|
@ -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::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);
|
||||
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);
|
||||
|
||||
childSetTextArg("status", "[STATUS]", getString("status_idle"));
|
||||
|
||||
|
|
@ -449,6 +449,16 @@ 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)
|
||||
|
|
@ -631,6 +641,7 @@ 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();
|
||||
|
|
@ -1156,10 +1167,8 @@ 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]);
|
||||
}
|
||||
}
|
||||
|
|
@ -1231,7 +1240,7 @@ void LLFloaterModelPreview::initDecompControls()
|
|||
//LL_INFOS() << "-----------------------------" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
mDefaultDecompParams = mDecompParams;
|
||||
childSetCommitCallback("physics_explode", LLFloaterModelPreview::onExplodeCommit, this);
|
||||
}
|
||||
|
||||
|
|
@ -4420,6 +4429,7 @@ void LLFloaterModelPreview::onReset(void* user_data)
|
|||
std::string filename = mp->mLODFile[LLModel::LOD_HIGH];
|
||||
|
||||
fmp->resetDisplayOptions();
|
||||
fmp->resetUploadOptions();
|
||||
//reset model preview
|
||||
fmp->initModelPreview();
|
||||
|
||||
|
|
@ -4533,11 +4543,6 @@ void LLFloaterModelPreview::setStatusMessage(const std::string& msg)
|
|||
mStatusMessage = msg;
|
||||
}
|
||||
|
||||
void LLFloaterModelPreview::toggleCalculateButton()
|
||||
{
|
||||
toggleCalculateButton(true);
|
||||
}
|
||||
|
||||
void LLFloaterModelPreview::toggleCalculateButton(bool visible)
|
||||
{
|
||||
mCalculateBtn->setVisible(visible);
|
||||
|
|
@ -4599,6 +4604,37 @@ 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;
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ 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);
|
||||
|
|
@ -179,6 +180,7 @@ protected:
|
|||
LLModelPreview* mModelPreview;
|
||||
|
||||
LLPhysicsDecomp::decomp_params mDecompParams;
|
||||
LLPhysicsDecomp::decomp_params mDefaultDecompParams;
|
||||
|
||||
S32 mLastMouseX;
|
||||
S32 mLastMouseY;
|
||||
|
|
@ -203,7 +205,6 @@ protected:
|
|||
|
||||
private:
|
||||
void onClickCalculateBtn();
|
||||
void toggleCalculateButton();
|
||||
|
||||
void onLoDSourceCommit(S32 lod);
|
||||
|
||||
|
|
@ -213,6 +214,8 @@ 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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue