# Change component variables on Blueprint class via Python

**URL:** <https://forums.unrealengine.com/t/change-component-variables-on-blueprint-class-via-python/152584>\
**Category:** Editor Scripting\
**Tags:** unreal-engine\
**Created:** [October 23, 2020, 5:43pm UTC](https://forums.unrealengine.com/t/change-component-variables-on-blueprint-class-via-python/152584 "2020-10-23T17:43:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Swinny](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Swinny](https://forums.unrealengine.com/u/Swinny)\
**Post date:** [October 23, 2020, 5:43pm UTC](https://forums.unrealengine.com/t/change-component-variables-on-blueprint-class-via-python/152584/1 "2020-10-23T17:43:40Z")

</div>

Hi, I’m stuck on trying to get the components of a blueprint actors default class, I can set the base properties with no problem - its then accessing the child components. Also get\_component\_by\_type doesnt seem to work the way I am using it.

```auto

import unreal
#get blueprint asset
blueprint = unreal.load_object(None, '/Game/Blueprints/Character.Character_C')
bp_cdo = unreal.get_default_object(blueprint)

#define skeletal mesh
SM = '/Game/Meshes/CharMesh.CharMesh'
Masset = unreal.load_asset(SM)

bp_cdo.set_editor_property("Mesh", SMasset)

print bp_cdo.get_editor_property("Mesh")

```

This works fine, problem is I dont want to set a ‘mesh’ variable on the actor, I want to set it on the Skeletal Mesh Component.  
I attempt to get the skeletal mesh component using

component = bp\_cdo.get\_component\_by\_type(‘SkeletalMeshComponent’)

and I know this will work if i have an actor already loaded - but i am completely lost on how to access the components of a base blueprint class?|

Any help would be greatly appreciated, a day of checking UnrealSlackers discord, Unreal Answers and Forum posts have given me nothing

---

<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:** [August 14, 2023, 2:32pm UTC](https://forums.unrealengine.com/t/change-component-variables-on-blueprint-class-via-python/152584/2 "2023-08-14T14:32:17Z")

</div>

Did you find a solution?

---

<div class="post-metadata">

**Author:** ![ArsenTahmazian](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ArsenTahmazian](https://forums.unrealengine.com/u/ArsenTahmazian)\
**Post date:** [August 23, 2023, 8:52pm UTC](https://forums.unrealengine.com/t/change-component-variables-on-blueprint-class-via-python/152584/3 "2023-08-23T20:52:40Z")

</div>

Components are not contained in CDO, but in USimpleConstructionScript. See [How to get a component from a ClassDefaultObject?](https://forums.unrealengine.com/t/how-to-get-a-component-from-a-classdefaultobject/383881)
