ImportAssets commandlet crash when using -nosourcecontrol flag

Hi,

I’m using UE 4.14.3.

I’m trying to import an FBX file into Unreal using the ImportAssets commandlet. I don’t want to use any source control, but I cannot get it to work unless I setup the source control in the unreal project, even when using the ImportAssets -nosourcecontrol flag.

Running the following command causes the crash below. If I remove the -nosourcecontrol flag and the unreal project is setup with source control, the commandlet works OK. Is there a way to run the commandlet without source control?

UE4Editor-Cmd.exe “[PATH_TO_UPROJECT_FILE]” -run=ImportAssets -source="[PATH_TO_FBX_FILE]" -dest="/Game/MyFBXAsset" -importsettings="" -nosourcecontrol

Crash log:

[2017.01.12-13.09.48:620][ 0]LogShaderCompilers:Display: Using Local Shader Compiler.

[2017.01.12-13.09.50:128][ 0]LogTemp:Display: Loaded TP AllDesktopTargetPlatform

[2017.01.12-13.09.50:236][ 0]LogTemp:Display: Loaded TP MacClientTargetPlatform

[2017.01.12-13.09.50:339][ 0]LogTemp:Display: Loaded TP MacNoEditorTargetPlatform

[2017.01.12-13.09.50:444][ 0]LogTemp:Display: Loaded TP MacServerTargetPlatform

[2017.01.12-13.09.50:547][ 0]LogTemp:Display: Loaded TP MacTargetPlatform

[2017.01.12-13.09.50:650][ 0]LogTemp:Display: Loaded TP WindowsClientTargetPlatform

[2017.01.12-13.09.50:752][ 0]LogTemp:Display: Loaded TP WindowsNoEditorTargetPlatform

[2017.01.12-13.09.50:855][ 0]LogTemp:Display: Loaded TP WindowsServerTargetPlatform

[2017.01.12-13.09.50:940][ 0]LogTemp:Display: Loaded TP WindowsTargetPlatform

[2017.01.12-13.09.51:043][ 0]LogTemp:Display: Loaded TP AndroidTargetPlatform

[2017.01.12-13.09.51:146][ 0]LogTemp:Display: Loaded TP Android_ASTCTargetPlatform

[2017.01.12-13.09.51:250][ 0]LogTemp:Display: Loaded TP Android_ATCTargetPlatform

[2017.01.12-13.09.51:351][ 0]LogTemp:Display: Loaded TP Android_DXTTargetPlatform

[2017.01.12-13.09.51:454][ 0]LogTemp:Display: Loaded TP Android_ETC1TargetPlatform

[2017.01.12-13.09.51:555][ 0]LogTemp:Display: Loaded TP Android_ETC2TargetPlatform

[2017.01.12-13.09.51:758][ 0]LogTemp:Display: Loaded TP Android_MultiTargetPlatform

[2017.01.12-13.09.51:758][ 0]LogTemp:Display: Loaded TP Android_PVRTCTargetPlatform

[2017.01.12-13.09.51:832][ 0]LogTemp:Display: Loaded TP HTML5TargetPlatform

[2017.01.12-13.09.51:981][ 0]LogTemp:Display: Loaded TP IOSTargetPlatform

[2017.01.12-13.09.52:044][ 0]LogTemp:Display: Loaded TP TVOSTargetPlatform

[2017.01.12-13.09.52:144][ 0]LogTemp:Display: Loaded TP LinuxClientTargetPlatform

[2017.01.12-13.09.52:246][ 0]LogTemp:Display: Loaded TP LinuxNoEditorTargetPlatform

[2017.01.12-13.09.52:347][ 0]LogTemp:Display: Loaded TP LinuxServerTargetPlatform

[2017.01.12-13.09.52:450][ 0]LogTemp:Display: Loaded TP LinuxTargetPlatform

[2017.01.12-13.09.52:450][ 0]LogTargetPlatformManager:Display: Building Assets For Windows

[2017.01.12-13.09.53:140][ 0]LogDerivedDataCache:Display: Max Cache Size: 512 MB

[2017.01.12-13.09.53:228][ 0]LogDerivedDataCache:Display: Loaded Boot cache: C:/Users/softavi.LW/AppData/Local/UnrealEngine/4.14/DerivedDataCache/Boot.ddc

[2017.01.12-13.09.53:257][ 0]LogDerivedDataCache:Display: Pak cache opened for reading …/…/…/Engine/DerivedDataCache/Compressed.ddp.

[2017.01.12-13.10.01:454][ 0]LogStaticMesh:Warning: cube has degenerate tangent bases which will result in incorrect shading. MikkTSpace relies on tangent bases and may result in mesh corruption, consider disabling this option.

[2017.01.12-13.10.01:478][ 0]FBXImport:Warning: Warning No smoothing group information was found in this FBX scene. Please make sure to enable the ‘Export Smoothing Groups’ option in the FBX Exporter plug-in before exporting the file. Even for tools that don’t support smoothing groups, the FBX Exporter will generate appropriate smoothing data at export-time so that correct vertex normals can be inferred while importing.

[2017.01.12-13.10.01:501][ 0]FBXImport:Warning: Warning cube has degenerate tangent bases which will result in incorrect shading. MikkTSpace relies on tangent bases and may result in mesh corruption, consider disabling this option.

[2017.01.12-13.10.01:826][ 0]LogWindows:Error: === Critical error: ===

[2017.01.12-13.10.01:831][ 0]LogWindows:Error:

[2017.01.12-13.10.01:835][ 0]LogWindows:Error: Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:d:\build++ue4+release-4.14+compile\sync\engine\source\runtime\core\public\Containers/Array.h] [Line: 634]

[2017.01.12-13.10.01:846][ 0]LogWindows:Error: Array index out of bounds: 0 from an array of size 0

[2017.01.12-13.10.01:851][ 0]LogWindows:Error:

[2017.01.12-13.10.01:853][ 0]LogWindows:Error:

[2017.01.12-13.10.01:856][ 0]LogWindows:Error: KERNELBASE.dll

[2017.01.12-13.10.01:859][ 0]LogWindows:Error: UE4Editor-Core.dll

[2017.01.12-13.10.01:862][ 0]LogWindows:Error: UE4Editor-Core.dll

[2017.01.12-13.10.01:866][ 0]LogWindows:Error: UE4Editor-Core.dll

[2017.01.12-13.10.01:869][ 0]LogWindows:Error: UE4Editor-UnrealEd.dll

[2017.01.12-13.10.01:872][ 0]LogWindows:Error: UE4Editor-UnrealEd.dll

[2017.01.12-13.10.01:876][ 0]LogWindows:Error: UE4Editor-Cmd.exe

[2017.01.12-13.10.01:879][ 0]LogWindows:Error: UE4Editor-Cmd.exe

[2017.01.12-13.10.01:882][ 0]LogWindows:Error: UE4Editor-Cmd.exe

[2017.01.12-13.10.01:885][ 0]LogWindows:Error: UE4Editor-Cmd.exe

[2017.01.12-13.10.01:888][ 0]LogWindows:Error: UE4Editor-Cmd.exe

[2017.01.12-13.10.01:892][ 0]LogWindows:Error: kernel32.dll

[2017.01.12-13.10.01:895][ 0]LogWindows:Error: ntdll.dll

[2017.01.12-13.10.01:897][ 0]LogWindows:Error: ntdll.dll

[2017.01.12-13.10.01:901][ 0]LogWindows:Error:

Have you run into this problem?

Hi panha,

The ImportAssets commandlet is quite recent and we’ve found it’s not very stable (at least up to 4.14.3). And given that there isn’t any docs about it, it can be tricky to get it working in some scenarios.

We’ve hit some errors when running the commandlet (this bug report being one) but we also hit another one (its bug report hasn’t been accepted for some reason). This other one was to do with the materials used in the FBX file. We found that if the materials weren’t converted to uassets before running the ImportAssets commandlet, we were hitting an exception. So this might be your case. After looking at the source code for a while, we found that adding the flag ‘-AllowCommandletRendering’ to the command line instruction fixed the issue.

That might fix your problem too.

Thanks

Hi, thanks you so much it works.
Would you mind tell me which section exactly in the source code did you look for this?

Thanks you

We found while debugging that the MaterialResources member variable in the UMaterial class was full of null pointers and in UMaterial::FlushResourceShaderMap they don’t have a null pointer check and that’s where the exception comes from. Adding the flag mentioned above populates the MaterialResources member variable.

Could you please remove the accepted status of my comment above? My comment solves the issue you reported in the other bug report, but it doesn’t solve the issue this bug report is about.

Thanks

Oh sorry for that, but I didn’t click accept that as an answer, not sure what’s happening : /. I already got an answer so , I think you can just delete the comments above then

Hi! Have you solved the problem?