Unable to import GLB file with DatasmithGLTFImportOptions

Having trouble importing a GLB file. Using DatasmithGLTFImportOptions but not sure what’s wrong. Tried both version 4.24 and 4.25. I don’t know if my problem is the same as this known UE issue: Make sure GLTF importer can be call by script and blueprint



import os
import unreal

localFilePath = 'F:\\assets\\cube.glb'
assetGamePath = '/Game/MyMeshes'
assetName = os.path.splitext(os.path.basename(localFilePath))[0]

importTask = unreal.AssetImportTask()
importTask.filename = localFilePath
importTask.destination_path = assetGamePath
importTask.destination_name = assetName
importTask.replace_existing = True
importTask.automated = True
importTask.save = True

importTask.options = unreal.DatasmithGLTFImportOptions()
importTask.options.import_scale = 100.0
importTask.options.generate_lightmap_u_vs = False

unreal.AssetToolsHelpers.get_asset_tools().import_asset_tasks([importTask])
importedAssets = importTask.get_editor_property('imported_object_paths')
if not importedAssets: unreal.log_error('Failed to import {0}.'.format(localFilePath))
else: unreal.log('Successfully imported {0}.'.format(localFilePath))




Cmd: py "F:/Unreal Projects/GettingStarted/scripts/testGLTFImport.py"
LogSlate: Took 0.000200 seconds to synchronously load lazily loaded font '../../../Engine/Content/Slate/Fonts/Roboto-Light.ttf' (167K)
LogFactory: FactoryCreateFile: StaticMesh with GLTFImportFactory (0 0 F:\assets\cube.glb)
F:\assets\cube.glb
LogSlate: Warning: A modal window tried to take control while running in unattended script mode. The window was canceled.
LogStats: FPlatformStackWalk::StackWalkAndDump -  2.251 s
LogOutputDevice: Error: === FDebug::DumpStackTrace(): ===
LogOutputDevice: Error: [Callstack] 0x00007fff3e75b586 UE4Editor-Slate.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff17a92a3a UE4Editor-GLTFImporter.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff17a901d2 UE4Editor-GLTFImporter.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff2dda951c UE4Editor-UnrealEd.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff1eb473fe UE4Editor-AssetTools.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff1eb442f7 UE4Editor-AssetTools.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff1eb9feaa UE4Editor-AssetTools.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff42130b34 UE4Editor-CoreUObject.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff423a4753 UE4Editor-CoreUObject.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff1d534013 UE4Editor-PythonScriptPlugin.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff1d56be8f UE4Editor-PythonScriptPlugin.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff1d56c97b UE4Editor-PythonScriptPlugin.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff1d51a2bf UE4Editor-PythonScriptPlugin.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x0000000069144dd3 python27.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00000000691f1fbb python27.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00000000691f1a55 python27.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00000000691eeeab python27.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00000000691f0421 python27.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00000000691eb459 python27.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff1d5203c2 UE4Editor-PythonScriptPlugin.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff1d553113 UE4Editor-PythonScriptPlugin.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff1d520970 UE4Editor-PythonScriptPlugin.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff1d52081a UE4Editor-PythonScriptPlugin.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff1d520736 UE4Editor-PythonScriptPlugin.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff429b2780 UE4Editor-Core.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff422f5377 UE4Editor-CoreUObject.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff3721089a UE4Editor-Engine.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff2dcaed5a UE4Editor-UnrealEd.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff2e4ea077 UE4Editor-UnrealEd.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff1d538961 UE4Editor-PythonScriptPlugin.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff1d5214fe UE4Editor-PythonScriptPlugin.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff3e85ab85 UE4Editor-Slate.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff3e861320 UE4Editor-Slate.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff3e83a937 UE4Editor-Slate.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff3e8d207e UE4Editor-Slate.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff3e8eb27e UE4Editor-Slate.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff3e862a95 UE4Editor-Slate.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff3e732dc8 UE4Editor-Slate.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff3e7b69cf UE4Editor-Slate.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff3e79f4b2 UE4Editor-Slate.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff3e792392 UE4Editor-Slate.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff5b037f88 UE4Editor-ApplicationCore.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff5b025c87 UE4Editor-ApplicationCore.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff5b03a619 UE4Editor-ApplicationCore.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff5b0217d0 UE4Editor-ApplicationCore.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fffac01e858 USER32.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fffac01e299 USER32.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fff5b03bb34 UE4Editor-ApplicationCore.dll!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007ff7d4b168c4 UE4Editor.exe!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007ff7d4b2ba7c UE4Editor.exe!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007ff7d4b2bb5a UE4Editor.exe!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007ff7d4b3e31d UE4Editor.exe!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007ff7d4b4145a UE4Editor.exe!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fffad4e7034 KERNEL32.DLL!UnknownFunction ]
LogOutputDevice: Error: [Callstack] 0x00007fffade5cec1 ntdll.dll!UnknownFunction ]
LogFileHelpers: No new changes to save!
LogPython: Error: Failed to import F:\assets\cube.glb.


I am confirming that my issue is fixed in v4.27.

1 Like