unreal.BlueprintEditorLibrary¶
- class unreal.BlueprintEditorLibrary(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
BlueprintFunctionLibraryBlueprint Editor Library
C++ Source:
Module: BlueprintEditorLibrary
File: BlueprintEditorLibrary.h
- classmethod add_event_dispatcher(blueprint, name) bool¶
Creates a new event dispatcher on the Blueprint with the given name. Returns false if the name is already in use or the Blueprint is invalid.
- classmethod add_event_dispatcher_parameter(blueprint, dispatcher_name, param_name, param_type) bool¶
Adds a parameter to an event dispatcher’s signature. Returns false if the dispatcher does not exist or the parameter name is already in use.
- Parameters:
blueprint (Blueprint)
dispatcher_name (Name)
param_name (Name)
param_type (EdGraphPinType)
- Return type:
- classmethod add_event_override(blueprint, event_name, position) K2Node_Event¶
Creates an event-override node in the Blueprint’s event graph for an inherited event-shape function.
If an event node for this function already exists on the Blueprint it is returned unchanged. Fails (returns nullptr) when the function is not an event-shape overridable on this Blueprint, when no event graph exists, or when the Blueprint is invalid.
- Parameters:
- Returns:
The event-override node, or nullptr if it could not be created.
- Return type:
- classmethod add_function_graph(blueprint, func_name='NewFunction') EdGraph¶
Adds a function to the given blueprint
- classmethod add_function_override(blueprint, function_name) EdGraph¶
Creates a function-graph override of an inherited function. The graph’s terminator nodes inherit the parent’s signature and a CallParentFunction node is emitted.
If a function graph with this name already exists it is returned unchanged. Fails if the function is already overridden as an event node (remove that node first).
- classmethod add_member_variable(blueprint, member_name, variable_type) bool¶
Adds a member variable to the specified blueprint with the specified type.
- Parameters:
blueprint (Blueprint)
member_name (Name)
variable_type (EdGraphPinType)
- Returns:
true if it succeeds, false if it fails.
- Return type:
- classmethod change_member_variable_type(blueprint, variable_name, new_type) None¶
Changes the specified member variable’s type - inherited variables must have their type changed at the point of declaration
- Parameters:
blueprint (Blueprint)
variable_name (Name)
new_type (EdGraphPinType)
- 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:
- Returns:
result (AssetSaveVersionComparisonResults): The outcome of the version comparison
- Return type:
- 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:
- Returns:
result (AssetSaveVersionComparisonResults): The outcome of the version comparison
- Return type:
- classmethod create_blueprint_asset_with_parent(asset_path, parent_class) Blueprint¶
Creates a blueprint based on a specific parent, honoring registered custom blueprint types
- classmethod find_condition_pin(node) BlueprintGraphPin¶
Finds the Condition pin on this node
- Parameters:
node (K2Node_IfThenElse)
- Return type:
- classmethod find_data_input_pin(node) BlueprintGraphPin¶
Returns the single data input pin associated with this node, returning default pin if there are multiple or no input(s)
- Parameters:
node (K2Node)
- Return type:
- classmethod find_else_pin(node) BlueprintGraphPin¶
Finds the Else pin on this node
- Parameters:
node (K2Node_IfThenElse)
- Return type:
- 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”).
- classmethod find_execute_pin(node) BlueprintGraphPin¶
Returns the ‘execute’ or ‘do’ pin associated with this node, if any
- Parameters:
node (K2Node)
- Return type:
- classmethod find_graph(blueprint, graph_name) EdGraph¶
Finds the graph with the given name on the blueprint. Null if it doesn’t have one.
- classmethod find_input_pin(node, pin_name, type=[]) BlueprintGraphPin¶
Returns an input pin specified by name and, optionally, type
- Parameters:
node (K2Node)
pin_name (Name)
type (EdGraphPinType)
- Return type:
- classmethod find_input_pin_by_index(node, index, type=[]) BlueprintGraphPin¶
Returns an input pin specified by index and, optionally, type
- Parameters:
node (K2Node)
index (int32)
type (EdGraphPinType)
- Return type:
- classmethod find_output_pin(node, pin_name, type=[]) BlueprintGraphPin¶
Returns an output pin specified by name and, optionally, type
- Parameters:
node (K2Node)
pin_name (Name)
type (EdGraphPinType)
- Return type:
- classmethod find_output_pin_by_index(node, index, type=[]) BlueprintGraphPin¶
Returns an output pin specified by index and, optionally, type
- Parameters:
node (K2Node)
index (int32)
type (EdGraphPinType)
- Return type:
- classmethod find_result_pin(node) BlueprintGraphPin¶
Returns the single data output pin associated with this node, returning default pin if there are multiple or no output(s)
- Parameters:
node (K2Node)
- Return type:
- classmethod find_self_pin(node) BlueprintGraphPin¶
Returns the self pin associated with this node, if any
- Parameters:
node (K2Node)
- Return type:
- classmethod find_then_pin(node) BlueprintGraphPin¶
Returns the ‘then’ pin associated with this node, if any
- Parameters:
node (K2Node)
- Return type:
- classmethod generated_class(blueprint_obj)¶
Gets the class generated when this blueprint is compiled
- 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:
- 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:
- classmethod get_blueprint_asset(object) Blueprint¶
Finds the UBlueprint associated with the object, locally searching the object graph for a UBlueprint associated with an asset object. If the Object is a UBlueprint this function will perform a simple cast. Note that the blueprint object itself is editor only and not present in cooked assets.
- 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.
- classmethod get_blueprint_parent_class(blueprint)¶
Returns the parent class of the given Blueprint.
- classmethod get_blueprint_variable_category(blueprint, variable_name) Text¶
Gets the user-defined category of a Blueprint member variable. Categories are used to group variables in the My Blueprint panel.
- classmethod get_blueprint_variable_replication(blueprint, variable_name) BlueprintVariableReplication¶
Gets the replication mode of a Blueprint variable.
- Parameters:
- Returns:
The replication mode: None, Replicated, or RepNotify
- Return type:
- classmethod get_class_reference_type(class_type) EdGraphPinType¶
- Parameters:
- Returns:
a class reference pintype for the provided class - returns ‘int’ type if invalid class is provided
- Return type:
- classmethod get_comment_color(comment_node) LinearColor¶
Gets the background color of a comment node.
- Parameters:
comment_node (EdGraphNode_Comment)
- Return type:
- classmethod get_comment_text(comment_node) str¶
Returns the comment text of a comment node.
- Parameters:
comment_node (EdGraphNode_Comment)
- Return type:
- classmethod get_create_delegate_function(node) Name¶
Returns the selected function name on a Create Event node (the dropdown value). Returns NAME_None if no function is selected.
- Parameters:
node (K2Node_CreateDelegate)
- Return type:
- 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:
- classmethod get_map_type(key_type, value_type) EdGraphPinType¶
- Parameters:
key_type (EdGraphPinType)
value_type (EdGraphPinType)
- Returns:
a map of KeyType to ValueType type - returns ‘int’ type if invalid type is provided
- Return type:
- classmethod get_member_variable_type(blueprint, member_variable_name) EdGraphPinType | None¶
Returns the type of a member variable, unset if no variable is found. Inherited variables can be requested using a fully qualified name to avoid ambiguities.
- Parameters:
- Return type:
Optional[EdGraphPinType]
- classmethod get_node_size(node) Vector2D¶
Returns the size (width, height) of a node as stored in the graph data. Note: sizes are only populated after the graph has been rendered in the editor.
- Parameters:
node (EdGraphNode)
- Return type:
- classmethod get_node_title(node) str¶
Returns this node’s title, as used when the node is displayed in a list
- classmethod get_nodes_in_comment(comment_node) Array[K2Node]¶
Returns the K2 nodes contained within the given comment node. Only UK2Node-derived nodes are returned; nested comments and other non-K2 node types are excluded. Membership is explicitly maintained when comments are created programmatically. Note: if the comment is manually moved or resized in the editor, membership is rebuilt spatially and may diverge from the programmatic assignment.
- Parameters:
comment_node (EdGraphNode_Comment)
- Return type:
- classmethod get_object_reference_type(object_type) EdGraphPinType¶
- Parameters:
- Returns:
a object reference pintype for the provided class - returns ‘int’ type if invalid object type is provided
- Return type:
- 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
- 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:
- 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:
- classmethod list_all_pins(node, direction=EdGraphPinDirection.EGPD_MAX) Array[BlueprintGraphPin]¶
Returns all visible pins on this node, optionally discriminated by direction
- Parameters:
node (K2Node)
direction (EdGraphPinDirection)
- Return type:
- classmethod list_compatible_functions_for_delegate(node) Array[Name]¶
Lists functions compatible with the delegate signature of a Create Event node. Returns an empty array if the node’s delegate output pin is not yet connected.
- Parameters:
node (K2Node_CreateDelegate)
- Return type:
- classmethod list_event_dispatchers(blueprint) Array[Name]¶
Returns the names of all event dispatchers defined on the Blueprint.
- classmethod list_events(blueprint) Array[BlueprintFunctionInfo]¶
Lists all events visible on this Blueprint: locally defined custom events, overridable parent-class events, and event-shape interface members. Each entry carries an is_implemented flag indicating whether the event node has been placed on the Blueprint.
- Parameters:
blueprint (Blueprint)
- Return type:
- classmethod list_functions(blueprint) Array[BlueprintFunctionInfo]¶
Lists all non-event functions visible on this Blueprint: locally defined function graphs, overridable parent-class functions, and functions declared on interfaces (both explicitly implemented and inherited through a natively-implemented interface). Each entry carries an is_implemented flag indicating whether a function graph for that name exists on the Blueprint.
- Parameters:
blueprint (Blueprint)
- Return type:
- classmethod list_graph_names(blueprint) Array[Name]¶
Lists the names of the editable graphs in the BP
- classmethod list_graphs(blueprint) Array[EdGraph]¶
Lists all of the graphs that a Blueprint contains.
- classmethod list_input_pins(node) Array[BlueprintGraphPin]¶
Returns all visible input pins on this node
- Parameters:
node (K2Node)
- Return type:
- classmethod list_member_variable_names(blueprint, include_inherited_members=True) Array[str]¶
Lists the names of the member variables in the BP. Inherited members will be prefixed with the full path of their declaring class.
- classmethod list_output_pins(node) Array[BlueprintGraphPin]¶
Returns all visible output pins on this node
- Parameters:
node (K2Node)
- Return type:
- classmethod pin_type_to_json_schema(pin_type, self_context) str¶
A: json schema string describing the type
- Parameters:
pin_type (EdGraphPinType)
- Return type:
- classmethod refresh_open_editors_for_blueprint(bp) None¶
Attempt to refresh any open blueprint editors for the given asset
- Parameters:
bp (Blueprint)
- classmethod remove_event_dispatcher(blueprint, name) bool¶
Removes the event dispatcher with the given name from the Blueprint. Returns false if no dispatcher with that name exists or the Blueprint is invalid.
- classmethod remove_event_dispatcher_parameter(blueprint, dispatcher_name, param_name) bool¶
Removes a parameter from an event dispatcher’s signature. Returns false if the dispatcher or parameter does not exist.
- classmethod remove_function_graph(blueprint, func_name) None¶
Deletes the function of the given name on this blueprint. Does NOT replace function call sites.
- classmethod remove_graph(blueprint, graph) None¶
Removes the given graph from the blueprint if possible
- 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
- classmethod reparent_blueprint(blueprint, new_parent_class) None¶
Attempts to reparent the given blueprint to the new chosen parent class.
- 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
- classmethod set_blueprint_variable_category(blueprint, variable_name, new_category) None¶
Sets the user-defined category on a Blueprint member variable. Categories are used to group variables in the My Blueprint panel. Note: Will not change the category for variables defined via native classes.
- 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
- 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
- classmethod set_blueprint_variable_instance_editable(blueprint, variable_name, instance_editable) None¶
Sets “Instance Editable” to true/false on a Blueprint variable
- classmethod set_blueprint_variable_replication(blueprint, variable_name, replication) None¶
Sets the replication mode on a Blueprint variable. RepNotify will auto-create an OnRep_ function if one does not already exist.
- Parameters:
blueprint (Blueprint) – The blueprint object
variable_name (Name) – The variable name
replication (BlueprintVariableReplication) – The replication mode: None, Replicated, or RepNotify
- classmethod set_comment_color(comment_node, color) None¶
Sets the background color of a comment node.
- Parameters:
comment_node (EdGraphNode_Comment)
color (LinearColor)
- classmethod set_comment_text(comment_node, new_text) None¶
Sets the comment text of a comment node.
- Parameters:
comment_node (EdGraphNode_Comment)
new_text (str)
- classmethod set_create_delegate_function(node, function_name) None¶
Sets the selected function on a Create Event node (the dropdown value). Use ListCompatibleFunctionsForDelegate to find valid function names.
- Parameters:
node (K2Node_CreateDelegate)
function_name (Name)
- 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