Search Issue Tracker

Won't Fix

Votes

0

Found in [Package]

2.0.0a10

2.0.0a13

Issue ID

UVSB-716

Regression

No

Bolt 2a10 Removing macro port breaks graph

Package: Visual Scripting Bugs

-

Original [Issue |https://support.ludiq.io/communities/5/topics/4872-bolt-2a10-removing-macro-port-breaks-graph] - Escalated by Lazlo.

----

Updated Repo Steps:
* Create a new Class and add a flow graph
* Create a new Class and add a macro graph
* Select the output node, right-click and add a new port output
* Drag the macro graph into the flow graph
* Select the output node, right-click and add eight more ports
* Select the output node, right-click and remove one of the ports
Notice issue >> Maco Node in the flow graph brakes.

{code:java}
Failed to define FlowMacroUnit#e4554:
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) [0x0001e] in <fb001e01371b4adca20013e0ac763896>:0
at System.Collections.ObjectModel.KeyedCollection`2[TKey,TItem].get_Item (TKey key) [0x00016] in <fb001e01371b4adca20013e0ac763896>:0
at Unity.Bolt.FlowMacroUnit.ToExternal (Unity.Bolt.ControlInput internal) [0x00000] in /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Runtime/Bolt.Flow/Units/BTS/FlowMacroUnit.cs:266
at Unity.Bolt.FlowMacroUnit.InferRelations () [0x000b1] in /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Runtime/Bolt.Flow/Units/BTS/FlowMacroUnit.cs:306
at Unity.Bolt.FlowMacroUnit.Definition () [0x00155] in /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Runtime/Bolt.Flow/Units/BTS/FlowMacroUnit.cs:134
at Unity.Bolt.Unit`1[TFlowGraph].Define () [0x00030] in /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Runtime/Bolt.Flow/Units/Unit.cs:205
UnityEngine.Debug:LogWarning(Object, Object)
Unity.Bolt.Unit`1:Define() (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Runtime/Bolt.Flow/Units/Unit.cs:221)
Unity.Bolt.BoltMemberUnit`3:OnTypeChanged(Object, PropertyChangedEventArgs) (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Runtime/Bolt.Flow/Units/BTS/BoltMemberUnit.cs:110)
Unity.Bolt.BoltType:OnPropertyChanged(Object, PropertyChangedEventArgs) (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Runtime/Bolt.Core/BTS/BoltType.cs:179)
Unity.Bolt.ParentMergedCollection`3:OnItemPropertyChanged(Object, PropertyChangedEventArgs) (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Runtime/Bolt.Core/Collections/ParentMergedCollection.cs:42)
Unity.Bolt.ParentCollection`3:OnItemPropertyChanged(Object, PropertyChangedEventArgs) (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Runtime/Bolt.Core/Collections/ParentCollection.cs:369)
Unity.Bolt.Graph:OnPropertyChanged(Object, PropertyChangedEventArgs) (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Runtime/Bolt.Core/Graphs/Graph.cs:203)
Unity.Bolt.FlowGraph:OnPropertyChanged(Object, PropertyChangedEventArgs) (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Runtime/Bolt.Flow/Graphs/FlowGraph.cs:59)
Unity.Bolt.FlowGraph:OnDefinitionsChanged(Object, NotifyCollectionChangedEventArgs) (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Runtime/Bolt.Flow/Graphs/FlowGraph.cs:146)
Unity.Bolt.ParentMergedCollection`3:OnCollectionChanged(Object, NotifyCollectionChangedEventArgs) (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Runtime/Bolt.Core/Collections/ParentMergedCollection.cs:53)
Unity.Bolt.ParentCollection`3:OnCollectionChanged(Object, NotifyCollectionChangedEventArgs) (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Runtime/Bolt.Core/Collections/ParentCollection.cs:374)
Unity.Bolt.ParentCollection`3:RemoveItem(Int32) (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Runtime/Bolt.Core/Collections/ParentCollection.cs:138)
System.Collections.ObjectModel.Collection`1:RemoveAt(Int32)
Unity.Bolt.Accessor:RemoveAt(Int32) (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Editor/Bolt.Core/Meta/Accessor.cs:1003)
Unity.Bolt.AccessorListAdaptor:Remove(Int32) (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Editor/Bolt.Core/Inspection/AccessorListAdaptor.cs:128)
Unity.Bolt.ReorderableList.ReorderableListControl:RemoveItem(IReorderableListAdaptor, Int32) (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Editor/Bolt.Core/Dependencies/ReorderableList/ReorderableListControl.cs:2282)
Unity.Bolt.ReorderableList.ReorderableListControl:DrawListItem(Rect, IReorderableListAdaptor, Int32) (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Editor/Bolt.Core/Dependencies/ReorderableList/ReorderableListControl.cs:883)
Unity.Bolt.ReorderableList.ReorderableListControl:DrawListContainerAndItems(Rect, IReorderableListAdaptor) (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Editor/Bolt.Core/Dependencies/ReorderableList/ReorderableListControl.cs:1150)
Unity.Bolt.ReorderableList.ReorderableListControl:Draw(Rect, Int32, IReorderableListAdaptor, DrawEmptyAbsolute) (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Editor/Bolt.Core/Dependencies/ReorderableList/ReorderableListControl.cs:1684)
Unity.Bolt.ReorderableList.ReorderableListControl:Draw(Rect, IReorderableListAdaptor) (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Editor/Bolt.Core/Dependencies/ReorderableList/ReorderableListControl.cs:1720)
Unity.Bolt.AccessorCollectionAdaptor:DrawField(Rect) (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Editor/Bolt.Core/Inspection/AccessorCollectionAdaptor.cs:232)
Unity.Bolt.CollectionInspector:OnFieldGUI(Rect) (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Editor/Bolt.Core/Inspection/Special/CollectionInspector.cs:42)
Unity.Bolt.Inspector:DrawField(Rect, GUIStyle) (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Editor/Bolt.Core/Inspection/Inspector.cs:516)
Unity.Bolt.Inspector:DrawField(Rect, Single&) (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Editor/Bolt.Core/Inspection/Inspector.cs:548)
Unity.Bolt.FlowMacroOutputEditor:OnInnerGUI(Rect) (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Editor/Bolt.Flow/Units/BTS/FlowMacroOutputEditor.cs:37)
Unity.Bolt.Editor:OnControlGUI(Rect) (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Editor/Bolt.Core/Inspection/Editor.cs:222)
Unity.Bolt.Inspector:DrawControl(Rect) (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Editor/Bolt.Core/Inspection/Inspector.cs:456)
Unity.Bolt.GraphInspectorPopup:_OnGUI() (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Editor/Bolt.Core/Windows/GraphInspectorPopup.cs:79)
Unity.Bolt.BoltEditorWindow:OnGUI() (at /Users/johncrowe/WORKSPACE/GITPROJECTS/com.unity.bolt/Packages/com.unity.bolt/Editor/Bolt.Core/Windows/BoltEditorWindow.cs:141)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)
{code}

[Video|https://drive.google.com/drive/folders/1IypVAXVQsM8LzqpnZqHlOrVJ0UQMDyTA?usp=sharing]
----

You can see the reproduction here:

!https://support.ludiq.io/s/attachments/21929/5/437/3ce76c71f3c1e6b2167b8d7591d10f89.gif!
# Create a macro
# Add any output port (control or value, auto created or manually created)
# Connect the port.
# Remove the port via the explorer.
# 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.

 
{code:java}
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>{code}
 

  1. Resolution Note:

    Bolt 2 will not be released as its own product. See https://forum.unity.com/threads/visual-scripting-roadmap-update-august-2020.951675/ for details.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.