# Python: How to set the Anim Class on a SkeletalMeshComponent?

**URL:** <https://forums.unrealengine.com/t/python-how-to-set-the-anim-class-on-a-skeletalmeshcomponent/152801>\
**Category:** Editor Scripting\
**Tags:** unreal-engine\
**Created:** [October 27, 2020, 7:40pm UTC](https://forums.unrealengine.com/t/python-how-to-set-the-anim-class-on-a-skeletalmeshcomponent/152801 "2020-10-27T19:40:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vfalex](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@vfalex](https://forums.unrealengine.com/u/vfalex)\
**Post date:** [October 27, 2020, 7:40pm UTC](https://forums.unrealengine.com/t/python-how-to-set-the-anim-class-on-a-skeletalmeshcomponent/152801/1 "2020-10-27T19:40:57Z")

</div>

I want to set the “Anim Class” on a skeletal mesh component via python. In the Editor gui it’s simple enough to select from the “Anim Class” drop-down menu. Then when selecting the AnimBluePrint in the Content Browser it selects the AnimBlueprint I generated (also via python). However, when attempting to “set\_anim\_class” on the SkeletalMeshComponent to the blueprint asset I get an error that I cannot nativize AnimBlueprint. When I had set this in the UI I see that the Anim Class is set to an AnimBlueprintGeneratedClass object. How do I derive such an object from my AnimBlueprint object?

---

<div class="post-metadata">

**Author:** ![9Evgeny9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@9Evgeny9](https://forums.unrealengine.com/u/9Evgeny9)\
**Post date:** [April 8, 2023, 1:04pm UTC](https://forums.unrealengine.com/t/python-how-to-set-the-anim-class-on-a-skeletalmeshcomponent/152801/2 "2023-04-08T13:04:11Z")

</div>

The same problem.

> `anim_class = unreal.EditorAssetLibrary.load_blueprint_class('/Game/APS/Data/Animations/APS_animbp.APS_animbp')`
> 
> `component.set_anim_class(anim_class)`

Not working. No log errors.

`component.set_editor_property('anim_class', anim_class)`

Not work too.  
How to assign AnimBP to skeletal mesh?

---

<div class="post-metadata">

**Author:** ![JFarrow](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JFarrow](https://forums.unrealengine.com/u/JFarrow)\
**Post date:** [April 24, 2023, 4:38am UTC](https://forums.unrealengine.com/t/python-how-to-set-the-anim-class-on-a-skeletalmeshcomponent/152801/3 "2023-04-24T04:38:54Z")

</div>

Try this:

```auto
anim_class = unreal.EditorAssetLibrary.load_asset('/Game/APS/Data/Animations/APS_animbp.APS_animbp')
component.set_anim_class(anim_class.generated_class())

```
