Skip to content
Snippets Groups Projects
Commit e156e3ff authored by Graham Linden's avatar Graham Linden
Browse files

NORSPEC-343 protect against edits that would set non-alpha faces to diffuse alpha mode blend

parent f3952f9a
No related branches found
No related tags found
No related merge requests found
......@@ -258,7 +258,8 @@ class LLPanelFace : public LLPanel
// _panel->isAlpha() "lies" when one face has alpha and the rest do not (NORSPEC-329)
// need to get per-face answer to this question for sane alpha mode retention on updates.
//
U8 default_alpha_mode = object->isImageAlphaBlended(face) ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : LLMaterial::DIFFUSE_ALPHA_MODE_NONE;
bool is_alpha_face = object->isImageAlphaBlended(face);
U8 default_alpha_mode = is_alpha_face ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : LLMaterial::DIFFUSE_ALPHA_MODE_NONE;
if (!current_material.isNull())
{
......@@ -278,6 +279,11 @@ class LLPanelFace : public LLPanel
LLUUID new_normal_map_id = new_material->getNormalID();
LLUUID new_spec_map_id = new_material->getSpecularID();
if ((new_alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND) && !is_alpha_face)
{
new_alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE;
}
bool is_default_blend_mode = (new_alpha_mode == default_alpha_mode);
bool is_need_material = !is_default_blend_mode || !new_normal_map_id.isNull() || !new_spec_map_id.isNull();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment