0
Need More Information

Undo can cause class to break until gameobject reselected

Elvisish 8 months ago updated 7 months ago 3

Sometimes, when undoing, the graph can vanish (not always) and the inspector changes to this:



Console say:
Inspector block accessor mismatch.
Started GunCam (BoltComponent) [WeaponsAll (BoltClass)].trait.f79bc6e6-0a92-4436-ba71-b6f98d1c6c45, ended GunCam (BoltComponent) [WeaponsAll (BoltClass)].
UnityEngine.Debug:LogWarning(Object)
Ludiq.Inspector:EndBlock(Accessor) (at Assets/Ludiq/Ludiq.Core/Editor/Inspection/Inspector.cs:794)
Ludiq.Inspector:EndBlock() (at Assets/Ludiq/Ludiq.Core/Editor/Inspection/Inspector.cs:779)
Ludiq.Inspector:DrawControl(Rect) (at Assets/Ludiq/Ludiq.Core/Editor/Inspection/Inspector.cs:458)
Ludiq.Inspector:DrawControlLayout(Single) (at Assets/Ludiq/Ludiq.Core/Editor/Inspection/Inspector.cs:858)
Ludiq.Persistent:OnGUI() (at Assets/Ludiq/Ludiq.Core/Editor/Inspection/Root/LudiqRootObjectEditor.cs:48)
Ludiq.PersistentRootEditorWrapper:OnInspectorGUI() (at Assets/Ludiq/Ludiq.Core/Editor/Inspection/PersistentRootEditorWrapper.cs:33)
UnityEditor.EditorApplication:Internal_CallGlobalEventHandler()

Reselecting the object fixes it. I also found a class stopped working properly until Unity was restarted.

PS: There has still been no permanent loss of any graphs since the Undo Bug™ was fixed.
Bolt Version:
2.0.0a10
Unity Version:
2019.3.6f1
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
Bolt 2
Need More Information

Hi Elvishish,

Thanks for the report. Unfortunately, Bolt's own error recovery code here is preventing us from seeing what the root cause is.

You can disable the error recovery by enabling "Developer Mode" in Project Settings > Ludiq Core. Then, you'll get the real error thrown in the console. Then, try your reproduction again and paste the full stack trace. 

Please also give me a step-by-step instruction of how to trigger this on a clean project.

I'll look into maybe removing that error recovery in the future, as it makes bug reports harder to debug.

I'll try that. Undo is just still flakey, I did some undoing during Play mode, and some things broke until restart. Really random seeming stuuff:

Here's one error:

InvalidOperationException: Class Individual Weapon doesn't own graph Fire Weapon Graph#53108523#-1255663360.
Ludiq.Bolt.BoltClass.EnsureOwnsGraph (Ludiq.Bolt.IBoltClassGraph graph) (at Assets/Ludiq/Bolt.Core/Runtime/Architecture/BoltClass.cs:161)
Ludiq.Bolt.BoltClassShellTrait.EnsureValidGraph (Ludiq.Bolt.IBoltClassGraph graph) (at Assets/Ludiq/Bolt.Core/Runtime/Architecture/BoltClassShellTrait.cs:447)
Ludiq.Bolt.BoltClassShellTrait.GetGraphDefinition (Ludiq.Bolt.IBoltClassGraph graph) (at Assets/Ludiq/Bolt.Core/Runtime/Architecture/BoltClassShellTrait.cs:452)
Ludiq.Bolt.BoltClassShellTrait.GetGraphReference (Ludiq.Bolt.IBoltClassGraph graph) (at Assets/Ludiq/Bolt.Core/Runtime/Architecture/BoltClassShellTrait.cs:472)
Ludiq.Bolt.BoltClassShellTraitEditor.GetGraphReference (Ludiq.Bolt.IGraph graph) (at Assets/Ludiq/Bolt.Core/Editor/Architecture/BoltClassShellTraitEditor.cs:69)
Ludiq.Bolt.GraphInspector.OnControlGUI (UnityEngine.Rect position) (at Assets/Ludiq/Bolt.Core/Editor/Inspection/GraphInspector.cs:24)
Ludiq.Inspector.OnFieldGUI (UnityEngine.Rect position) (at Assets/Ludiq/Ludiq.Core/Editor/Inspection/Inspector.cs:245)
Ludiq.Inspector.DrawField (UnityEngine.Rect position, UnityEngine.GUIStyle labelStyle) (at Assets/Ludiq/Ludiq.Core/Editor/Inspection/Inspector.cs:536)
Ludiq.Inspector.DrawField (UnityEngine.Rect parentPosition, System.Single& y) (at Assets/Ludiq/Ludiq.Core/Editor/Inspection/Inspector.cs:548)
Ludiq.Bolt.BoltClassShellTraitEditor.OnInnerGUI (UnityEngine.Rect position) (at Assets/Ludiq/Bolt.Core/Editor/Architecture/BoltClassShellTraitEditor.cs:275)
Ludiq.Editor.OnControlGUI (UnityEngine.Rect position) (at Assets/Ludiq/Ludiq.Core/Editor/Inspection/Editor.cs:222)
Ludiq.Inspector.DrawControl (UnityEngine.Rect position) (at Assets/Ludiq/Ludiq.Core/Editor/Inspection/Inspector.cs:476)
Ludiq.Inspector.DrawControl (UnityEngine.Rect parentPosition, System.Single& y) (at Assets/Ludiq/Ludiq.Core/Editor/Inspection/Inspector.cs:543)
Ludiq.Bolt.BoltClassShellEditor.OnInnerGUI (UnityEngine.Rect position) (at Assets/Ludiq/Bolt.Core/Editor/Architecture/BoltClassShellEditor.cs:29)
Ludiq.Editor.OnControlGUI (UnityEngine.Rect position) (at Assets/Ludiq/Ludiq.Core/Editor/Inspection/Editor.cs:222)
Ludiq.Inspector.DrawControl (UnityEngine.Rect position) (at Assets/Ludiq/Ludiq.Core/Editor/Inspection/Inspector.cs:476)
Ludiq.Inspector.DrawControlLayout (System.Single scrollbarTrigger) (at Assets/Ludiq/Ludiq.Core/Editor/Inspection/Inspector.cs:858)
Ludiq.LudiqRootObjectEditor+Persistent.OnGUI () (at Assets/Ludiq/Ludiq.Core/Editor/Inspection/Root/LudiqRootObjectEditor.cs:48)
Ludiq.PersistentRootEditorWrapper.OnInspectorGUI () (at Assets/Ludiq/Ludiq.Core/Editor/Inspection/PersistentRootEditorWrapper.cs:33)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass55_0.<createimguiinspectorfromeditor>b__0 () (at <3e481e8f36eb4d4c8d94b9ba6b2be438>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
</createimguiinspectorfromeditor>
Odin Serializer Data

Object References: 
0: Ludiq.Bolt.BoltComponent [-43376] "Rocket"
1: Ludiq.Bolt.BoltClass [19268] "IndividualWeapon"
2: UnityEngine.GameObject [18798] "CamPivot"
3: UnityEngine.GameObject [18946] "GunCam"
4: UnityEngine.GameObject [18724] "Camera Anims"
5: UnityEngine.GameObject [19150] "Player"

Nodes: 
StartOfNode: _trait = 0|Ludiq.Bolt.BoltUnityClassShellTrait, Bolt.Core.Runtime
    ExternalReferenceByIndex: shell = 0
    ExternalReferenceByIndex: class = 1
    StartOfNode: variableOverrides = 1|System.Collections.Generic.Dictionary`2[[System.Guid, mscorlib],[System.Object, mscorlib]], mscorlib
        StartOfNode: comparer = 2|System.Collections.Generic.GenericEqualityComparer`1[[System.Guid, mscorlib]], mscorlib
        EndOfNode
        StartOfArray = 11
            StartOfNode
                Guid: $k = 3981ac3e873345698a992f9ed38e8ad8
                StartOfNode: $v = 3|System.Int32, mscorlib
                    Integer = 500
                EndOfNode
            EndOfNode
            StartOfNode
                Guid: $k = 5cf0273a3bf640cf808ef28c6907eb3b
                StartOfNode: $v = 4|System.Int32, mscorlib
                    Integer = 5
                EndOfNode
            EndOfNode
            StartOfNode
                Guid: $k = 661e4bbdf1654ef7b2eea6ef2ca6b2e8
                StartOfNode: $v = 5|System.Int32, mscorlib
                    Integer = 15
                EndOfNode
            EndOfNode
            StartOfNode
                Guid: $k = 494e34a5e80840fd9157a1438096c601
                ExternalReferenceByIndex: $v = 2
            EndOfNode
            StartOfNode
                Guid: $k = 80c87fe8567440bb8d69144fa7110ae7
                StartOfNode: $v = 6|System.String, mscorlib
                    String = Pistol
                EndOfNode
            EndOfNode
            StartOfNode
                Guid: $k = 17f7b83e3a0546d586650b8063e8d459
                StartOfNode: $v = 7|System.Int32, mscorlib
                    Integer = 1
                EndOfNode
            EndOfNode
            StartOfNode
                Guid: $k = 8397d1b1b5fe404baf92ab4543182c66
                StartOfNode: $v = 8|System.Int32, mscorlib
                    Integer = 4
                EndOfNode
            EndOfNode
            StartOfNode
                Guid: $k = 60dea1ac072d4fa793eb8fb1d5eb0a0e
                StartOfNode: $v = 9|System.Boolean, mscorlib
                    Boolean = true
                EndOfNode
            EndOfNode
            StartOfNode
                Guid: $k = 49ff04ed90cd4ac68e98038c0affb0fe
                ExternalReferenceByIndex: $v = 3
            EndOfNode
            StartOfNode
                Guid: $k = 1246235ce3be4f209a2f3586cc282487
                ExternalReferenceByIndex: $v = 4
            EndOfNode
            StartOfNode
                Guid: $k = b83040570a464a4fa3d1ff0fb9227e37
                ExternalReferenceByIndex: $v = 5
            EndOfNode
        EndOfArray
    EndOfNode
EndOfNode

Prefab Modifications Object References: 
(None)

Prefab Modifications: 
(Empty)

(Not sure how helpful that last set of info is) but I get this a lot with undo, I still can't undo really since it pretty much always breaks, but at least nothing dies forever anymore.