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

**URL:** <https://forums.unrealengine.com/t/ue-4-27-automating-datasmith-to-fbx-or-gltf-export-with-python/504681>\
**Category:** Pipeline & Plugins\
**Tags:** Python, Datasmith, unreal-engine, question, UE4-27\
**Created:** [March 7, 2022, 10:08am UTC](https://forums.unrealengine.com/t/ue-4-27-automating-datasmith-to-fbx-or-gltf-export-with-python/504681 "2022-03-07T10:08:48Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![UE\_FlavienP](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ue_flavienp/32/1194546_2.png) [@UE\_FlavienP](https://forums.unrealengine.com/u/UE_FlavienP)\
**Post date:** [March 7, 2022, 1:19pm UTC](https://forums.unrealengine.com/t/ue-4-27-automating-datasmith-to-fbx-or-gltf-export-with-python/504681/2 "2022-03-07T13:19:44Z")

</div>

Things you need to pay attention to:

- in the script provided by [Ro-Su](https://forums.unrealengine.com/t/batch-translate-solidworks-headlessly-via-python/116024/5) 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](https://github.com/ue4plugins/PythonSamples/blob/main/scripts/ImportExport/Export_selected_actors_to_FBX.py)

here to export a single mesh with gltf : [Export mesh as GLTF with Python - #3 by UE\_FlavienP](https://forums.unrealengine.com/t/export-mesh-as-gltf-with-python/232296/3)  
here to export a scene with gltf: [How to batch export scene components to glb/glTF file - #2 by UE\_FlavienP](https://forums.unrealengine.com/t/how-to-batch-export-scene-components-to-glb-gltf-file/272036/2)

---

_[View the full topic](https://forums.unrealengine.com/t/ue-4-27-automating-datasmith-to-fbx-or-gltf-export-with-python/504681)._
