How to set properties of StaticMeshComponent created in Blueprint Actor class via python?

Hello,
I am trying to write a script that sets specified properties to staticMechComponent of BP Actor. I am not sure how to access the StaticMeshComponent via python.

Found a solution myself:

  • Select actor(s).

  • Access StaticMeshComponent with static_mesh_component = actor.get_component_by_class(unreal.StaticMeshComponent)

  • To set the property use static_mesh_component.set_editor_property("property_name", value)

Note that to set multiple properties you will need to get the SMComponent every time before setting.