Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. The 2023.1 beta is now available for testing. To find out what's new, have a look at our 2023.1 feature highlights.
    Dismiss Notice

NullRef exception when dragging imported fbx model into scene

Discussion in '2018.3 Beta' started by tylerw-savatronix, Sep 12, 2018.

  1. tylerw-savatronix

    tylerw-savatronix

    Joined:
    Nov 10, 2013
    Posts:
    78
    Hi there,

    I'm not sure exactly what's broken here, but in my pre-existing project (now opened up in 2018.3) every time I try to drag an imported fbx model from the project window into the scene (my intent is to start the process of creating prefabs), I'm getting just tons of null ref exceptions thrown.

    The cursor also turns into the "nope" symbol (circle with diagnal line through it).

    Also of interest is that prefabs I had previously created from the model all broke (the mesh and textures seem to be gone).

    Any idea what's going on here and if it's fixable?

    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.GameObjectInspector.OnSceneDrag (UnityEditor.SceneView sceneView) (at C:/buildslave/unity/build/Editor/Mono/Inspector/GameObjectInspector.cs:816)
    UnityEditor.SceneView.CallEditorDragFunctions () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:2510)
    UnityEditor.SceneView.HandleDragging () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:2525)
    UnityEditor.SceneView.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:1952)
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:335)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:329)
     
  2. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    374
    Yup, same for some (not all) .blend files. Unity actually rewrites the file somehow, looking at the file in the inspector shows it contains one mesh named ‘sphere’ after the bug manifests.

    Reverting in version control fixes the mesh thankfully..
     
  3. Allabreve

    Allabreve

    Joined:
    Jan 17, 2018
    Posts:
    2
    Got the same issue.
    Reimport should help
     
  4. tylerw-savatronix

    tylerw-savatronix

    Joined:
    Nov 10, 2013
    Posts:
    78
    The revert worked for me.

    Seems like a pretty significant bug during the project upgrade process though. Hope it gets addressed.
     
  5. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,045
    Karearea likes this.