UE 4-27 : Automating Datasmith to FBX or GLTF export with Python

Things you need to pay attention to:

  • in the script provided by Ro-Su he merges all the actors in one mesh. So you should not do that
  • for the FBX exporter as well as the gltf exporter you can either put an object in the “task.object” but that will export only an actor or an asset, or you can put a reference to the world to export the full scene. On top of that you can put the “task.selected” at true to only export what is selected in your level.
    Here for FBX: PythonSamples/Export_selected_actors_to_FBX.py at main · ue4plugins/PythonSamples · GitHub

here to export a single mesh with gltf : Export mesh as GLTF with Python - #3 by UE_FlavienP
here to export a scene with gltf: How to batch export scene components to glb/glTF file - #2 by UE_FlavienP