summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelface.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-11-18 21:06:48 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-11-18 21:15:54 +0200
commitade79bc6f6b6269dbcb88f3dff2db6584d0c2f53 (patch)
tree67c1e35b47afa9a80f26f86effe2f9d9ca46379b /indra/newview/llpanelface.cpp
parent32663643c77a931892a2f8e40e011c60bc726d4e (diff)
SL-18677 Disable materials UI when materials caps are not available
Diffstat (limited to 'indra/newview/llpanelface.cpp')
-rw-r--r--indra/newview/llpanelface.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index d620704019..98f7adabd9 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -1774,6 +1774,7 @@ void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material,
has_pbr_material = false;
BOOL editable = objectp->permModify() && !objectp->isPermanentEnforced();
+ bool has_pbr_capabilities = LLMaterialEditor::capabilitiesAvalaible();
// pbr material
LLTextureCtrl* pbr_ctrl = findChild<LLTextureCtrl>("pbr_control");
@@ -1784,13 +1785,14 @@ void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material,
LLSelectedTE::getPbrMaterialId(pbr_id, identical_pbr);
pbr_ctrl->setTentative(identical_pbr ? FALSE : TRUE);
- pbr_ctrl->setEnabled(editable);
+ pbr_ctrl->setEnabled(editable && has_pbr_capabilities);
pbr_ctrl->setImageAssetID(pbr_id);
has_pbr_material = pbr_id.notNull();
}
- getChildView("pbr_from_inventory")->setEnabled(editable);
- getChildView("edit_selected_pbr")->setEnabled(editable && has_pbr_material);
- getChildView("save_selected_pbr")->setEnabled(objectp->permCopy() && has_pbr_material);
+
+ getChildView("pbr_from_inventory")->setEnabled(editable && has_pbr_capabilities);
+ getChildView("edit_selected_pbr")->setEnabled(editable && has_pbr_material && has_pbr_capabilities);
+ getChildView("save_selected_pbr")->setEnabled(objectp->permCopy() && has_pbr_material && has_pbr_capabilities);
const bool show_pbr = mComboMatMedia->getCurrentIndex() == MATMEDIA_PBR && mComboMatMedia->getEnabled();
if (show_pbr)
@@ -1806,11 +1808,11 @@ void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material,
LLUICtrl* gltfCtrlTextureOffsetU = getChild<LLUICtrl>("gltfTextureOffsetU");
LLUICtrl* gltfCtrlTextureOffsetV = getChild<LLUICtrl>("gltfTextureOffsetV");
- gltfCtrlTextureScaleU->setEnabled(show_texture_info);
- gltfCtrlTextureScaleV->setEnabled(show_texture_info);
- gltfCtrlTextureRotation->setEnabled(show_texture_info);
- gltfCtrlTextureOffsetU->setEnabled(show_texture_info);
- gltfCtrlTextureOffsetV->setEnabled(show_texture_info);
+ gltfCtrlTextureScaleU->setEnabled(show_texture_info && has_pbr_capabilities);
+ gltfCtrlTextureScaleV->setEnabled(show_texture_info && has_pbr_capabilities);
+ gltfCtrlTextureRotation->setEnabled(show_texture_info && has_pbr_capabilities);
+ gltfCtrlTextureOffsetU->setEnabled(show_texture_info && has_pbr_capabilities);
+ gltfCtrlTextureOffsetV->setEnabled(show_texture_info && has_pbr_capabilities);
if (show_texture_info)
{
@@ -1823,23 +1825,23 @@ void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material,
readSelectedGLTFMaterial<float>([&](const LLGLTFMaterial* mat)
{
- return mat->mTextureTransform[texture_info].mScale[VX];
+ return mat ? mat->mTextureTransform[texture_info].mScale[VX] : 0.f;
}, transform.mScale[VX], scale_u_same, true, 1e-3f);
readSelectedGLTFMaterial<float>([&](const LLGLTFMaterial* mat)
{
- return mat->mTextureTransform[texture_info].mScale[VY];
+ return mat ? mat->mTextureTransform[texture_info].mScale[VY] : 0.f;
}, transform.mScale[VY], scale_v_same, true, 1e-3f);
readSelectedGLTFMaterial<float>([&](const LLGLTFMaterial* mat)
{
- return mat->mTextureTransform[texture_info].mRotation;
+ return mat ? mat->mTextureTransform[texture_info].mRotation : 0.f;
}, transform.mRotation, rotation_same, true, 1e-3f);
readSelectedGLTFMaterial<float>([&](const LLGLTFMaterial* mat)
{
- return mat->mTextureTransform[texture_info].mOffset[VX];
+ return mat ? mat->mTextureTransform[texture_info].mOffset[VX] : 0.f;
}, transform.mOffset[VX], offset_u_same, true, 1e-3f);
readSelectedGLTFMaterial<float>([&](const LLGLTFMaterial* mat)
{
- return mat->mTextureTransform[texture_info].mOffset[VY];
+ return mat ? mat->mTextureTransform[texture_info].mOffset[VY] : 0.f;
}, transform.mOffset[VY], offset_v_same, true, 1e-3f);
gltfCtrlTextureScaleU->setValue(transform.mScale[VX]);