Importing multiple fbx files with the ImportAssets commandlet

Hi, I managed to get the Import Assets commandlet to work for importing single fbx files into my project, however I am now trying to do the same for multiple fbx files at once, by giving the commandlet the path to a folder of fbx files rather than the path to a single file. The commandlet appears to work as the fbx files are converted into uassets and stored in the destination folder, however many errors are reported.

Here is the working version for one file:

UE4Editor-Cmd "C:\Users\jack.diver\Documents\Unreal Projects\importTest\importTest.uproject" -run=ImportAssets -source=C:\Users\jack.diver\Documents\testMeshes\pyramid.fbx -dest=/Game/Geometry/importMeshTest/ -importSettings="" -AllowCommandletRendering -nosourcecontrol -replaceexisting

I then simply changed my source to be the directory containing the mesh:

UE4Editor-Cmd "C:\Users\jack.diver\Documents\Unreal Projects\importTest\importTest.uproject" -run=ImportAssets -source=C:\Users\jack.diver\Documents\testMeshes -dest=/Game/Geometry/importMeshTest/ -importSettings="" -AllowCommandletRendering -nosourcecontrol -replaceexisting

I as said this correctly generates my Uassets, however it gives me the following errors:

[2017.06.20-10.37.17:559][  0]LogOutputDevice:Error: === Handled ensure: ===
[2017.06.20-10.37.16:708][  0]LogOutputDevice:Error: 
[2017.06.20-10.37.16:711][  0]LogOutputDevice:Error: Ensure condition failed: ExpectedWorkThisFrame <= 1.01f * TotalAmountOfWork - CompletedWork [File:D:\Build\++UE4+Release-4.16+Compile\Sync\Engine\Source\Runtime\Core\Private\Misc\SlowTask.cpp] [Line: 86]
[2017.06.20-10.37.16:733][  0]LogOutputDevice:Error: Work overflow in slow task. Please revise call-site to account for entire progress range.
[2017.06.20-10.37.16:758][  0]LogOutputDevice:Error: Stack: 
[2017.06.20-10.37.16:761][  0]LogOutputDevice:Error: UE4Editor-Core.dll!0x00000000E663E1C6
[2017.06.20-10.37.16:766][  0]LogOutputDevice:Error: UE4Editor-Core.dll!0x00000000E63EB7D2
[2017.06.20-10.37.16:782][  0]LogOutputDevice:Error: UE4Editor-Core.dll!0x00000000E6401D96
[2017.06.20-10.37.16:787][  0]LogOutputDevice:Error: UE4Editor-Core.dll!0x00000000E6440DCE
[2017.06.20-10.37.16:799][  0]LogOutputDevice:Error: UE4Editor-AssetTools.dll!0x00000000CF0CE177
[2017.06.20-10.37.16:806][  0]LogOutputDevice:Error: UE4Editor-AssetTools.dll!0x00000000CF0CCCDE
[2017.06.20-10.37.16:812][  0]LogOutputDevice:Error: UE4Editor-UnrealEd.dll!0x00000000DFCFCE6A
[2017.06.20-10.37.16:821][  0]LogOutputDevice:Error: UE4Editor-UnrealEd.dll!0x00000000DFD0FBBF
[2017.06.20-10.37.16:827][  0]LogOutputDevice:Error: UE4Editor-Cmd.exe!0x000000003F697B8F
[2017.06.20-10.37.16:836][  0]LogOutputDevice:Error: UE4Editor-Cmd.exe!0x000000003F68EEDA
[2017.06.20-10.37.16:842][  0]LogOutputDevice:Error: UE4Editor-Cmd.exe!0x000000003F68F12A
[2017.06.20-10.37.16:848][  0]LogOutputDevice:Error: UE4Editor-Cmd.exe!0x000000003F6A0CF9
[2017.06.20-10.37.16:866][  0]LogOutputDevice:Error: UE4Editor-Cmd.exe!0x000000003F6A1A1F
[2017.06.20-10.37.16:871][  0]LogOutputDevice:Error: kernel32.dll!0x00000000773859CD
[2017.06.20-10.37.16:880][  0]LogOutputDevice:Error: ntdll.dll!0x00000000775BA561

I have attached the full log here.
Thanks!

So I ended up using the -importassets parameter to do this, there is a field in the json which you can list the files you want to import, heres the json:

{
    "ImportGroups": [
        {
            "FileNames": [
                "path\\to\\mesh\\one.fbx", 
                "path\\to\\mesh\\two.fbx", 
                "path\\to\\mesh\\three.fbx", 
            ]
            "bReplaceExisting": "true", 
            "DestinationPath": "/Game/Geometry/Meshes/", 
            "FactoryName": "FbxFactory", 
            "ImportSettings": {
                "bImportMesh": 1, 
                "bConvertSceneUnit": 1, 
                "bConvertScene": 1,
                "bCombineMeshes": 1, 
                "bImportTextures": 1, 
                "bImportMaterials": 1, 
                "AnimSequenceImportData": {}, 
                "SkeletalMeshImportData": {},
                "TextureImportData": {}, 
                "StaticMeshImportData": {
                    "bRemoveDegenerates": 1, 
                    "bAutoGenerateCollision": 1
                }
            }
        }
    ]
}

If you can auto generate this json file, you’re good to go

I found that you can do a list of import groups for different locations

{"ImportGroups":[
     {"FileNames":[
         "Z:/Building/Exterior/GC_Rack/GC_Rack_1.fbx",
         "Z:/Building/Exterior/HVAC_Ceiling_Unit/HVAC_Ceiling_Unit_1.fbx",
         "Z:/Building/Exterior/Ice_Merchandiser_Leer_L40_Slant/Ice_Merchandiser_Leer_L40_Slant_1.fbx",
     ],
     "bReplaceExisting":"false",
     "DestinationPath":"/Game/Assets/Building/Exterior/",
     "FactoryName":"FbxFactory",
     "ImportSettings":{
         "AnimSequenceImportData":{},"SkeletalMeshImportData":{},"TextureImportData":{},
         "StaticMeshImportData":{"bCombineMeshes":1,"bAutoGenerateCollision":1,"bRemoveDegenerates":1}
     }}
 ,
     {"FileNames":[
         "Z:/Building/Exterior/Signage_Fuel_Center/Food_Panels_1.fbx",
     ],
     "bReplaceExisting":"false",
     "DestinationPath":"/Game/Assets/Building/Exterior/Signage_Fuel_Center",
     "FactoryName":"FbxFactory",
     "ImportSettings":{
         "AnimSequenceImportData":{},"SkeletalMeshImportData":{},"TextureImportData":{},
         "StaticMeshImportData":{"bCombineMeshes":1,"bAutoGenerateCollision":1,"bRemoveDegenerates":1}
     }}
 ]}

I’ve tried a lot of different ways to get this to work and still nothing is perfect. Here’s a post with all of my code and maybe something will help you.
fbx-automated-command-line-import