Download

Getting and editing blueprint components with python

Hi there, new to unreal and excited to see what editor scripting capabilities there are with python.

I’ve been able to load and duplicate blueprint assets with python but editing them so far has been a real challenge.

I have a character blueprint file set up with multiple components.

I’d like to load, edit and save out a new blueprint file in the editor.

When I use python to load the asset and inspect it I don’t see a single attribute in which to access the components of the blueprint.

So far I haven’t found any documentation on it either.

Is “load_asset” the correct way to go about load/editing/saving blueprints with python or is there another way?

If I’m looking at a blueprint in editor what are the properties I can edit with “set_editor_properties”?

Thank you.

pcAsset=unreal.load_asset(’/Game/Blueprints/Npc’)

print(npcAsset)

<Object ‘/Game/Blueprints/Npc.Npc’ (0x348825600) Class ‘Blueprint’>

print(dir(npcAsset))

class’, ‘delattr’, ‘dir’, ‘doc’, ‘eq’, ‘format’, ‘ge’, ‘getattribute’, ‘gt’, ‘hash’, ‘init’, ‘init_subclass’, ‘le’, ‘lt’, ‘ne’, ‘new’, ‘reduce’, ‘reduce_ex’, ‘repr’, ‘setattr’, ‘sizeof’, ‘str’, ‘subclasshook’, ‘_post_init’, ‘_wrapper_meta_data’, ‘call_met
hod’, ‘cast’, ‘get_class’, ‘get_default_object’, ‘get_editor_property’, ‘get_fname’, ‘get_full_name’, ‘get_name’, ‘get_outer’, ‘get_outermost’, ‘get_path_name’, ‘get_typed_outer’, ‘get_world’, ‘modify’, ‘rename’, ‘set_editor_properties’, ‘set_editor_property’, ‘static_class’]
obj = npcAsset.get_default_object()

print(dir(obj))

class’, ‘delattr’, ‘dir’, ‘doc’, ‘eq’, ‘format’, ‘ge’, ‘getattribute’, ‘gt’, ‘hash’, ‘init’, ‘init_subclass’, ‘le’, ‘lt’, ‘ne’, ‘new’, ‘reduce’, ‘reduce_ex’, ‘repr’, ‘setattr’, ‘sizeof’, ‘str’, ‘subclasshook’, ‘_post_init’, ‘_wrapper_meta_data’, ‘call_met
hod’, ‘cast’, ‘get_class’, ‘get_default_object’, ‘get_editor_property’, ‘get_fname’, ‘get_full_name’, ‘get_name’, ‘get_outer’, ‘get_outermost’, ‘get_path_name’, ‘get_typed_outer’, ‘get_world’, ‘modify’, ‘rename’, ‘set_editor_properties’, ‘set_editor_property’, ‘static_class’]