Skip to content

Commit

Permalink
[ME] Hide AlphaMask on all body materials, make alpha_a and `alph…
Browse files Browse the repository at this point in the history
…a_b` hidden everywhere (#295)

When copying the body material, the name of the new material becomes something like "cf_m_body.MECopy1". Such a name allows it to escape from previous blacklist rule and expose the properties in Material Editor. Should resolve #228
  • Loading branch information
acezen3d authored Dec 28, 2024
1 parent c03be8e commit d365c42
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/MaterialEditor.Core/Core.MaterialEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using UniRx;
using UnityEngine;
using XUnity.ResourceRedirector;
using System.Text.RegularExpressions;
using static MaterialEditorAPI.MaterialAPI;
#if AI || HS2
using AIChara;
Expand Down Expand Up @@ -886,10 +887,11 @@ private static Shader LoadShader(string shaderName, string assetBundlePath, stri

#if KK || EC || KKS
public override bool CheckBlacklist(string materialName, string propertyName)
{
if (materialName == "cf_m_body" || materialName == "cm_m_body")
if (propertyName == "alpha_a" || propertyName == "alpha_b" || propertyName == "AlphaMask")
return true;
{
if (propertyName == "alpha_a" || propertyName == "alpha_b") return true;

if (Regex.IsMatch(materialName, @"^c[mf]_m_body(" + Regex.Escape(MaterialCopyPostfix) + @"\d+)?$") && propertyName == "AlphaMask") return true;

return false;
}
#endif
Expand Down

0 comments on commit d365c42

Please sign in to comment.