For some reason Application.dataPath returns c:/… but SaveFileInProject returns C:/…
This causes issue when trying to get relative path in ExportAsset.AssetPathFromFullPath
I’ve fixed it in ExportAsset.cs by replacing line 120 with:
string relativeDirectory = string.Format("Assets{0}", directory.ToLower().Replace(Application.dataPath.ToLower(), ""));
This is not ideal solution since it might not work well on Linux.
Call stack:
UnityException: Creating asset at path AssetsC:/Data/Projects/Assets/sss.asset failed.
UnityEditor.ProBuilder.Actions.ExportAsset.CreateOrReplaceAsset[T] (T asset, System.String path) (at C:/Data/Projects/Volcanoids/Library/PackageCache/com.unity.probuilder@4.1.2/Editor/MenuActions/Export/ExportAsset.cs:307)
UnityEditor.ProBuilder.Actions.ExportAsset.ExportMesh (System.String path, UnityEngine.ProBuilder.ProBuilderMesh mesh, System.Boolean replaceOriginal, System.Boolean batchExport) (at C:/Data/Projects/Volcanoids/Library/PackageCache/com.unity.probuilder@4.1.2/Editor/MenuActions/Export/ExportAsset.cs:287)
UnityEditor.ProBuilder.Actions.ExportAsset.ExportMesh (UnityEngine.ProBuilder.ProBuilderMesh mesh, System.Boolean replaceOriginal) (at C:/Data/Projects/Volcanoids/Library/PackageCache/com.unity.probuilder@4.1.2/Editor/MenuActions/Export/ExportAsset.cs:169)
UnityEditor.ProBuilder.Actions.ExportAsset.ExportWithFileDialog (System.Collections.Generic.IList`1[T] meshes, UnityEditor.ProBuilder.Actions.ExportAssetOptions options) (at C:/Data/Projects/Volcanoids/Library/PackageCache/com.unity.probuilder@4.1.2/Editor/MenuActions/Export/ExportAsset.cs:75)
UnityEditor.ProBuilder.Actions.Export.DoAction () (at C:/Data/Projects/Volcanoids/Library/PackageCache/com.unity.probuilder@4.1.2/Editor/MenuActions/Export/Export.cs:211)
UnityEditor.ProBuilder.Actions.Export.OnSettingsGUI () (at C:/Data/Projects/Volcanoids/Library/PackageCache/com.unity.probuilder@4.1.2/Editor/MenuActions/Export/Export.cs:124)
UnityEditor.ProBuilder.MenuOption.OnGUI () (at C:/Data/Projects/Volcanoids/Library/PackageCache/com.unity.probuilder@4.1.2/Editor/EditorCore/MenuOption.cs:78)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <437ba245d8404784b9fbab9b439ac908>:0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at <3b74787e58694cdda2c241162159b3b7>:0)
UnityEditor.HostView.Invoke (System.String methodName) (at <3b74787e58694cdda2c241162159b3b7>:0)
UnityEditor.HostView.OldOnGUI () (at <3b74787e58694cdda2c241162159b3b7>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Boolean canAffectFocus) (at <3b395df51d304a2aba4944c11905c08f>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Boolean canAffectFocus) (at <3b395df51d304a2aba4944c11905c08f>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <3b395df51d304a2aba4944c11905c08f>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus) (at <3b395df51d304a2aba4944c11905c08f>:0)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <3b395df51d304a2aba4944c11905c08f>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <3b395df51d304a2aba4944c11905c08f>:0)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <3b395df51d304a2aba4944c11905c08f>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <3b395df51d304a2aba4944c11905c08f>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <3b395df51d304a2aba4944c11905c08f>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <3b395df51d304a2aba4944c11905c08f>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <3b395df51d304a2aba4944c11905c08f>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <3b395df51d304a2aba4944c11905c08f>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <3b395df51d304a2aba4944c11905c08f>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <3b395df51d304a2aba4944c11905c08f>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <3b395df51d304a2aba4944c11905c08f>:0)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <3b395df51d304a2aba4944c11905c08f>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <59837000ebf54955a9cb1d31caa86097>:0)