# Can you edit a Blueprint Variable from Python?

**URL:** <https://forums.unrealengine.com/t/can-you-edit-a-blueprint-variable-from-python/123147>\
**Category:** Editor Scripting\
**Tags:** unreal-engine\
**Created:** [March 4, 2019, 11:36pm UTC](https://forums.unrealengine.com/t/can-you-edit-a-blueprint-variable-from-python/123147 "2019-03-04T23:36:48Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Jamie\_Dale](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jamie_dale/32/1165413_2.png) [@Jamie\_Dale](https://forums.unrealengine.com/u/Jamie_Dale)\
**Post date:** [March 6, 2019, 11:01pm UTC](https://forums.unrealengine.com/t/can-you-edit-a-blueprint-variable-from-python/123147/3 "2019-03-06T23:01:42Z")

</div>

You can, but you need to set them on the Class Default Object (CDO) of the Blueprint Generated Class (BPGC), rather than the Blueprint asset itself (which is just a definition of how to build the BPGC). This requires the Blueprint asset itself to be compiled and up-to-date:

```auto

# get the generated class of the Blueprint (note the _C)
bp_gc = unreal.load_object(None, "/Game/MyBP.MyBP_C")
# get the Class Default Object (CDO) of the generated class
bp_cdo = unreal.get_default_object(bp_gc)
# set the default property values
bp_cdo.set_editor_property("MyFloatProp", 1.0)
bp_cdo.set_editor_property("MyBoolProp", True)

```

---

_[View the full topic](https://forums.unrealengine.com/t/can-you-edit-a-blueprint-variable-from-python/123147)._
