summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-08-12 22:53:23 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-08-12 22:53:23 +0300
commit1f2ceb97ec4941a43ef3551a9fb41108cb65e1b2 (patch)
tree68e65699d6796687d3b2843fcd1c8b6f780e7b68 /indra
parentd240d381a26605614d1b2ec37861ef22e92e08c2 (diff)
SL-13583 Some behavior tweaks #2
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloatermodelpreview.cpp2
-rw-r--r--indra/newview/llmodelpreview.cpp12
-rw-r--r--indra/newview/llmodelpreview.h1
3 files changed, 15 insertions, 0 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index ae9350867f..1aafd52ee7 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -348,6 +348,8 @@ void LLFloaterModelPreview::onUploadOptionChecked(LLUICtrl* ctrl)
auto name = ctrl->getName();
// 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];
mModelPreview->refresh(); // a 'dirty' flag for render
mModelPreview->resetPreviewTarget();
diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp
index 04a818b2a4..54350fc63d 100644
--- a/indra/newview/llmodelpreview.cpp
+++ b/indra/newview/llmodelpreview.cpp
@@ -180,6 +180,7 @@ LLModelPreview::LLModelPreview(S32 width, S32 height, LLFloater* fmp)
, mResetJoints(false)
, mModelNoErrors(true)
, mLastJointUpdate(false)
+ , mFirstSkinUpdate(true)
, mHasDegenerate(false)
, mImporterDebug(LLCachedControl<bool>(gSavedSettings, "ImporterDebug", false))
{
@@ -2799,11 +2800,22 @@ BOOL LLModelPreview::render()
{
if (flags == LEGACY_RIG_OK)
{
+ if (mFirstSkinUpdate)
+ {
+ // auto enable weight upload if weights are present
+ // (note: all these UI updates need to be somewhere that is not render)
+ mViewOption["show_skin_weight"] = true;
+ skin_weight = true;
+ fmp->childSetValue("upload_skin", true);
+ mFirstSkinUpdate = false;
+ }
+
fmp->enableViewOption("show_skin_weight");
fmp->setViewOptionEnabled("show_joint_overrides", skin_weight);
fmp->setViewOptionEnabled("show_joint_positions", skin_weight);
mFMP->childEnable("upload_skin");
mFMP->childSetValue("show_skin_weight", skin_weight);
+
}
else if ((flags & LEGACY_RIG_FLAG_TOO_MANY_JOINTS) > 0)
{
diff --git a/indra/newview/llmodelpreview.h b/indra/newview/llmodelpreview.h
index 9b8200ab8a..3664a27a72 100644
--- a/indra/newview/llmodelpreview.h
+++ b/indra/newview/llmodelpreview.h
@@ -301,6 +301,7 @@ protected:
U32 mLegacyRigFlags;
bool mLastJointUpdate;
+ bool mFirstSkinUpdate;
JointNameSet mJointsFromNode;
JointTransformMap mJointTransformMap;