Jump to content

Couldn't add object to asset file because the Mesh 'M0_L0_0' is already an asset


mroshaw
Go to solution Solved by Manny,

Recommended Posts

Hi again,

 

More exceptions from Scene Optimizer. Just trying to optimise a very simple, small scene with a building and some stones.

 

Again, I have no idea whether Scene Optimizer has corrupted my scene, or what. It's not working, though.

Couldn't add object to asset file because the Mesh 'M0_L0_0' is already an asset at 'Assets/SO_UserData/OptimizedObjects/GameWorldScene/Small Objects/SP0/LG0/M0_L0_0.asset'!
UnityEngine.StackTraceUtility:ExtractStackTrace ()
ProceduralWorlds.SceneOptimizer.EditorEvents:EditorSaveMeshToDisk (UnityEngine.SceneManagement.Scene,UnityEngine.Mesh) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Utilities/EditorEvents.cs:103)
ProceduralWorlds.SceneOptimizer.SceneOptimizer:PostProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.OptimizeCall,bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Runtime/SceneOptimizer.cs:106)
ProceduralWorlds.SceneOptimizer.SceneOptimizer:ProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.OptimizeCall,bool,bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Runtime/SceneOptimizer.cs:49)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor:PerformSceneOptimization (bool,bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:194)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor:SceneOptimizationPanel (bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:582)
PWCommon5.EditorUtils:Panel (UnityEngine.GUIContent,string,System.Action`1<bool>,UnityEngine.GUIStyle,bool,bool,bool,UnityEngine.GUILayoutOption[])
PWCommon5.EditorUtils:Panel (UnityEngine.GUIContent,string,System.Action`1<bool>,bool,bool,bool,UnityEngine.GUILayoutOption[])
PWCommon5.EditorUtils:Panel (string,System.Action`1<bool>,bool,UnityEngine.GUILayoutOption[])
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor:OnInspectorGUI () (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:128)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditorWindow:OnGUI () (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Windows/SceneOptimizerEditorWindow.cs:148)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

 

 

UnityException: Creating asset at path Assets/SO_UserData/OptimizedObjects/GameWorldScene/M0_L0_0.asset failed.
ProceduralWorlds.SceneOptimizer.EditorEvents.EditorSaveMeshToDisk (UnityEngine.SceneManagement.Scene scene, UnityEngine.Mesh sharedMesh) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Utilities/EditorEvents.cs:103)
ProceduralWorlds.SceneOptimizer.SceneOptimizer.PostProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.OptimizeCall optimizeCall, System.Boolean recordUndo) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Runtime/SceneOptimizer.cs:106)
ProceduralWorlds.SceneOptimizer.SceneOptimizer.ProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.OptimizeCall optimizeCall, System.Boolean useGaia, System.Boolean recordUndo) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Runtime/SceneOptimizer.cs:49)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor.PerformSceneOptimization (System.Boolean useGaia, System.Boolean recordUndo) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:194)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor.SceneOptimizationPanel (System.Boolean helpEnabled) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:582)
PWCommon5.EditorUtils.Panel (UnityEngine.GUIContent panelLabel, System.String helpKey, System.Action`1[T] contentMethod, UnityEngine.GUIStyle labelStyle, System.Boolean ignoreGuiChange, System.Boolean defaultStatus, System.Boolean showVersionNumber, UnityEngine.GUILayoutOption[] options) (at <5e780e565d3b4b63836c767b4e8e9d7f>:0)
PWCommon5.EditorUtils.Panel (UnityEngine.GUIContent panelLabel, System.String helpKey, System.Action`1[T] contentMethod, System.Boolean ignoreGuiChange, System.Boolean defaultStatus, System.Boolean showVersionNumber, UnityEngine.GUILayoutOption[] options) (at <5e780e565d3b4b63836c767b4e8e9d7f>:0)
PWCommon5.EditorUtils.Panel (System.String nameKey, System.Action`1[T] contentMethod, System.Boolean defaultStatus, UnityEngine.GUILayoutOption[] options) (at <5e780e565d3b4b63836c767b4e8e9d7f>:0)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor.OnInspectorGUI () (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:128)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditorWindow.OnGUI () (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Windows/SceneOptimizerEditorWindow.cs:148)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition) (at <11d97693183d4a6bb35c29ae7882c66b>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect dockAreaRect) (at <11d97693183d4a6bb35c29ae7882c66b>:0)
UnityEditor.DockArea.OldOnGUI () (at <11d97693183d4a6bb35c29ae7882c66b>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <44335255efcb428fb633c913db3eed7a>:0)

 

Thanks again!

Link to comment
On 1/20/2023 at 12:25 PM, mroshaw said:

Hi again,

 

More exceptions from Scene Optimizer. Just trying to optimise a very simple, small scene with a building and some stones.

 

Again, I have no idea whether Scene Optimizer has corrupted my scene, or what. It's not working, though.

Couldn't add object to asset file because the Mesh 'M0_L0_0' is already an asset at 'Assets/SO_UserData/OptimizedObjects/GameWorldScene/Small Objects/SP0/LG0/M0_L0_0.asset'!
UnityEngine.StackTraceUtility:ExtractStackTrace ()
ProceduralWorlds.SceneOptimizer.EditorEvents:EditorSaveMeshToDisk (UnityEngine.SceneManagement.Scene,UnityEngine.Mesh) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Utilities/EditorEvents.cs:103)
ProceduralWorlds.SceneOptimizer.SceneOptimizer:PostProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.OptimizeCall,bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Runtime/SceneOptimizer.cs:106)
ProceduralWorlds.SceneOptimizer.SceneOptimizer:ProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.OptimizeCall,bool,bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Runtime/SceneOptimizer.cs:49)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor:PerformSceneOptimization (bool,bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:194)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor:SceneOptimizationPanel (bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:582)
PWCommon5.EditorUtils:Panel (UnityEngine.GUIContent,string,System.Action`1<bool>,UnityEngine.GUIStyle,bool,bool,bool,UnityEngine.GUILayoutOption[])
PWCommon5.EditorUtils:Panel (UnityEngine.GUIContent,string,System.Action`1<bool>,bool,bool,bool,UnityEngine.GUILayoutOption[])
PWCommon5.EditorUtils:Panel (string,System.Action`1<bool>,bool,UnityEngine.GUILayoutOption[])
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor:OnInspectorGUI () (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:128)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditorWindow:OnGUI () (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Windows/SceneOptimizerEditorWindow.cs:148)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

 

 

UnityException: Creating asset at path Assets/SO_UserData/OptimizedObjects/GameWorldScene/M0_L0_0.asset failed.
ProceduralWorlds.SceneOptimizer.EditorEvents.EditorSaveMeshToDisk (UnityEngine.SceneManagement.Scene scene, UnityEngine.Mesh sharedMesh) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Utilities/EditorEvents.cs:103)
ProceduralWorlds.SceneOptimizer.SceneOptimizer.PostProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.OptimizeCall optimizeCall, System.Boolean recordUndo) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Runtime/SceneOptimizer.cs:106)
ProceduralWorlds.SceneOptimizer.SceneOptimizer.ProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.OptimizeCall optimizeCall, System.Boolean useGaia, System.Boolean recordUndo) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Runtime/SceneOptimizer.cs:49)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor.PerformSceneOptimization (System.Boolean useGaia, System.Boolean recordUndo) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:194)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor.SceneOptimizationPanel (System.Boolean helpEnabled) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:582)
PWCommon5.EditorUtils.Panel (UnityEngine.GUIContent panelLabel, System.String helpKey, System.Action`1[T] contentMethod, UnityEngine.GUIStyle labelStyle, System.Boolean ignoreGuiChange, System.Boolean defaultStatus, System.Boolean showVersionNumber, UnityEngine.GUILayoutOption[] options) (at <5e780e565d3b4b63836c767b4e8e9d7f>:0)
PWCommon5.EditorUtils.Panel (UnityEngine.GUIContent panelLabel, System.String helpKey, System.Action`1[T] contentMethod, System.Boolean ignoreGuiChange, System.Boolean defaultStatus, System.Boolean showVersionNumber, UnityEngine.GUILayoutOption[] options) (at <5e780e565d3b4b63836c767b4e8e9d7f>:0)
PWCommon5.EditorUtils.Panel (System.String nameKey, System.Action`1[T] contentMethod, System.Boolean defaultStatus, UnityEngine.GUILayoutOption[] options) (at <5e780e565d3b4b63836c767b4e8e9d7f>:0)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor.OnInspectorGUI () (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:128)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditorWindow.OnGUI () (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Windows/SceneOptimizerEditorWindow.cs:148)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition) (at <11d97693183d4a6bb35c29ae7882c66b>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect dockAreaRect) (at <11d97693183d4a6bb35c29ae7882c66b>:0)
UnityEditor.DockArea.OldOnGUI () (at <11d97693183d4a6bb35c29ae7882c66b>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <44335255efcb428fb633c913db3eed7a>:0)

 

Thanks again!


Hey @mroshaw,

I'm mid-way through investigating this issue and others you have mentioned, and I really appreciate your patience in the matter. I will be back in office tomorrow to finalize these changes, so I really appreciate your patience in the matter.  

Link to comment
On 1/20/2023 at 12:25 PM, mroshaw said:

Hi again,

 

More exceptions from Scene Optimizer. Just trying to optimise a very simple, small scene with a building and some stones.

 

Again, I have no idea whether Scene Optimizer has corrupted my scene, or what. It's not working, though.

Couldn't add object to asset file because the Mesh 'M0_L0_0' is already an asset at 'Assets/SO_UserData/OptimizedObjects/GameWorldScene/Small Objects/SP0/LG0/M0_L0_0.asset'!
UnityEngine.StackTraceUtility:ExtractStackTrace ()
ProceduralWorlds.SceneOptimizer.EditorEvents:EditorSaveMeshToDisk (UnityEngine.SceneManagement.Scene,UnityEngine.Mesh) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Utilities/EditorEvents.cs:103)
ProceduralWorlds.SceneOptimizer.SceneOptimizer:PostProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.OptimizeCall,bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Runtime/SceneOptimizer.cs:106)
ProceduralWorlds.SceneOptimizer.SceneOptimizer:ProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.OptimizeCall,bool,bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Runtime/SceneOptimizer.cs:49)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor:PerformSceneOptimization (bool,bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:194)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor:SceneOptimizationPanel (bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:582)
PWCommon5.EditorUtils:Panel (UnityEngine.GUIContent,string,System.Action`1<bool>,UnityEngine.GUIStyle,bool,bool,bool,UnityEngine.GUILayoutOption[])
PWCommon5.EditorUtils:Panel (UnityEngine.GUIContent,string,System.Action`1<bool>,bool,bool,bool,UnityEngine.GUILayoutOption[])
PWCommon5.EditorUtils:Panel (string,System.Action`1<bool>,bool,UnityEngine.GUILayoutOption[])
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor:OnInspectorGUI () (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:128)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditorWindow:OnGUI () (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Windows/SceneOptimizerEditorWindow.cs:148)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

 

 

UnityException: Creating asset at path Assets/SO_UserData/OptimizedObjects/GameWorldScene/M0_L0_0.asset failed.
ProceduralWorlds.SceneOptimizer.EditorEvents.EditorSaveMeshToDisk (UnityEngine.SceneManagement.Scene scene, UnityEngine.Mesh sharedMesh) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Utilities/EditorEvents.cs:103)
ProceduralWorlds.SceneOptimizer.SceneOptimizer.PostProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.OptimizeCall optimizeCall, System.Boolean recordUndo) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Runtime/SceneOptimizer.cs:106)
ProceduralWorlds.SceneOptimizer.SceneOptimizer.ProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.OptimizeCall optimizeCall, System.Boolean useGaia, System.Boolean recordUndo) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Runtime/SceneOptimizer.cs:49)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor.PerformSceneOptimization (System.Boolean useGaia, System.Boolean recordUndo) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:194)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor.SceneOptimizationPanel (System.Boolean helpEnabled) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:582)
PWCommon5.EditorUtils.Panel (UnityEngine.GUIContent panelLabel, System.String helpKey, System.Action`1[T] contentMethod, UnityEngine.GUIStyle labelStyle, System.Boolean ignoreGuiChange, System.Boolean defaultStatus, System.Boolean showVersionNumber, UnityEngine.GUILayoutOption[] options) (at <5e780e565d3b4b63836c767b4e8e9d7f>:0)
PWCommon5.EditorUtils.Panel (UnityEngine.GUIContent panelLabel, System.String helpKey, System.Action`1[T] contentMethod, System.Boolean ignoreGuiChange, System.Boolean defaultStatus, System.Boolean showVersionNumber, UnityEngine.GUILayoutOption[] options) (at <5e780e565d3b4b63836c767b4e8e9d7f>:0)
PWCommon5.EditorUtils.Panel (System.String nameKey, System.Action`1[T] contentMethod, System.Boolean defaultStatus, UnityEngine.GUILayoutOption[] options) (at <5e780e565d3b4b63836c767b4e8e9d7f>:0)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor.OnInspectorGUI () (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:128)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditorWindow.OnGUI () (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Windows/SceneOptimizerEditorWindow.cs:148)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition) (at <11d97693183d4a6bb35c29ae7882c66b>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect dockAreaRect) (at <11d97693183d4a6bb35c29ae7882c66b>:0)
UnityEditor.DockArea.OldOnGUI () (at <11d97693183d4a6bb35c29ae7882c66b>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <8759e14def7c40b68c657c638e8a0434>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <44335255efcb428fb633c913db3eed7a>:0)

 

Thanks again!

Hey @mroshaw,

In order for me to investigate and fix this issue properly, I just need you to try a few things first. 
- Could you delete the 'SO_UserData' folder and Optimize the Scene again? 
- Are you able to identify what objects this is happening to?
- Are you using the Nature Manufacture Assets?

I will attempt to fix this in a timely manner once I hear your response.

 

Link to comment

Hey Manny,

 

I've deleted "SO_UserData", re-run Optimization, and no errors from Scene Optimizer!

 

I was able to optimize the whole demo Graveyard scene without errors - only after turning off all of the LOD options.

 

While I was able to see a pretty decent improvement in performance in the editor, I actually saw a decrease in performance in build:

Editor:

 

image.thumb.png.dbe5c4023203163145998f8b7742c666.png

Build:

 

image.thumb.png.b818cfd585d6f91a35291b75a59449ef.png

 

Any idea why that is? Just the luck of the draw? Seemed like a good "test" of the optimiser to me.

 

 

 

 

Link to comment
6 hours ago, mroshaw said:

Hey Manny,

 

I've deleted "SO_UserData", re-run Optimization, and no errors from Scene Optimizer!

 

I was able to optimize the whole demo Graveyard scene without errors - only after turning off all of the LOD options.

 

While I was able to see a pretty decent improvement in performance in the editor, I actually saw a decrease in performance in build:

Editor:

 

image.thumb.png.dbe5c4023203163145998f8b7742c666.png

Build:

 

image.thumb.png.b818cfd585d6f91a35291b75a59449ef.png

 

Any idea why that is? Just the luck of the draw? Seemed like a good "test" of the optimiser to me.

 

 

 

 

Hmmm that is interesting that you didn't experience much of a performance without the lod options. Could you show me just the section of where you changed the LOD settings? Curious to try this scenario myself.

Link to comment

Also, when you get a chance, could you confirm if the old objects that you optimized are still in the Scene? Sometimes, Unity does some weird things with objects that are disabled in the scene but not being used.

Link to comment

Hey @mroshaw

A new version of Scene Optimizer has been released just now. Please download the latest and let me know here if this issue still persists! 👍

Link to comment
  • 1 month later...

Hey @Manny!

Been a while, but I'd given up on Scene Optimizer for a bit.

I've just downloaded the newest version (1.1.3) and have tried once again to optimize my scene. I'm still getting failures:

Couldn't add object to asset file because the Mesh 'M0_L24_0' is already an asset at 'Assets/SO_UserData/OptimizedObjects/GameScene/Medium Objects/SP0/LG0/M0_L24_0.asset'!
UnityEngine.StackTraceUtility:ExtractStackTrace ()
ProceduralWorlds.SceneOptimizer.EditorEvents:EditorSaveMeshToDisk (UnityEngine.SceneManagement.Scene,UnityEngine.Mesh) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Utilities/EditorEvents.cs:103)
ProceduralWorlds.SceneOptimizer.SceneOptimizer:PostProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.OptimizeCall,bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Runtime/SceneOptimizer.cs:106)
ProceduralWorlds.SceneOptimizer.SceneOptimizer:ProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.OptimizeCall,bool,bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Runtime/SceneOptimizer.cs:49)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor:PerformSceneOptimization (bool,bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:194)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor:SceneOptimizationPanel (bool) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:582)
PWCommon5.EditorUtils:Panel (UnityEngine.GUIContent,string,System.Action`1<bool>,UnityEngine.GUIStyle,bool,bool,bool,UnityEngine.GUILayoutOption[])
PWCommon5.EditorUtils:Panel (UnityEngine.GUIContent,string,System.Action`1<bool>,bool,bool,bool,UnityEngine.GUILayoutOption[])
PWCommon5.EditorUtils:Panel (string,System.Action`1<bool>,bool,UnityEngine.GUILayoutOption[])
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor:OnInspectorGUI () (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:128)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditorWindow:OnGUI () (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Windows/SceneOptimizerEditorWindow.cs:148)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
UnityException: Creating asset at path Assets/SO_UserData/OptimizedObjects/GameScene/M0_L24_0.asset failed.
ProceduralWorlds.SceneOptimizer.EditorEvents.EditorSaveMeshToDisk (UnityEngine.SceneManagement.Scene scene, UnityEngine.Mesh sharedMesh) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Utilities/EditorEvents.cs:103)
ProceduralWorlds.SceneOptimizer.SceneOptimizer.PostProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.OptimizeCall optimizeCall, System.Boolean recordUndo) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Runtime/SceneOptimizer.cs:106)
ProceduralWorlds.SceneOptimizer.SceneOptimizer.ProcessSceneOptimization (ProceduralWorlds.SceneOptimizer.OptimizeCall optimizeCall, System.Boolean useGaia, System.Boolean recordUndo) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Runtime/SceneOptimizer.cs:49)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor.PerformSceneOptimization (System.Boolean useGaia, System.Boolean recordUndo) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:194)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor.SceneOptimizationPanel (System.Boolean helpEnabled) (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:582)
PWCommon5.EditorUtils.Panel (UnityEngine.GUIContent panelLabel, System.String helpKey, System.Action`1[T] contentMethod, UnityEngine.GUIStyle labelStyle, System.Boolean ignoreGuiChange, System.Boolean defaultStatus, System.Boolean showVersionNumber, UnityEngine.GUILayoutOption[] options) (at <5e780e565d3b4b63836c767b4e8e9d7f>:0)
PWCommon5.EditorUtils.Panel (UnityEngine.GUIContent panelLabel, System.String helpKey, System.Action`1[T] contentMethod, System.Boolean ignoreGuiChange, System.Boolean defaultStatus, System.Boolean showVersionNumber, UnityEngine.GUILayoutOption[] options) (at <5e780e565d3b4b63836c767b4e8e9d7f>:0)
PWCommon5.EditorUtils.Panel (System.String nameKey, System.Action`1[T] contentMethod, System.Boolean defaultStatus, UnityEngine.GUILayoutOption[] options) (at <5e780e565d3b4b63836c767b4e8e9d7f>:0)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditor.OnInspectorGUI () (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Tools/SceneOptimizerEditor.cs:128)
ProceduralWorlds.SceneOptimizer.SceneOptimizerEditorWindow.OnGUI () (at Assets/Procedural Worlds/Scene Optimizer/Scripts/Editor/Windows/SceneOptimizerEditorWindow.cs:148)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition) (at <6e08e61cfda04255b3972ba7f0515fae>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect dockAreaRect) (at <6e08e61cfda04255b3972ba7f0515fae>:0)
UnityEditor.DockArea.OldOnGUI () (at <6e08e61cfda04255b3972ba7f0515fae>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <2880c19c3b344d8cb20d5ad03e3efbe5>:0)

 

Link to comment

I don't think I've managed to get Scene Optimizer to run once without throwing exceptions. I've probably spent more time pouring over error logs than I would have spent manually optimizing the scene! There must be a reason for this exception, and could it at least be caught and handled, rather than have the whole process fall over half way through? I leaves the scene in a mess.

Any ideas on next steps?

Given this ticket is quite old, do you want me to raise a new one?

Link to comment

I had a look at the offending method, and made a small change:

private static Mesh EditorSaveMeshToDisk(Scene scene, Mesh sharedMesh)
{
    // Existing code...
    // ...

    // New code
    sharedMesh.name = Path.GetFileNameWithoutExtension(filePath);

    // Check if asset already in AssetDatabase
    string existingPath = AssetDatabase.GetAssetPath(sharedMesh);

    if (String.IsNullOrEmpty(existingPath))
    {
        AssetDatabase.CreateAsset(sharedMesh, filePath);
    }
    else
    {
        // Asset already exists, return the existing path 
        filePath = existingPath;
    }

    // Existing code...
    return AssetDatabase.LoadAssetAtPath<Mesh>(filePath);
}
Link to comment
  • 2 weeks later...
  • Solution

Hi @mroshaw,

Thank you so much for your patience.
I have thoroughly investigated the situation you have described over the last few hours and I can safely say that you were definitely on the right track with the edit you made so well done!

However, just a slight edit. It is definitely preferred that we 'overwrite' the asset instead of loading the existing one on save and the reason for this is because if the mesh size changes for performance reasons, those changes would not be reflected if we just load the asset itself. 

In this case, this is why we want to overwrite the file. But this is not an easy task as Unity does not provide such a method for overwriting natively. Their documentation does suggest that you would need to delete the existing asset and create a new one. Which is exactly what will be in the latest releases.

For documentation purposes, here is the newly edited public method:
image.png

Hope this helps! Stay tuned for a later update this week 🙂

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...