CustomSkinEditor - Fix exporting models not containing up to date model information

This commit is contained in:
miku-666
2024-05-23 18:50:47 +02:00
parent 56b2236a11
commit b978c640db

View File

@@ -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);
}
}