# Import animation without mesh in Unreal 4.22 using python

**URL:** <https://forums.unrealengine.com/t/import-animation-without-mesh-in-unreal-4-22-using-python/127167>\
**Category:** Editor Scripting\
**Tags:** unreal-engine\
**Created:** [June 6, 2019, 9:27pm UTC](https://forums.unrealengine.com/t/import-animation-without-mesh-in-unreal-4-22-using-python/127167 "2019-06-06T21:27:56Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Loux\_xavier](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/loux_xavier/32/1201519_2.png) [@Loux\_xavier](https://forums.unrealengine.com/u/Loux_xavier)\
**Post date:** [June 6, 2019, 9:27pm UTC](https://forums.unrealengine.com/t/import-animation-without-mesh-in-unreal-4-22-using-python/127167/1 "2019-06-06T21:27:56Z")

</div>

Hello !  
I do a script for import a animation in unreal engine but the parameter FbxImportUI.import\_mesh does not work 😕 When I run the script it import the animation and the mesh but I want import only the animation, the mesh already exists in another folder.

This is my code :

```auto
import os.path
import unreal

# Option
taskoptions = unreal.FbxImportUI()
taskoptions.set_editor_property('Skeleton', unreal.find_asset(r'/Game/Temp/SK_Armature_Skeleton.SK_Armature_Skeleton'))
taskoptions.set_editor_property('import_materials', False)
taskoptions.set_editor_property('import_textures', False)
taskoptions.set_editor_property('import_animations', True)
taskoptions.set_editor_property('import_mesh', False)
taskoptions.set_editor_property('create_physics_asset',False)
taskoptions.set_editor_property('original_import_type', unreal.FBXImportType.FBXIT_ANIMATION)
taskoptions.skeletal_mesh_import_data.set_editor_property('import_morph_targets', True)

# Task
task = unreal.AssetImportTask()
task.filename = r'D:\MyAnim\ArmatureAction.fbx'
task.destination_path = r'/Game/Temp/Anim'
task.automated = True
task.save = True
task.replace_existing = True
task.set_editor_property('options', taskoptions)

unreal.AssetToolsHelpers.get_asset_tools().import_asset_tasks([task,])

```

I did something wrong? Thank you for your reply !

---

<div class="post-metadata">

**Author:** ![JohnHudeski](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JohnHudeski](https://forums.unrealengine.com/u/JohnHudeski)\
**Post date:** [June 10, 2019, 8:16am UTC](https://forums.unrealengine.com/t/import-animation-without-mesh-in-unreal-4-22-using-python/127167/2 "2019-06-10T08:16:48Z")

</div>

In unreal you cannot import an animation without a mesh it seems.  
I tried many times before.  
You cant even import a multi take/animation fbx

---

<div class="post-metadata">

**Author:** ![Loux\_xavier](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/loux_xavier/32/1201519_2.png) [@Loux\_xavier](https://forums.unrealengine.com/u/Loux_xavier)\
**Post date:** [June 10, 2019, 11:19am UTC](https://forums.unrealengine.com/t/import-animation-without-mesh-in-unreal-4-22-using-python/127167/3 "2019-06-10T11:19:03Z")

</div>

You can do it if the skeleton already exists it was enough to select the skeleton and uncheck import mesh. (Like in the picture)  
I do the same manipulation with python but it does not work 😕

---

<div class="post-metadata">

**Author:** ![cyaoeu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@cyaoeu](https://forums.unrealengine.com/u/cyaoeu)\
**Post date:** [June 10, 2019, 1:51pm UTC](https://forums.unrealengine.com/t/import-animation-without-mesh-in-unreal-4-22-using-python/127167/4 "2019-06-10T13:51:05Z")

</div>

> [@Loux\_xavier](#):
>
> You can do it if the skeleton already exists it was enough to select the skeleton and uncheck import mesh. (Like in the picture)  
> I do the same manipulation with python but it does not work 😕

You could check if you get the same result with the unofficial Python plugin: [GitHub - 20tab/UnrealEnginePython: Embed Python in Unreal Engine 4](https://github.com/20tab/UnrealEnginePython) (example of importing animations in /Tutorials/YourFirstAutomatedPipeline.md)

If that works fine submit a bug report for the UE4 python plugin.

---

<div class="post-metadata">

**Author:** ![fxtd-odyssey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@fxtd-odyssey](https://forums.unrealengine.com/u/fxtd-odyssey)\
**Post date:** [June 3, 2020, 9:09am UTC](https://forums.unrealengine.com/t/import-animation-without-mesh-in-unreal-4-22-using-python/127167/5 "2020-06-03T09:09:54Z")

</div>

[https://forums.unrealengine.com/development-discussion/python-scripting/1576474-importing-skeletal-meshes-4-21](https://forums.unrealengine.com/development-discussion/python-scripting/1576474-importing-skeletal-meshes-4-21)  
I find a solution.

```auto

options.automated_import_should_detect_type = False

```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_077a2248](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_077a2248](https://forums.unrealengine.com/u/anonymous_user_077a2248)\
**Post date:** [June 7, 2021, 5:11am UTC](https://forums.unrealengine.com/t/import-animation-without-mesh-in-unreal-4-22-using-python/127167/6 "2021-06-07T05:11:15Z")

</div>

I was facing the same issue as, but your solution doesn’t fix my problem.

I’m trying to import an FBX containing nothing but an animated cylinder.  
The corresponding Skeleton, SkeletalMesh and Material have already been imported elsewhere.

Importing the FBX manually with these settings is giving the expected result : **just an AnimationSequence.**

 ![ManualImport_Options](https://d3kjluh73b9h9o.cloudfront.net/original/3X/5/3/53b9b778a02639c0960bb789b38c8c4e37c2769e.png)

And now here is my code :  
options = unreal.FbxImportUI()  
# options.automated\_import\_should\_detect\_type = False  
options.original\_import\_type = unreal.FBXImportType.FBXIT\_ANIMATION  
options.import\_animations = True  
options.create\_physics\_asset = False  
options.import\_mesh = False  
options.import\_rigid\_mesh = False  
options.import\_materials = False  
options.import\_textures = False  
options.import\_as\_skeletal = False  
options.skeleton = unreal.load\_asset(skeleton\_path)  
return options

The second line (options.automated\_import\_should\_detect\_type = False) is giving a StaticMesh.  
If I comment or remove it, the import gives a SkeletalMesh + an AnimationSequence, which is better, but I still want to get rid of this SkeletalMesh and I can’t manage to only get the AnimationSequence.

I’ve tried using set\_editor\_property rather than the direct parameters but it doesn’t change anything.

---

<div class="post-metadata">

**Author:** ![josef.struz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@josef.struz](https://forums.unrealengine.com/u/josef.struz)\
**Post date:** [September 30, 2022, 2:18pm UTC](https://forums.unrealengine.com/t/import-animation-without-mesh-in-unreal-4-22-using-python/127167/7 "2022-09-30T14:18:11Z")

</div>

I have found a way, you need to set `mesh_type_to_import` to `unreal.FBXImportType.FBXIT_ANIMATION`.

```auto
options.set_editor_property('automated_import_should_detect_type', False)
options.set_editor_property('original_import_type', unreal.FBXImportType.FBXIT_SKELETAL_MESH)
options.set_editor_property('mesh_type_to_import', unreal.FBXImportType.FBXIT_ANIMATION)

```

---

<div class="post-metadata">

**Author:** ![bbcool4444](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bbcool4444/32/1101497_2.png) [@bbcool4444](https://forums.unrealengine.com/u/bbcool4444)\
**Post date:** [August 17, 2023, 6:38am UTC](https://forums.unrealengine.com/t/import-animation-without-mesh-in-unreal-4-22-using-python/127167/9 "2023-08-17T06:38:35Z")

</div>

Good job, your answer has fixed my issue!

---

<div class="post-metadata">

**Author:** ![Lieven.V](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lieven.v/32/898281_2.png) [@Lieven.V](https://forums.unrealengine.com/u/Lieven.V)\
**Post date:** [February 15, 2024, 2:39pm UTC](https://forums.unrealengine.com/t/import-animation-without-mesh-in-unreal-4-22-using-python/127167/10 "2024-02-15T14:39:15Z")

</div>

Hi Guys!

Thank you for all your replies, I had more or less the same problem.  
None of these solutions worked for me (I’m working in Unreal 5.2 now),  
and I keep getting this error:

FBXImport: Warning: Mesh [Geometry have no name] in the fbx file is not reference by any hierarchy node.  
FBXImport: Error: Import failed.

This is my code:

```auto
for x in fileNames:
    task.filename = x
    task.destination_path = destination_path
    task.replace_existing = True
    task.automated = True
    task.save = True
    task.options = unreal.FbxImportUI()
    
    
    task.options.automated_import_should_detect_type = False
    task.options.mesh_type_to_import = unreal.FBXImportType.FBXIT_ANIMATION
    task.options.import_materials = False
    task.options.import_textures = False
    task.options.import_animations = True
    task.options.import_mesh = False
    task.options.skeleton = unreal.find_asset('/Game/MetaHumans/Common/Female/Medium/NormalWeight/Body/metahuman_base_skel.uasset')
    
    task.options.skeletal_mesh_import_data.set_editor_property('use_t0_as_ref_pose', True)
    task.options.skeletal_mesh_import_data.set_editor_property('import_meshes_in_bone_hierarchy', False)

    asset_tools = unreal.AssetToolsHelpers.get_asset_tools()
    asset_tools.import_asset_tasks([task])

```

I’ve tried to set import\_meshes\_in\_bone\_hierarchy and use\_t0\_as\_ref\_pose, as I read it somewhere, it could help, but unfortunately not.
