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. Dismiss Notice

Bug Error exporting FBX of multiple selected GameObjects

Discussion in 'Asset Importing & Exporting' started by Chryron, Aug 27, 2022.

  1. Chryron

    Chryron

    Joined:
    Aug 27, 2022
    Posts:
    2
    Hi, I'm trying to export a lot of GameObjects as FBX files at their lowest level of detail. If I select all the objects and attempt to export them I get the following error:

    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.Formats.Fbx.Exporter.ModelExporter.ExportTransformHierarchy (UnityEngine.GameObject unityGo, Autodesk.Fbx.FbxScene fbxScene, Autodesk.Fbx.FbxNode fbxNodeParent, System.Int32 exportProgress, System.Int32 objectCount, UnityEngine.Vector3 newCenter, UnityEditor.Formats.Fbx.Exporter.ModelExporter+TransformExportType exportType, UnityEditor.Formats.Fbx.Exporter.ExportSettings+LODExportType lodExportType) (at Library/PackageCache/com.unity.formats.fbx@4.1.2/Editor/FbxExporter.cs:2896)
    UnityEditor.Formats.Fbx.Exporter.ModelExporter.ExportAll (System.Collections.Generic.IEnumerable`1[T] unityExportSet, System.Collections.Generic.Dictionary`2[TKey,TValue] exportData) (at Library/PackageCache/com.unity.formats.fbx@4.1.2/Editor/FbxExporter.cs:3739)
    UnityEditor.Formats.Fbx.Exporter.ModelExporter.ExportObjects (System.String filePath, UnityEngine.Object[] objects, UnityEditor.Formats.Fbx.Exporter.IExportOptions exportOptions, System.Collections.Generic.Dictionary`2[TKey,TValue] exportData) (at Library/PackageCache/com.unity.formats.fbx@4.1.2/Editor/FbxExporter.cs:4607)
    UnityEditor.Formats.Fbx.Exporter.ModelExporter.OnExport () (at Library/PackageCache/com.unity.formats.fbx@4.1.2/Editor/FbxExporter.cs:4533)
    UnityEditor.Formats.Fbx.Exporter.ModelExporter.OnContextItem (UnityEditor.MenuCommand command) (at Library/PackageCache/com.unity.formats.fbx@4.1.2/Editor/FbxExporter.cs:4048)

    I do not get this error if I export objects one at a time or if I export all selected objects at all levels of detail instead of lowest or highest.
     
  2. vkovec

    vkovec

    Unity Developer - FBX Exporter

    Joined:
    Aug 9, 2017
    Posts:
    257
    Hi! is it possible that one of your LODs has a missing renderer in the LOD group? upload_2022-8-30_14-45-25.png

    I'll log a bug to add a null check and catch this exception.
     
  3. Chryron

    Chryron

    Joined:
    Aug 27, 2022
    Posts:
    2
    That was it! Thank you!
     
    vkovec likes this.