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 compile_blueprint(blueprint) None

Compiles the given blueprint.

Parameters:

blueprint (Blueprint) – Blueprint to compile

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_blueprint_asset(object) Blueprint

Gets the UBlueprint version of the given object if possible.

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 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