From b978c640dbf86380ec87714f31c1702787a0cd2e Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Thu, 23 May 2024 18:50:47 +0200 Subject: [PATCH] CustomSkinEditor - Fix exporting models not containing up to date model information --- PCK-Studio/Forms/Editor/CustomSkinEditor.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PCK-Studio/Forms/Editor/CustomSkinEditor.cs b/PCK-Studio/Forms/Editor/CustomSkinEditor.cs index c99989e3..9dc7afd7 100644 --- a/PCK-Studio/Forms/Editor/CustomSkinEditor.cs +++ b/PCK-Studio/Forms/Editor/CustomSkinEditor.cs @@ -119,6 +119,7 @@ namespace PckStudio.Forms.Editor { var newBox = boxEditor.Result; renderer3D1.ModelData.Add(newBox); + _skin.Model.AdditionalBoxes.Add(newBox); skinPartListBindingSource.ResetBindings(false); if (generateTextureCheckBox.Checked) GenerateUVTextureMap(newBox); @@ -189,7 +190,9 @@ namespace PckStudio.Forms.Editor { if (skinPartListBox.SelectedItem is SkinBOX box) { - renderer3D1.ModelData.Add((SkinBOX)box.Clone()); + var clone = (SkinBOX)box.Clone(); + renderer3D1.ModelData.Add(clone); + _skin.Model.AdditionalBoxes.Add(clone); skinPartListBindingSource.ResetBindings(false); } } @@ -199,6 +202,7 @@ namespace PckStudio.Forms.Editor if (skinPartListBox.SelectedItem is SkinBOX box) { renderer3D1.ModelData.Remove(box); + _skin.Model.AdditionalBoxes.Remove(box); skinPartListBindingSource.ResetBindings(false); } }