diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-08-19 23:26:44 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-08-19 23:26:44 +0300 |
commit | 0ee7e9dadb0b9d6b6c4007faafe1277cee64392d (patch) | |
tree | 3155a93eb7775d9861c5e5dfc93701515934fc06 | |
parent | b0274e1bdd2b140d3c699d096deceefe73e71ec2 (diff) |
SL-13821 Fix upload options affecting preview options incorrectly
-rw-r--r-- | indra/newview/llfloatermodelpreview.cpp | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 1aafd52ee7..d03b526dce 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -346,11 +346,37 @@ void LLFloaterModelPreview::onUploadOptionChecked(LLUICtrl* ctrl) if (mModelPreview) { auto name = ctrl->getName(); + bool value = ctrl->getValue().asBoolean(); // update the option and notifications // (this is a bit convoluted, because of the current structure of mModelPreview) - // FIX ME! mViewOption is malfunctioning here! mViewOption doesn't have values like "upload_skin"! - // This needs to translate values like "upload_skin" into "show_skin_weights" - mModelPreview->mViewOption[name] = !mModelPreview->mViewOption[name]; + if (name == "upload_skin") + { + childSetValue("show_skin_weight", value); + mModelPreview->mViewOption["show_skin_weight"] = value; + if (!value) + { + mModelPreview->mViewOption["show_joint_overrides"] = false; + mModelPreview->mViewOption["show_joint_positions"] = false; + } + } + else if (name == "upload_joints") + { + if (mModelPreview->mViewOption["show_skin_weight"]) + { + childSetValue("show_joint_overrides", value); + mModelPreview->mViewOption["show_joint_overrides"] = value; + } + } + else if (name == "upload_textures") + { + childSetValue("show_textures", value); + mModelPreview->mViewOption["show_textures"] = value; + } + else if (name == "lock_scale_if_joint_position") + { + mModelPreview->mViewOption["lock_scale_if_joint_position"] = value; + } + mModelPreview->refresh(); // a 'dirty' flag for render mModelPreview->resetPreviewTarget(); mModelPreview->clearBuffers(); |