unreal.BlueprintEditorLibrary

class unreal.BlueprintEditorLibrary(outer: Object | None = None, name: Name | str = 'None')

Bases: BlueprintFunctionLibrary

Blueprint Editor Library

C++ Source:

  • Module: BlueprintEditorLibrary

  • File: BlueprintEditorLibrary.h

classmethod add_function_graph(blueprint, func_name='NewFunction') EdGraph

Adds a function to the given blueprint

Parameters:
  • blueprint (Blueprint) – The blueprint to add the function to

  • func_name (str) – Name of the function to add

Returns:

UEdGraph*

Return type:

EdGraph

classmethod add_member_variable(blueprint, member_name, variable_type) bool

Adds a member variable to the specified blueprint with the specified type.

Parameters:
Returns:

true if it succeeds, false if it fails.

Return type:

bool

classmethod compare_asset_save_version_to(asset, version_to_check) AssetSaveVersionComparisonResults

Compares the given assets save version to the VersionToCheck. see: GetSavedByEngineVersion and GetCurrentEngineVersion

Parameters:
  • asset (Object) – The asset which you would like to check the SavedByEngineVersion of.

  • version_to_check (str) – String representation of the engine version to compare against. For example, “5.6.0-37518009+++UE5+Main”

Returns:

result (AssetSaveVersionComparisonResults): The outcome of the version comparison

Return type:

AssetSaveVersionComparisonResults

classmethod compare_soft_object_save_version_to(object_to_check, version_to_check) AssetSaveVersionComparisonResults

Compares the given soft object’s save version to the VersionToCheck. This will read the packages file header see: GetSavedByEngineVersion and GetCurrentEngineVersion

Parameters:
  • object_to_check (Object) – Soft object pointer to the object whose save version you would like to compare.

  • version_to_check (str) – String representation of the engine version to compare against. For example, “5.6.0-37518009+++UE5+Main”

Returns:

result (AssetSaveVersionComparisonResults): The outcome of the version comparison

Return type:

AssetSaveVersionComparisonResults

classmethod compile_blueprint(blueprint) None

Compiles the given blueprint.

Parameters:

blueprint (Blueprint) – Blueprint to compile

classmethod create_blueprint_asset_with_parent(asset_path, parent_class) Blueprint

Creates a blueprint based on a specific parent, honoring registered custom blueprint types

Parameters:
  • asset_path (str) – The full path that the asset should be created with

  • parent_class (type(Class)) – The parent class that the blueprint should be based on

Return type:

Blueprint

classmethod find_event_graph(blueprint) EdGraph

Finds the event graph of the given blueprint. Null if it doesn’t have one. This will only return the primary event graph of the blueprint (the graph named “EventGraph”).

Parameters:

blueprint (Blueprint) – Blueprint to search for the event graph on

Returns:

UEdGraph* Event graph of the blueprint if it has one, null if it doesn’t have one

Return type:

EdGraph

classmethod find_graph(blueprint, graph_name) EdGraph

Finds the graph with the given name on the blueprint. Null if it doesn’t have one.

Parameters:
  • blueprint (Blueprint) – Blueprint to search

  • graph_name (Name) – The name of the graph to search for

Returns:

UEdGraph* Pointer to the graph with the given name, null if not found

Return type:

EdGraph

classmethod generated_class(blueprint_obj)

Gets the class generated when this blueprint is compiled

Parameters:

blueprint_obj (Blueprint) – The blueprint object

Returns:

UClass* The generated class

Return type:

type(Class)

classmethod get_array_type(contained_type) EdGraphPinType
Parameters:

contained_type (EdGraphPinType)

Returns:

a array of ContainedType type - returns ‘int’ type if invalid type is provided

Return type:

EdGraphPinType

classmethod get_basic_type_by_name(type_name) EdGraphPinType
Parameters:

type_name (Name)

Returns:

a pintype for ‘int’, ‘byte’, ‘bool’, ‘real’, ‘name’, ‘string’ or ‘text’ - returns ‘int’ type if invalid type is provided

Return type:

EdGraphPinType

classmethod get_blueprint_asset(object) Blueprint

Casts the provided Object to a Blueprint - the root asset type of a blueprint asset. Note that the blueprint asset itself is editor only and not present in cooked assets.

Parameters:

object (Object) – The object we need to get the UBlueprint from

Returns:

UBlueprint* The blueprint type of the given object, nullptr if the object is not a blueprint.

Return type:

Blueprint

classmethod get_blueprint_for_class(class_) -> (Blueprint, does_class_have_blueprint=bool)

Looks up the UBlueprint that generated the provided class, if any. Provides a ‘true’ exec pin to execute if there is a valid blueprint associated with the Class.

Parameters:

class (type(Class)) – The class to look up the blueprint for

Returns:

The blueprint that generated the class, nullptr if the UClass is native or otherwise cooked

does_class_have_blueprint (bool): Whether the provided class had a blueprint

Return type:

bool

classmethod get_class_reference_type(class_type) EdGraphPinType
Parameters:

class_type (type(Class))

Returns:

a class reference pintype for the provided class - returns ‘int’ type if invalid class is provided

Return type:

EdGraphPinType

classmethod get_current_engine_version() str

Returns a string which represents the current engine version (FEngineVersion::Current())

For example: “5.6.0-37518009+++UE5+Main”

Return type:

str

classmethod get_map_type(key_type, value_type) EdGraphPinType
Parameters:
Returns:

a map of KeyType to ValueType type - returns ‘int’ type if invalid type is provided

Return type:

EdGraphPinType

classmethod get_object_reference_type(object_type) EdGraphPinType
Parameters:

object_type (type(Class))

Returns:

a object reference pintype for the provided class - returns ‘int’ type if invalid object type is provided

Return type:

EdGraphPinType

classmethod get_saved_by_engine_version(asset) str

Returns a string representation of the engine version which the given asset was saved with. see: FLinker::Summary::SavedByEngineVersion see: FPackageFileSummary

Parameters:

asset (Object) – The asset to check the saved by engine version of.

Returns:

String representation of the engine version which this asset was saved with. “INVALID” if none. For example: “5.6.0-37518009+++UE5+Main”

Return type:

str

classmethod get_set_type(contained_type) EdGraphPinType
Parameters:

contained_type (EdGraphPinType)

Returns:

a set of ContainedType type - returns ‘int’ type if invalid type is provided

Return type:

EdGraphPinType

classmethod get_struct_type(struct_type) EdGraphPinType
Parameters:

struct_type (ScriptStruct)

Returns:

a pintype for the provided struct - returns ‘int’ type if invalid struct is provided

Return type:

EdGraphPinType

classmethod refresh_all_open_blueprint_editors() None

Refresh any open blueprint editors

classmethod refresh_open_editors_for_blueprint(bp) None

Attempt to refresh any open blueprint editors for the given asset

Parameters:

bp (Blueprint)

classmethod remove_function_graph(blueprint, func_name) None

Deletes the function of the given name on this blueprint. Does NOT replace function call sites.

Parameters:
  • blueprint (Blueprint) – The blueprint to remove the function from

  • func_name (Name) – The name of the function to remove

classmethod remove_graph(blueprint, graph) None

Removes the given graph from the blueprint if possible

Parameters:
  • blueprint (Blueprint) – The blueprint the graph will be removed from

  • graph (EdGraph) – The graph to remove

classmethod remove_unused_nodes(blueprint) None

Remove any nodes in this blueprint that have no connections made to them.

Parameters:

blueprint (Blueprint) – The blueprint to remove the nodes from

classmethod remove_unused_variables(blueprint) int32

Deletes any unused blueprint created variables the given blueprint. An Unused variable is any BP variable that is not referenced in any blueprint graphs

Parameters:

blueprint (Blueprint) – Blueprint that you would like to remove variables from

Returns:

Number of variables removed

Return type:

int32

classmethod rename_graph(graph, new_name_str='NewGraph') None

Attempts to rename the given graph with a new name

Parameters:
  • graph (EdGraph) – The graph to rename

  • new_name_str (str) – The new name of the graph

classmethod reparent_blueprint(blueprint, new_parent_class) None

Attempts to reparent the given blueprint to the new chosen parent class.

Parameters:
  • blueprint (Blueprint) – Blueprint that you would like to reparent

  • new_parent_class (type(Class)) – The new parent class to use

classmethod replace_variable_references(blueprint, old_var_name, new_var_name) None

Replace any references of variables with the OldVarName to references of those with the NewVarName if possible

Parameters:
  • blueprint (Blueprint) – Blueprint to replace the variable references on

  • old_var_name (Name) – The variable you want replaced

  • new_var_name (Name) – The new variable that will be used in the old one’s place

classmethod set_blueprint_variable_expose_on_spawn(blueprint, variable_name, expose_on_spawn) None

Sets “Expose On Spawn” to true/false on a Blueprint variable

Parameters:
  • blueprint (Blueprint) – The blueprint object

  • variable_name (Name) – The variable name

  • expose_on_spawn (bool) – Set to true to expose on spawn

classmethod set_blueprint_variable_expose_to_cinematics(blueprint, variable_name, expose_to_cinematics) None

Sets “Expose To Cinematics” to true/false on a Blueprint variable

Parameters:
  • blueprint (Blueprint) – The blueprint object

  • variable_name (Name) – The variable name

  • expose_to_cinematics (bool) – Set to true to expose to cinematics

classmethod set_blueprint_variable_instance_editable(blueprint, variable_name, instance_editable) None

Sets “Instance Editable” to true/false on a Blueprint variable

Parameters:
  • blueprint (Blueprint) – The blueprint object

  • variable_name (Name) – The variable name

  • instance_editable (bool) – Toggle InstanceEditable

classmethod upgrade_operator_nodes(blueprint) None

Replace any old operator nodes (float + float, vector + float, int + vector, etc) with the newer Promotable Operator version of the node. Preserve any connections the original node had to the newer version of the node.

Parameters:

blueprint (Blueprint) – Blueprint to upgrade