USD Export crashes when sub level holds level instance

The engine is crashing when the user tries to export from a persistent level with a sub level that contains a level instance.

Here is part of the crash log, steps to reproduce the error are bellow:

LoginId:259853d34a1b238f3326f38ea0e2d93e
 
Fatal error: [File:E:\stash\UE57\github-unrealengine\Engine\Source\Runtime\CoreUObject\Private\Templates\Casts.cpp] [Line: 10] 
Cast of nullptr to Actor failed
 
 
 
 
UnrealEditor_CoreUObject!CastLogError() [E:\stash\UE57\github-unrealengine\Engine\Source\Runtime\CoreUObject\Private\Templates\Casts.cpp:10]
UnrealEditor_Engine!CastChecked<AActor,ILevelInstanceInterface>() [E:\stash\UE57\github-unrealengine\Engine\Source\Runtime\CoreUObject\Public\Templates\Casts.h:209]
UnrealEditor_Engine!ALevelInstanceEditorInstanceActor::Create() [E:\stash\UE57\github-unrealengine\Engine\Source\Runtime\Engine\Private\LevelInstance\LevelInstanceEditorInstanceActor.cpp:49]
UnrealEditor_Engine!ULevelStreamingLevelInstance::OnCurrentStateChanged() [E:\stash\UE57\github-unrealengine\Engine\Source\Runtime\Engine\Private\LevelInstance\LevelInstanceLevelStreaming.cpp:477]
UnrealEditor_Engine!ULevelStreaming::SetCurrentState() [E:\stash\UE57\github-unrealengine\Engine\Source\Runtime\Engine\Private\LevelStreaming.cpp:608]
UnrealEditor_Engine!ULevelStreaming::UpdateStreamingState() [E:\stash\UE57\github-unrealengine\Engine\Source\Runtime\Engine\Private\LevelStreaming.cpp:1237]
UnrealEditor_Engine!UWorld::UpdateLevelStreaming() [E:\stash\UE57\github-unrealengine\Engine\Source\Runtime\Engine\Private\World.cpp:5045]
UnrealEditor_Engine!UWorld::FlushLevelStreaming() [E:\stash\UE57\github-unrealengine\Engine\Source\Runtime\Engine\Private\World.cpp:5313]
UnrealEditor_USDExporter!UE::UsdConversionBlueprintLibrary::Private::StreamInLevels() [E:\stash\UE57\github-unrealengine\Engine\Plugins\Importers\USDImporter\Source\USDExporter\Private\USDConversionBlueprintLibrary.cpp:162]
UnrealEditor_USDExporter!UUsdConversionBlueprintLibrary::execStreamInRequiredLevels() [E:\stash\UE57\github-unrealengine\Engine\Plugins\Importers\USDImporter\Intermediate\Build\Win64\UnrealEditor\Inc\USDExporter\UHT\USDConversionBlueprintLibrary.gen.cpp:2724]
UnrealEditor_CoreUObject!UFunction::Invoke() [E:\stash\UE57\github-unrealengine\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:7570]
UnrealEditor_CoreUObject!UObject::ProcessEvent() [E:\stash\UE57\github-unrealengine\Engine\Source\Runtime\CoreUObject\Private\UObject\ScriptCore.cpp:2194]
UnrealEditor_PythonScriptPlugin!PyUtil::InvokeFunctionCall() [E:\stash\UE57\github-unrealengine\Engine\Plugins\Experimental\PythonScriptPlugin\Source\PythonScriptPlugin\Private\PyUtil.cpp:578]
UnrealEditor_PythonScriptPlugin!FPyWrapperObject::CallFunction_Impl() [E:\stash\UE57\github-unrealengine\Engine\Plugins\Experimental\PythonScriptPlugin\Source\PythonScriptPlugin\Private\PyWrapperObject.cpp:314]
UnrealEditor_PythonScriptPlugin!FPyWrapperObject::CallClassMethodWithArgs_Impl() [E:\stash\UE57\github-unrealengine\Engine\Plugins\Experimental\PythonScriptPlugin\Source\PythonScriptPlugin\Private\PyWrapperObject.cpp:333]
....

Steps to Reproduce

  1. Create 3 Levels named:
    1. L_LevelInstance
    2. L_LevelHoldingInstance
    3. L_PersistentLevel
  2. In the L_LevelInstance level create a light inside of it
  3. Open the L_LevelHoldingInstance and create a level instance of the L_LevelInstance
  4. Open the L_PersistentLevel and add the L_LevelHoldingInstance as a sub level
  5. Try to export all from “File>Export All” as .usda

Hi Manuel,

Sorry for the late reply.

Thanks for reporting this issue, I created a JIRA , UE-371841, that you could track.

Sorry for the inconvenience.

Regards,

Jean-Luc