On dragging a folder structure from Windows Explorer containing glTF’s into the UE4 File browser, the end user is faced with an Import options prompt for every single glTF file being imported in.
This means hours of repetitively clicking ‘Import’ simply because of a missing feature to ‘Accept default values without prompt/further prompt’.
To compound the issue the Import options prompt window dynamically resizes to accommodate display of the file path , and with Import and Cancel buttons being so close together it’s easy to accidentally click cancel instead on import when the window resizes for the next file.
In a nutshell, the glTF importer is fantastic for a few files, but for bulk importing glTF it’s an absolute nightmare.
What I have tried.
My attempted workaround to the issue was to make a modified version of C:\Program Files\Epic Games\UE_4.26\Engine\Plugins\Editor\GLTFImporter
in my projects Plugins folder and rename elements appropriately.
It would have worked great if the plugin were standalone without being depending on the glTF Datasmith plugin. I found that when I enabled my version of the glTF importer it automatically activated glTFDatasmith, which is fine, but when the glTF Datasmith got activated it automatically activated the original glTF importer as well.
I was essentially left with the conclusion that I would really need to modify and compile the original Engine plugin source rather than duplicate, but then faced with the issue that Engine plugins won’t compile these at runtime.
Fine, so I need to edit and compile this manually in VS2019, but there are no uproject files with which to create a VS project.
Does this mean that my only option is to either wait and hope that some kind soul will update the plugin with the features I want or have to resort to compiling the the whole engine from source in order to make a few lines of change in a single file in a single plugin?
This is easy and will be wrong if I ignore especially after reading you comment. So here is a solution.
I could not find any dependecy on glTF Datasmith plugin in GLTFImporter plugin. Cut and paste the plugin folder from the Engine/Plugins/Editor/ to your Project/plugins/
Open the IDE and locate ‘GLTFImportFactory.cpp’ got line 98 comment out from line 99-108.
compile the game. Open the game and import/ batch import all you want. There will be no import dialogue. If you want then you can put back the plugin to the engine folder Engine/Plugins/Editor/
To avoid getting the error below when trying to compile GLTFImportFactory.cpp …
" Error Module ‘DatasmithGLTFTranslator’ (Engine Plugins) should not reference module ‘GLTFCore’ (Project). Hierarchy is Project → Engine Programs → Engine Plugins → Engine. MFN I:\MFN\Intermediate\ProjectFiles\UnrealBuildTool 1
"
… cut and paste the DatasmithGLTFImporter plugin into the project folder as well.
Then delete Binaries and Intermediate folders in \Plugins\GLTFImporter otherwise the old files will be detected and the new ones created as 001.dll, 002.dll suffixes etc…
Open up the project again and let it compile when prompted. Happy days
Thanks for your help with that, I’m importing with a smile on my face now :D. In terms of Linker/UBT version/configuration. All I know is that I’m using Microsoft Visual Studio Community 2019 Version 16.8.3 alongside the Launcher version of 4.26. Both are just the ‘out-of-the-box’ settings.