0
Escalated

Bolt 2a10 Removing macro port breaks graph

Reality.Stop() 11 months ago updated by Lazlo Bonin (Lead Developer) 10 months ago 1

You can see the reproduction here:

  1. Create a macro
  2. Add any output port (control or value, auto created or manually created)
  3. Connect the port.
  4. Remove the port via the explorer.
  5. Experience nuke.

This error state persists through restarts, and is fatal to the graph.  You CAN undo to restore the graph, but David Svezhintsev reports that propagates the nuke to any graphs that have the macro embedded!

At this time the only real solution is to delete the graph.

KeyNotFoundException: The given key was not present in the dictionary.
Ludiq.MergedKeyedCollection`2[TKey,TItem].get_Item (TKey key) (at Assets/Ludiq/Ludiq.Core/Runtime/Collections/MergedKeyedCollection.cs:44)
Ludiq.Bolt.FlowMacroOutputDescriptor.Port (Ludiq.Bolt.IUnitPort port) (at Assets/Ludiq/Bolt.Flow/Editor/Units/Architecture/FlowMacroOutputDescriptor.cs:15)
Ludiq.Bolt.UnitDescriptor`1[TUnit].Ludiq.Bolt.IUnitDescriptor.Port (Ludiq.Bolt.IUnitPort port) (at Assets/Ludiq/Bolt.Flow/Editor/Units/UnitDescriptor.cs:326)
Ludiq.Bolt.XUnitPortDescriptor.Descriptor (Ludiq.Bolt.IUnitPort port) (at Assets/Ludiq/Bolt.Flow/Editor/Ports/IUnitPortDescriptor.cs:35)
Ludiq.Bolt.UnitPortWidget`1[TPort].GetDescriptor () (at Assets/Ludiq/Bolt.Flow/Editor/Ports/UnitPortWidget.cs:21)
Ludiq.Bolt.Widget..ctor (Ludiq.Bolt.IGraphContext context, Ludiq.Bolt.IGraphChild model) (at Assets/Ludiq/Bolt.Core/Editor/Widgets/Widget.cs:70)
Ludiq.Bolt.UnitPortWidget`1[TPort]..ctor (Ludiq.Bolt.FlowGraphContext context, Ludiq.Bolt.InvalidInput port) (at Assets/Ludiq/Bolt.Flow/Editor/Ports/UnitPortWidget.cs:14)
Ludiq.Bolt.InvalidInputWidget..ctor (Ludiq.Bolt.FlowGraphContext context, Ludiq.Bolt.InvalidInput port) (at Assets/Ludiq/Bolt.Flow/Editor/Ports/InvalidInputWidget.cs:11)
System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) (at <437ba245d8404784b9fbab9b439ac908>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Reflection.MonoCMethod.DoInvoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Reflection.MonoCMethod.Invoke (System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) (at <437ba245d8404784b9fbab9b439ac908>:0)
Ludiq.TypeUtility+<>c__DisplayClass15_0.<instantiator>b__1 (System.Object[] args) (at Assets/Ludiq/Ludiq.Core/Runtime/Reflection/TypeUtility.cs:221)
Ludiq.TypeUtility.Instantiate (System.Type type, System.Boolean nonPublic, System.Object[] args) (at Assets/Ludiq/Ludiq.Core/Runtime/Reflection/TypeUtility.cs:250)
Ludiq.Bolt.WidgetProvider.CreateDecorator (System.Type widgetType, Ludiq.Bolt.IGraphChild model) (at Assets/Ludiq/Bolt.Core/Editor/Widgets/WidgetProvider.cs:20)
Ludiq.SingleDecoratorProvider`3[TDecorated,TDecorator,TAttribute].CreateDecorator (TDecorated decorated) (at Assets/Ludiq/Ludiq.Core/Editor/Decorators/SingleDecoratorProvider.cs:45)
Ludiq.SingleDecoratorProvider`3[TDecorated,TDecorator,TAttribute].GetDecorator (TDecorated decorated) (at Assets/Ludiq/Ludiq.Core/Editor/Decorators/SingleDecoratorProvider.cs:294)
Ludiq.Bolt.XWidgetProvider.Widget (Ludiq.Bolt.IGraphContext context, Ludiq.Bolt.IGraphChild model) (at Assets/Ludiq/Bolt.Core/Editor/Widgets/WidgetProvider.cs:28)
Ludiq.Bolt.Canvas+<getwidgets>d__25.MoveNext () (at Assets/Ludiq/Bolt.Core/Editor/Canvases/Canvas.cs:105)
Ludiq.LinqUtility.AddRange[T] (System.Collections.Generic.ICollection`1[T] collection, System.Collections.Generic.IEnumerable`1[T] items) (at Assets/Ludiq/Ludiq.Core/Runtime/Utilities/LinqUtility.cs:133)
Ludiq.Bolt.Canvas.CacheWidgetCollections () (at Assets/Ludiq/Bolt.Core/Editor/Canvases/Canvas.cs:129)
Ludiq.Bolt.Canvas.BeforeFrame () (at Assets/Ludiq/Bolt.Core/Editor/Canvases/Canvas.cs:233)
Ludiq.Bolt.GraphWindow._OnGUI () (at Assets/Ludiq/Bolt.Core/Editor/Windows/GraphWindow.cs:674)
Ludiq.LudiqEditorWindow.OnGUI () (at Assets/Ludiq/Ludiq.Core/Editor/Windows/LudiqEditorWindow.cs:140)
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.
UnityEngine.UIElements.UIR.RenderChain.Render (UnityEngine.Rect viewport, UnityEngine.Matrix4x4 projection, UnityEngine.UIElements.PanelClearFlags clearFlags) (at <57fa7f4ad1c34ed185465e0a9f71c244>:0)
UnityEngine.UIElements.UIRRepaintUpdater.DrawChain (UnityEngine.Rect viewport, UnityEngine.Matrix4x4 projection) (at <57fa7f4ad1c34ed185465e0a9f71c244>:0)
UnityEngine.UIElements.UIRRepaintUpdater.Update () (at <57fa7f4ad1c34ed185465e0a9f71c244>:0)
UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at <57fa7f4ad1c34ed185465e0a9f71c244>:0)
UnityEngine.UIElements.Panel.UpdateForRepaint () (at <57fa7f4ad1c34ed185465e0a9f71c244>:0)
UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event e) (at <57fa7f4ad1c34ed185465e0a9f71c244>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <57fa7f4ad1c34ed185465e0a9f71c244>:0)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <57fa7f4ad1c34ed185465e0a9f71c244>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <59837000ebf54955a9cb1d31caa86097>:0)
</getwidgets></instantiator>
Bolt Version:
Bolt 2 A10
Unity Version:
2019.3.2f1
Platform(s):
Windows
Scripting Backend:
Mono
.NET Version (API Compatibility Level):
.NET 4.x
Bolt 2
Escalated

Hi Reality.Stop(),

Thanks for the report. This is actually very helpful, I had run into it twice but wasn't ever able to reproduce it. Now it should be an easy fix! :)