# Export mesh as GLTF with Python

**URL:** <https://forums.unrealengine.com/t/export-mesh-as-gltf-with-python/232296>\
**Category:** Editor Scripting\
**Tags:** unreal-engine\
**Created:** [May 30, 2021, 3:20am UTC](https://forums.unrealengine.com/t/export-mesh-as-gltf-with-python/232296 "2021-05-30T03:20:44Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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:** [June 1, 2021, 8:33pm UTC](https://forums.unrealengine.com/t/export-mesh-as-gltf-with-python/232296/3 "2021-06-01T20:33:40Z")

</div>

What about:

```
import unreal

selected_assets = unreal.EditorUtilityLibrary.get_selected_assets()
for asset in selected_assets:
    # set up the gltf export options
    task = unreal.AssetExportTask()
    task.object = asset
    task.filename = "C:/Temp/GLTFExport/"+asset.get_name() + ".gltf"
    task.automated = True # don't display the export options dialog
    task.replace_identical = True # always overwrite the output
    task.exporter = unreal.GLTFStaticMeshExporter()
    task.options = unreal.GLTFExportOptions()
    result = unreal.Exporter.run_asset_export_task(task)

```

This plugin is on the marketplace, thus it is not processed to be added to the official python API.  
What you can do is

1. Turn GLTF Exporter plugin and python plugin on in your project
2. in project settings, python, turn developer mode on  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/3X/6/2/620255b0f1f8568efee242ecce779fcb1d8e6c2a.png)
3. restart project, look into “Intermediate\PythonStub\unreal.py” you will have the python API including the one for the activated plugins.

Bonus, you can use this stub in your IDE to get some autocompletion.

Bests,  
Flavien.

---

_[View the full topic](https://forums.unrealengine.com/t/export-mesh-as-gltf-with-python/232296)._
