pvanallen / delft-ai-toolkit

Tool for Prototyping AI Projects
30 stars 3 forks source link

Deleting an action corrupts graph if 11 or more actions in Action node #16

Closed pvanallen closed 5 years ago

pvanallen commented 5 years ago

If there are 11 or more actions in an Action node, deleting one action will corrupt the display of the graph and generate the following errors.

Screen Shot 2019-03-29 at 11 34 17 AM
NullReferenceException: Object reference not set to an instance of an object
DelftToolkit.ActionsEditor.<OnCreateReorderableList>m__1 (Rect rect, Int32 index, Boolean isActive, Boolean isFocused) (at /Users/Phil/Dropbox/GitHub/delft-toolkit-current/unity/delft-toolkit/Assets/Scripts/delftToolkit/Nodes/Editor/ActionsEditor.cs:79)
UnityEditorInternal.ReorderableList.DoListElements (Rect listRect) (at /Users/builduser/buildslave/unity/build/Editor/Mono/GUI/ReorderableList.cs:587)
UnityEditorInternal.ReorderableList.DoLayoutList () (at /Users/builduser/buildslave/unity/build/Editor/Mono/GUI/ReorderableList.cs:394)
XNodeEditor.NodeEditorGUILayout.InstancePortList (System.String fieldName, System.Type type, UnityEditor.SerializedObject serializedObject, IO io, ConnectionType connectionType, TypeConstraint typeConstraint, System.Action`1 onCreation) (at /Users/Phil/Dropbox/GitHub/delft-toolkit-current/unity/delft-toolkit/Assets/Scripts/delftToolkit/Submodules/xNode/Scripts/Editor/NodeEditorGUILayout.cs:299)
DelftToolkit.ActionsEditor.OnBodyGUI () (at /Users/Phil/Dropbox/GitHub/delft-toolkit-current/unity/delft-toolkit/Assets/Scripts/delftToolkit/Nodes/Editor/ActionsEditor.cs:48)
XNodeEditor.NodeEditorWindow.DrawNodes () (at /Users/Phil/Dropbox/GitHub/delft-toolkit-current/unity/delft-toolkit/Assets/Scripts/delftToolkit/Submodules/xNode/Scripts/Editor/NodeEditorGUI.cs:322)
XNodeEditor.NodeEditorWindow.OnGUI () (at /Users/Phil/Dropbox/GitHub/delft-toolkit-current/unity/delft-toolkit/Assets/Scripts/delftToolkit/Submodules/xNode/Scripts/Editor/NodeEditorGUI.cs:29)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:295)
UnityEditor.HostView.Invoke (System.String methodName) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:288)
UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:255)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

======================================

GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Siccity commented 5 years ago

Sounds like it could have something to do with the way InstancePortList generates dynamic port names, by adding index number separated by a space. Perhaps I'm checking specifically for one-length numbers only somewhere. I'll have a look at it tomorrow

Siccity commented 5 years ago

Most likely related to https://github.com/Siccity/xNode/issues/124

Siccity commented 5 years ago

Fixed an error in https://github.com/Siccity/xNode/commit/af0523db2d5311401f4033ae40ebb71477d9da65 Try pulling latest xNode version and see if the error is fixed

pvanallen commented 5 years ago

yes, that fixes it.