0
Fixed

Missing script fails to render inspector

Architect 2 years ago updated by Lazlo Bonin (Lead Developer) 2 years ago 5

Hi,

   I was referencing my Scriptable Object inside a flow graph and I deleted the Scriptable Objects ".cs" file before I deleted the graph unit and others attached to it. Since then I get this error when I try to open the graph and it won't open:

ArgumentNullException: Argument cannot be null.
Parameter name: subpath
Ludiq.Metadata.Dig[Type,CastMetadata] (System.Type subpath, System.Func`2 constructor, Boolean createInPrefab, Ludiq.Metadata prefabInstance) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Editor/Meta/Metadata.cs:584)
Ludiq.Metadata.Cast (System.Type type) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Editor/Meta/Metadata.cs:1473)
Bolt.LiteralInspector.get_typedValueMetadata ()
Bolt.LiteralInspector.GetAdaptiveWidth ()
Bolt.LiteralWidget.GetHeaderAddonWidth () (at C:/Users/lazlo/Projects/Ludiq/Bolt.Flow/Editor/Options/UnitOption.cs:136)
Bolt.UnitWidget`1[TUnit].CachePosition () (at C:/Users/lazlo/Projects/Ludiq/Bolt.Flow/Editor/Options/UnitOptionTree.cs:204)
Ludiq.Canvas`1[TGraph].CacheWidgetPositions ()
Ludiq.Canvas`1[TGraph].OnGUI ()
Ludiq.GraphWindow.OnGUI ()
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 C:/buildslave/unity/build/Editor/Mono/HostView.cs:295)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:288)
UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:255)

And:
ArgumentNullException: Argument cannot be null.
Parameter name: subpath
Ludiq.Metadata.Dig[Type,CastMetadata] (System.Type subpath, System.Func`2 constructor, Boolean createInPrefab, Ludiq.Metadata prefabInstance) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Editor/Meta/Metadata.cs:584)
Ludiq.Metadata.Cast (System.Type type) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Editor/Meta/Metadata.cs:1473)
Bolt.LiteralInspector.get_typedValueMetadata ()
Bolt.LiteralInspector.GetAdaptiveWidth ()
Bolt.LiteralWidget.GetHeaderAddonWidth () (at C:/Users/lazlo/Projects/Ludiq/Bolt.Flow/Editor/Options/UnitOption.cs:136)
Bolt.UnitWidget`1[TUnit].CachePosition () (at C:/Users/lazlo/Projects/Ludiq/Bolt.Flow/Editor/Options/UnitOptionTree.cs:204)
Ludiq.Canvas`1[TGraph].CacheWidgetPositions ()
Ludiq.Canvas`1[TGraph].OnGUI ()
Ludiq.GraphWindow.OnGUI ()
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 C:/buildslave/unity/build/Editor/Mono/HostView.cs:295)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:288)
UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:255)
Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):

Is there anyway for me to get my flow graph back? A least to see it and copy?

Pending Review

Hi Architect! Sorry you're having this issue. It seems the literal widget can't handle a missing type properly.

I'll look into the bug for v.1.4, but in the mean time, if you want to "save" your graph, send the macro file here and I'll try to edit the JSON manually.

Fixed in Alpha

Will be fixed in 1.4. Literals with missing types should gracefully fallback to a type selector.