mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-22 00:19:19 +01:00
Fix model import resetting dirty flag.
This commit is contained in:
parent
12532dee28
commit
e793e7793b
1 changed files with 13 additions and 24 deletions
|
|
@ -35,22 +35,10 @@ public partial class ModEditWindow
|
||||||
|
|
||||||
private void UpdateFile(MdlFile file, bool force)
|
private void UpdateFile(MdlFile file, bool force)
|
||||||
{
|
{
|
||||||
if (file == _lastFile)
|
if (file == _lastFile && !force)
|
||||||
{
|
|
||||||
if (force)
|
|
||||||
UpdateMeshes();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
UpdateMeshes();
|
|
||||||
_lastFile = file;
|
|
||||||
_lodTriCount = Enumerable.Range(0, file.Lods.Length).Select(l => GetTriangleCountForLod(file, l)).ToArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
void UpdateMeshes()
|
_lastFile = file;
|
||||||
{
|
|
||||||
var subMeshTotal = file.Meshes.Aggregate(0, (count, mesh) => count + mesh.SubMeshCount);
|
var subMeshTotal = file.Meshes.Aggregate(0, (count, mesh) => count + mesh.SubMeshCount);
|
||||||
if (_subMeshAttributeTagWidgets.Count != subMeshTotal)
|
if (_subMeshAttributeTagWidgets.Count != subMeshTotal)
|
||||||
{
|
{
|
||||||
|
|
@ -59,15 +47,16 @@ public partial class ModEditWindow
|
||||||
Enumerable.Range(0, subMeshTotal).Select(_ => new TagButtons())
|
Enumerable.Range(0, subMeshTotal).Select(_ => new TagButtons())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
_lodTriCount = Enumerable.Range(0, file.Lods.Length).Select(l => GetTriangleCountForLod(file, l)).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool DrawModelPanel(MdlTab tab, bool disabled)
|
private bool DrawModelPanel(MdlTab tab, bool disabled)
|
||||||
{
|
{
|
||||||
UpdateFile(tab.Mdl, tab.Dirty);
|
var ret = tab.Dirty;
|
||||||
|
UpdateFile(tab.Mdl, ret);
|
||||||
DrawImportExport(tab, disabled);
|
DrawImportExport(tab, disabled);
|
||||||
|
|
||||||
var ret = tab.Dirty;
|
|
||||||
ret |= DrawModelMaterialDetails(tab, disabled);
|
ret |= DrawModelMaterialDetails(tab, disabled);
|
||||||
|
|
||||||
if (ImGui.CollapsingHeader($"Meshes ({_lastFile.Meshes.Length})###meshes"))
|
if (ImGui.CollapsingHeader($"Meshes ({_lastFile.Meshes.Length})###meshes"))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue