Created
August 3, 2024 10:38
-
-
Save harumaxy/da0efc598d66706e124e373da59e7adb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # export AnimSequence as .glb | |
| import unreal | |
| rootPath = '/Game/AdvancedLocomotionV4' | |
| outputDir = '/Users/{user_name}/Downloads/ExportALS/' # This case is macOS | |
| # remove preview mesh to reduce export size | |
| exportOptions = unreal.GLTFExportOptions() | |
| exportOptions.export_preview_mesh = False | |
| selectedActors = set() | |
| assetPaths = unreal.EditorAssetLibrary.list_assets(rootPath) | |
| for assetPath in assetPaths: | |
| anim = unreal.EditorAssetLibrary.load_asset(assetPath) | |
| if unreal.MathLibrary.class_is_child_of(anim.get_class(), unreal.AnimSequence): | |
| # export format is automaticaly determined by extension | |
| exportPath = outputDir+anim.get_name()+'.glb' | |
| unreal.GLTFExporter.export_to_gltf( | |
| anim, exportPath, exportOptions, selectedActors) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment