Bug / Crash NullReferenceException Blueprint Edit - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Cloth (https://obi.virtualmethodstudio.com/forum/forum-2.html) +--- Thread: Bug / Crash NullReferenceException Blueprint Edit (/thread-3698.html) |
NullReferenceException Blueprint Edit - brootas - 14-12-2022 Hello, When I create a Blueprint, I'm able to Generate it, but when I click Edit, I get a NullReferenceException that repeats every few seconds, and the scene that opens is empty. I've switched to the Default layout, and that didn't fix it. I switched projects, tried again, and had the same issue. I'm using MacOS Monterey 12.5.1, and Unity 2022.2.0b10. P.s. I found a similar thread by GinHuang, and even though it was not quite the same problem, I downloaded the patched 'ObiSkinnedClothBlueprint.cs' with fingers crossed but it did not resolve my issue. Here's the error: NullReferenceException: Object reference not set to an instance of an object Obi.ObiActorBlueprintEditor.OnSceneGUI (UnityEditor.SceneView sceneView) (at Assets/Obi/Editor/Common/Blueprints/ObiActorBlueprintEditor.cs:336) UnityEditor.SceneView.CallOnSceneGUI () (at /Users/bokken/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:3780) UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at /Users/bokken/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:2811) UnityEditor.SceneView.DoOnGUI () (at /Users/bokken/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:2481) UnityEditor.SceneView.OnSceneGUI () (at /Users/bokken/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:2322) UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:376) UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:675) UnityEngine.UIElements.IMGUIContainer.DoIMGUIRepaint () (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:535) UnityEngine.UIElements.UIR.RenderChainCommand.ExecuteNonDrawMesh (UnityEngine.UIElements.UIR.DrawParams drawParams, System.Single pixelsPerPoint, System.Exception& immediateException) (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Core/Renderer/UIRenderer/UIRenderers.cs:130) Rethrow as ImmediateModeException UnityEngine.UIElements.UIR.RenderChain.Render () (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Core/Renderer/UIRRenderChain.cs:518) UnityEngine.UIElements.UIRRepaintUpdater.Update () (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Core/Renderer/UIRRepaintUpdater.cs:79) UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Core/VisualTreeUpdater.cs:111) UnityEngine.UIElements.Panel.UpdateForRepaint () (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Core/Panel.cs:997) UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event e) (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Core/Panel.cs:1058) UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Core/UIElementsUtility.cs:453) UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Core/UIElementsUtility.cs:205) UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Core/UIElementsUtility.cs:74) UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at /Users/bokken/buildslave/unity/build/ModuleOverrides/com.unity.ui/Core/UIElementsUtility.cs:28) UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189) RE: NullReferenceException Blueprint Edit - josemendez - 15-12-2022 Hi! Other times I've seen this issue pop up has always been because of a long-standing bug in Unity's editor window layout system: having multiple inspectors open while one of them is locked triggers it, and the usual solution is to reset the layout (as this gets rid of the extra locked inspectors). The line the error refers to accesses "ObiActorBlueprintEditor.currentProperty", which is a list that should be initialized when the inspector window is first instantiated. For some reason, sometimes Unity instantiates the editor window but doesn't call any of the object initializers in the class. As a result, these are null when trying to access them. I'll try to reproduce this with the Unity version you're using and file a bug report with Unity if necessary. If resetting the window layout doesn't work for you, and assuming you're in a production environment, I'd suggest trying a stable Unity version. 2022.2.0b10. is a beta, as such it should be expected to be unstable and contain many bugs. Beta versions should *only* be used for testing/evaluation purposes, never for actual development. kind regards, RE: NullReferenceException Blueprint Edit - brootas - 19-12-2022 I'd reverted to the Default layout, and the issue remained. It's a team / cloud project, and the project leads have everyone upgrade when there's an experimental feature they're interested in, or attempting to fix something broken. We moved off the beta to the '1f1' release now, and I'm pleased to say that fixed it! Thanks! RE: NullReferenceException Blueprint Edit - josemendez - 20-12-2022 (19-12-2022, 07:27 PM)brootas Wrote: We moved off the beta to the '1f1' release now, and I'm pleased to say that fixed it! Thanks! Glad to hear that! Let me know if you stumble upon this issue again. kind regards, RE: NullReferenceException Blueprint Edit - nanimo(null) - 12-06-2023 Got the same bug in Obi Cloth 6.5.2 and Unity 2019.4.40f1 (LTS), also fixed by changing Layout to "2 by 3" A comment in there would be nice, I spent an hour or two digging around for null Selections and Meshes or whatever. Both "Trenchcoat" Obi assets gave me similar bugs. One was in "ObiActorBlueprintEditor" at line 336. currentProperty.OnSceneRepaint(), currentProperty was null. That also seems to be fixed by changing the Layout. RE: NullReferenceException Blueprint Edit - kodra - 02-04-2024 I'm still having a similar bug, except the error is thrown from ObiActorBlueprintEditor's line 416. Obi version: 6.5.4 Unity version: 2022.3.22f1 RE: NullReferenceException Blueprint Edit - josemendez - 02-04-2024 (02-04-2024, 12:31 PM)kodra Wrote: I'm still having a similar bug, except the error is thrown from ObiActorBlueprintEditor's line 416. Hi, This is the exact same error, only that the line number is different because OP was using ObiCloth instead. The solution as explained above is to reset the editor's layout. Unfortunately this is a bug in Unity and we can do nothing to fix it ourselves. Let me know if this helps, kind regards RE: NullReferenceException Blueprint Edit - hgs-interman - 20-04-2024 I also encountered a similar error and reset the layout as suggested in the solution, but it has not resolved the issue. Obi version: 6.5.4 Unity version: 2022.3.25f1 RE: NullReferenceException Blueprint Edit - dramatemple - 24-04-2024 I resolved the issue by changing the Code: currentProperty.OnSceneRepaint(); to Code: if (currentProperty != null) You can find the line around 335 at ObiActorBlueprintEditor.cs |