diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-02-14 00:12:09 +0200 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-02-14 00:12:09 +0200 |
commit | a549140fd072c0bf03047fa1809d4ea4b89b5a12 (patch) | |
tree | a95d71686d2570bad314c539b8f8bafa8df29092 /indra/newview/llpanelface.cpp | |
parent | 3561e9b5d5a7fef8e6a710c7b6f9b13243a4d51c (diff) |
SL-19183 PBR mapping scale values start on zero
Diffstat (limited to 'indra/newview/llpanelface.cpp')
-rw-r--r-- | indra/newview/llpanelface.cpp | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index cb09ec9fbf..ce086f2520 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1829,6 +1829,7 @@ void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material, const U32 pbr_type = findChild<LLRadioGroup>("radio_pbr_type")->getSelectedIndex(); const LLGLTFMaterial::TextureInfo texture_info = texture_info_from_pbrtype(pbr_type); const bool show_texture_info = texture_info != LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT; + const bool new_state = show_texture_info && has_pbr_capabilities && has_pbr_material; LLUICtrl* gltfCtrlTextureScaleU = getChild<LLUICtrl>("gltfTextureScaleU"); LLUICtrl* gltfCtrlTextureScaleV = getChild<LLUICtrl>("gltfTextureScaleV"); @@ -1836,13 +1837,15 @@ void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material, LLUICtrl* gltfCtrlTextureOffsetU = getChild<LLUICtrl>("gltfTextureOffsetU"); LLUICtrl* gltfCtrlTextureOffsetV = getChild<LLUICtrl>("gltfTextureOffsetV"); - gltfCtrlTextureScaleU->setEnabled(show_texture_info && has_pbr_capabilities && has_pbr_material); - gltfCtrlTextureScaleV->setEnabled(show_texture_info && has_pbr_capabilities && has_pbr_material); - gltfCtrlTextureRotation->setEnabled(show_texture_info && has_pbr_capabilities && has_pbr_material); - gltfCtrlTextureOffsetU->setEnabled(show_texture_info && has_pbr_capabilities && has_pbr_material); - gltfCtrlTextureOffsetV->setEnabled(show_texture_info && has_pbr_capabilities && has_pbr_material); + gltfCtrlTextureScaleU->setEnabled(new_state); + gltfCtrlTextureScaleV->setEnabled(new_state); + gltfCtrlTextureRotation->setEnabled(new_state); + gltfCtrlTextureOffsetU->setEnabled(new_state); + gltfCtrlTextureOffsetV->setEnabled(new_state); - // Control values are set in setMaterialOverridesFromSelection + // Control values will be set once per frame in + // setMaterialOverridesFromSelection + sMaterialOverrideSelection.setDirty(); } } @@ -2821,7 +2824,6 @@ void LLPanelFace::onCommitPbrType(LLUICtrl* ctrl, void* userdata) // and generally reflecting old state when switching tabs or objects // self->updateUI(); - self->setMaterialOverridesFromSelection(); } // static @@ -4768,17 +4770,7 @@ void LLPanelFace::Selection::connect() bool LLPanelFace::Selection::update() { - const bool selection_changed = compareSelection(); - if (selection_changed) - { - clearObjectUpdatePending(); - } - else if (isObjectUpdatePending()) - { - return false; - } - - const bool changed = mChanged; + const bool changed = mChanged || compareSelection(); mChanged = false; return changed; } @@ -4794,16 +4786,9 @@ void LLPanelFace::Selection::onSelectedObjectUpdated(const LLUUID& object_id, S3 if (object_id == mSelectedObjectID && side == mSelectedSide) { mChanged = true; - clearObjectUpdatePending(); } } -void LLPanelFace::Selection::clearObjectUpdatePending() -{ - mPendingObjectID = LLUUID::null; - mPendingSide = -1; -} - bool LLPanelFace::Selection::compareSelection() { if (!mNeedsSelectionCheck) |