Skip to content

Commit

Permalink
Fix changes to tongue and teeth parts not being reset on changing cha…
Browse files Browse the repository at this point in the history
…racters in AI and HS2
  • Loading branch information
DeathWeasel1337 committed Dec 2, 2021
1 parent c4e1ddb commit c13a3d6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ private void CorrectTongue()
if (!ChaControl.hiPoly) return;
#endif

#if KK || EC || KKS
#if KK || EC || KKS || AI || HS2
//Get the tongue material used by the head since this one is properly refreshed with every character reload
Material tongueMat = null;
foreach (var renderer in GetRendererList(ChaControl.objHead.gameObject))
Expand Down
4 changes: 2 additions & 2 deletions src/MaterialEditor.Core/Core.MaterialEditor.Hooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private static void MaterialAPI_GetRendererList_Postfix(ref IEnumerable<Renderer
private static bool MaterialAPI_GetMaterials(ref IEnumerable<Material> __result, GameObject gameObject, Renderer renderer)
{
//Must use sharedMaterials for character objects or it breaks body masks, etc.
#if KK || EC || KKS
#if KK || EC || KKS || AI || HS2
if (gameObject.GetComponent<ChaControl>() && !MaterialEditorPlugin.MouthParts.Contains(renderer.NameFormatted()))
#else
if (gameObject.GetComponent<ChaControl>())
Expand All @@ -144,7 +144,7 @@ private static bool MaterialAPI_GetMaterials(ref IEnumerable<Material> __result,
private static bool MaterialAPI_SetMaterials(GameObject gameObject, Renderer renderer, Material[] materials)
{
//Must use sharedMaterials for character objects or it breaks body masks, etc.
#if KK || EC || KKS
#if KK || EC || KKS || AI || HS2
if (gameObject.GetComponent<ChaControl>() && !MaterialEditorPlugin.MouthParts.Contains(renderer.NameFormatted()))
#else
if (gameObject.GetComponent<ChaControl>())
Expand Down
7 changes: 6 additions & 1 deletion src/MaterialEditor.Core/Core.MaterialEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public partial class MaterialEditorPlugin : MaterialEditorAPI.MaterialEditorPlug
/// <summary>
/// MaterialEditor plugin version
/// </summary>
public const string PluginVersion = "3.1.10";
public const string PluginVersion = "3.1.11";

/// <summary>
/// Material which is used in normal map conversion
Expand Down Expand Up @@ -117,6 +117,11 @@ public partial class MaterialEditorPlugin : MaterialEditorAPI.MaterialEditorPlug
/// Parts of the mouth that need special handling
/// </summary>
public static HashSet<string> MouthParts = new HashSet<string> { "cf_O_tooth", "cf_O_canine", "cf_O_tang", "o_tang", "n_tang" };
#elif AI || HS2
/// <summary>
/// Parts of the mouth that need special handling
/// </summary>
public static HashSet<string> MouthParts = new HashSet<string> { "o_tooth", "o_tang" };
#endif

internal void Main()
Expand Down

0 comments on commit c13a3d6

Please sign in to comment.