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

meow-7.2.2
Graham Linden 2013-08-07 15:37:53 -07:00
parent f3952f9a8d
commit e156e3ff32
1 changed files with 7 additions and 1 deletions

View File

@ -258,7 +258,8 @@ private:
// _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 @@ private:
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();