# How do you update static mesh's material with python API?

**URL:** <https://forums.unrealengine.com/t/how-do-you-update-static-meshs-material-with-python-api/1247483>\
**Category:** Editor Scripting\
**Tags:** unreal-engine, question\
**Created:** [August 1, 2023, 8:38pm UTC](https://forums.unrealengine.com/t/how-do-you-update-static-meshs-material-with-python-api/1247483 "2023-08-01T20:38:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BlueEyedJabber](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BlueEyedJabber](https://forums.unrealengine.com/u/BlueEyedJabber)\
**Post date:** [August 1, 2023, 8:38pm UTC](https://forums.unrealengine.com/t/how-do-you-update-static-meshs-material-with-python-api/1247483/1 "2023-08-01T20:38:08Z")

</div>

How do you update the static mesh’s material like you would in the editor? Below is current implementation.  
I don’t see in the API docs on where to do this.

```auto
         import unreal
        
        EAS = unreal.get_editor_subsystem(unreal.EditorActorSubsystem)
        actor_class = unreal.StaticMeshActor
       actor = EAS.spawn_actor_from_class(actor_class, unreal.Vector(), unreal.Rotator())
       mesh = unreal.EditorAssetLibrary.load_asset('/Game/Assets/testAsset.fbx')
       actor.static_mesh_component.set_static_mesh(mesh)

```
