Exception when creating neighbour terrains: "ArgumentException: Invalid path"
Steps to reproduce:
- Create a new project in Unity 2019.4.19f1
- Import MapMagic v1.10.9 (Jan 31 2020) from the Asset Store
- Load the Island Tutorial scene
- Click onto the first terrain tail in the hierarchy (Terrain -2,-4).
- Click on the Create Neighbour Terrains button
Expected result: Neighbour terrain created.
Actual result: Flat terrain segement created, with an error in the console:
ArgumentException: Invalid path
System.IO.Path.GetDirectoryName (System.String path) (at <9577ac7a62ef43179789031239ba8798>:0)
UnityEditor.Experimental.TerrainAPI.CreateTerrainTool.CreateNeighbor (UnityEngine.Terrain parent, UnityEngine.Vector3 position) (at <bef6d2fbef1348939b77102b4cf6a6e6>:0)
UnityEditor.Experimental.TerrainAPI.CreateTerrainTool.OnSceneGUI (UnityEngine.Terrain terrain, UnityEditor.Experimental.TerrainAPI.IOnSceneGUI editContext) (at <bef6d2fbef1348939b77102b4cf6a6e6>:0)
UnityEditor.TerrainInspector.OnSceneGUICallback (UnityEditor.SceneView sceneView) (at <bef6d2fbef1348939b77102b4cf6a6e6>:0)
UnityEditor.SceneView.CallOnSceneGUI () (at <bef6d2fbef1348939b77102b4cf6a6e6>:0)
UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at <bef6d2fbef1348939b77102b4cf6a6e6>:0)
UnityEditor.SceneView.OnGUI () (at <bef6d2fbef1348939b77102b4cf6a6e6>:0)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <9577ac7a62ef43179789031239ba8798>: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 <9577ac7a62ef43179789031239ba8798>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <9577ac7a62ef43179789031239ba8798>:0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at <bef6d2fbef1348939b77102b4cf6a6e6>:0)
UnityEditor.HostView.Invoke (System.String methodName) (at <bef6d2fbef1348939b77102b4cf6a6e6>:0)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <bef6d2fbef1348939b77102b4cf6a6e6>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <bef6d2fbef1348939b77102b4cf6a6e6>:0)
UnityEditor.DockArea.OldOnGUI () (at <bef6d2fbef1348939b77102b4cf6a6e6>: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 <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <06214b245dbb4d10a9cefd10639bb04e>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <fe7ee1881b524b0d9443f74417fb598b>:0)
Note that this fails in the same way for DemoScene, IslandTutorial, or indeed if you make a blank scene and create a graph from scratch.