diff --git a/CHANGELOG.md b/CHANGELOG.md index 755f8d412..9fdec4739 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## Unreleased +### Fixed + +- [UUM-133528] Fixed an issue where using some UV Editor actions would clear a mesh's Lightmap UVs without regenerating them. + ### Changes - Made the ProBuilder Editor actions available in GameObject context in the action overlay. diff --git a/Editor/EditorCore/AutoUVEditor.cs b/Editor/EditorCore/AutoUVEditor.cs index 0ae9497e7..5c9a9b9ff 100644 --- a/Editor/EditorCore/AutoUVEditor.cs +++ b/Editor/EditorCore/AutoUVEditor.cs @@ -214,26 +214,12 @@ public static bool OnGUI(ProBuilderMesh[] selection, float width) { for (int i = 0; i < selection.Length; i++) TextureGroupSelectedFaces(selection[i]); - - ProBuilderEditor.Refresh(); } if (GUILayout.Button(gc_BreakSelected)) { SetTextureGroup(selection, -1); - - foreach (var kvp in MeshSelection.selectedFacesInEditZone) - { - kvp.Key.ToMesh(); - kvp.Key.Refresh(); - kvp.Key.Optimize(); - } - - SceneView.RepaintAll(); - s_AutoUVSettingsDiff["textureGroup"] = false; - - ProBuilderEditor.Refresh(); } /* Select all in current texture group */ @@ -241,8 +227,6 @@ public static bool OnGUI(ProBuilderMesh[] selection, float width) { for (int i = 0; i < selection.Length; i++) selection[i].SetSelectedFaces(System.Array.FindAll(selection[i].facesInternal, x => x.textureGroup == textureGroup)); - - ProBuilderEditor.Refresh(); } if (GUILayout.Button(gc_Reset)) @@ -260,8 +244,6 @@ public static bool OnGUI(ProBuilderMesh[] selection, float width) UVEditing.SplitUVs(selection[i], selection[i].GetSelectedFaces()); } - - ProBuilderEditor.Refresh(); } GUI.backgroundColor = PreferenceKeys.proBuilderLightGray; diff --git a/Editor/EditorCore/UVEditor.cs b/Editor/EditorCore/UVEditor.cs index 69ea72e06..1b599bfc3 100644 --- a/Editor/EditorCore/UVEditor.cs +++ b/Editor/EditorCore/UVEditor.cs @@ -2617,7 +2617,10 @@ void DrawAutoModeUI() { pb.ToMesh(); pb.Refresh(); + pb.Optimize(); } + ProBuilderEditor.Refresh(); + SceneView.RepaintAll(); } foreach (var kvp in MeshSelection.selectedFacesInEditZone)