diff --git a/PCK-Studio/Forms/Editor/ModelEditor.cs b/PCK-Studio/Forms/Editor/ModelEditor.cs index 0beae32b..a83c9ec0 100644 --- a/PCK-Studio/Forms/Editor/ModelEditor.cs +++ b/PCK-Studio/Forms/Editor/ModelEditor.cs @@ -39,6 +39,8 @@ namespace PckStudio.Forms.Editor modelTreeView.ImageList.Images.AddRange(ApplicationScope.EntityImages); } + internal ModelContainer GetModelContainer() => _models; + private const int InvalidImageIndex = 127; // TODO: move to json file. -miku private static Dictionary ModelImageIndex = new Dictionary() diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 9109ebcc..afe33442 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -755,6 +755,9 @@ namespace PckStudio var editor = new ModelEditor(modelContainer, TryGetSet.FromDelegates(tryGetTexture, trySetTexture), TryGet.FromDelegate(entityMaterials.TryGetValue)); if (editor.ShowDialog() == DialogResult.OK) { + asset.SetData(new ModelFileWriter(editor.GetModelContainer(), modelContainer.Version)); + BuildMainTreeView(); + wasModified = true; return; } }