Skip to content

Commit

Permalink
Adjust placeholder usage
Browse files Browse the repository at this point in the history
  • Loading branch information
KillzXGaming committed Oct 17, 2024
1 parent bb51ba6 commit c32dbd9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Plugins/CafeLibrary/Bfres/Editing/Nodes/ModelWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,9 @@ public void LoadPreset(string filePath, bool keepTextures = true) {
if (Material.RenderInfos.ContainsKey("gsys_render_state_display_face"))
revertedRenderInfos.Add("gsys_render_state_display_face", Material.RenderInfos["gsys_render_state_display_face"]);

//temp hack, only add placeholders for MK8
bool usePlaceholders = Material.ShaderParams.ContainsKey("gsys_area_env_index_diffuse");

string dir = Path.GetDirectoryName(filePath);
string presetName = Path.GetFileNameWithoutExtension(filePath);

Expand Down Expand Up @@ -1293,7 +1296,7 @@ void AddMaterialAnim(string fileName, Stream stream)
int index = previousSamplers.FindIndex(x => x.Name == Material.Samplers[i].Name);
if (index != -1) //Use the matching index to match up the texture replaced
Material.TextureRefs[i].Name = previousTextures[index].Name;
else //else swap it out with a placeholder texture
else if (usePlaceholders) //else swap it out with a placeholder texture
AddPlaceholderTextures(Material, Material.Samplers[i].Name, i);
}
}
Expand Down Expand Up @@ -1349,7 +1352,7 @@ void AddMaterialAnim(string fileName, Stream stream)
Material.RenderInfos[info.Name] = info;
}

if (!keepTextures)
if (!keepTextures && usePlaceholders)
{
for (int i = 0; i < Material.Samplers.Count; i++)
AddPlaceholderTextures(Material, Material.Samplers[i].Name, i);
Expand Down

0 comments on commit c32dbd9

Please sign in to comment.