- PythonBPAssetLib.md
- PythonBPLib.md
- PythonControlRigLib.md
- PythonDataTableLib.md
- PythonEnumLib.md
- PythonLandscapeLib.md
- PythonLevelLib.md
- PythonMaterialLib.md
- PythonMeshLib.md
- PythonPhysicsAssetLib.md
- PythonRBFLib.md
- PythonStructLib.md
- PythonTestLib.md
- PythonTextureLib.md
PythonBPAssetLib¶
Function Name | Description | |
---|---|---|
get_selected_nodes | None | |
log_schema | None | |
log_all_k2_nodes | None | |
log_all_schemas | Log all available Schemas, and return UClass array | |
get_graph_node_by_name | None | |
get_all_k2_nodes | None | |
get_children_classes | Get the children classes from the specified UClass | |
get_classes_from_module | Get the UClass from the specified module name | |
get_bp_functions_spawners | Get the UFunction from the specified UClass | |
get_bp_function_spawner | Get the Spawner of the specified Blueprint function name, used to create nodes in SGraphPanel |
get_selected_nodes¶
unreal.PythonBPAssetLib.get_selected_nodes(blueprint) -> None
Get Selected Nodes
Args:
blueprint (Blueprint):
log_schema¶
unreal.PythonBPAssetLib.log_schema(blueprint) -> None
Log Schema
Args:
blueprint (Blueprint):
log_all_k2_nodes¶
unreal.PythonBPAssetLib.log_all_k2_nodes() -> None
Log All K2Nodes
log_all_schemas¶
Log all available Schemas, and return UClass array
unreal.PythonBPAssetLib.log_all_schemas() -> Array[type(Class)]
Log all available Schemas, and return UClass array
note: add in v1.2.0
Returns:
Array[type(Class)]: The UClass array
get_graph_node_by_name¶
unreal.PythonBPAssetLib.get_graph_node_by_name(name) -> type(Class)
Get Graph Node by Name
Args:
name (str):
Returns:
type(Class):
get_all_k2_nodes¶
unreal.PythonBPAssetLib.get_all_k2_nodes() -> None
Get All K2Nodes
get_children_classes¶
Get the children classes from the specified UClass
unreal.PythonBPAssetLib.get_children_classes(class_) -> Array[type(Class)]
Get the children classes from the specified UClass
note: add in v1.2.0
Args:
class_ (type(Class)): The UClass
Returns:
Array[type(Class)]: The UClass array of children classes
get_classes_from_module¶
Get the UClass from the specified module name
unreal.PythonBPAssetLib.get_classes_from_module(module_name) -> Array[Object]
Get the UClass from the specified module name
note: add in v1.2.0
Args:
module_name (Name): The module name
Returns:
Array[Object]: The UClass array
get_bp_functions_spawners¶
Get the UFunction from the specified UClass
unreal.PythonBPAssetLib.get_bp_functions_spawners(class_in=None) -> Array[Object]
Get the UFunction from the specified UClass
note: add in v1.2.0
Args:
class_in (type(Class)): The UClass
Returns:
Array[Object]: The UFunction array
get_bp_function_spawner¶
Get the Spawner of the specified Blueprint function name, used to create nodes in SGraphPanel
unreal.PythonBPAssetLib.get_bp_function_spawner(class_in, function_name) -> Object
Get the Spawner of the specified Blueprint function name, used to create nodes in SGraphPanel
note: add in v1.2.0
Args:
class_in (type(Class)): The UClass
function_name (str): The function name
Returns:
Object: The Spawner of the specified Blueprint function name
PythonBPLib¶
Function Name | Description | |
---|---|---|
get_all_property_names | Get all property names on the given 'UClass' | |
get_bool_property | Get the bool value of a named bool property on the given object. Only for the property that cannot be get with 'GetEditorProperty' | |
set_bool_property | Set the value of a named bool property on the given object. Only for the property that cannot be set with 'SetEditorProperty' | |
get_string_property | Get the value of a named FString property on the given object. Only for the property that cannot be get with 'GetEditorProperty' | |
set_string_property | Set the value of a named FString property on the given object. Only for the property that cannot be set with 'SetEditorProperty' | |
get_float_property | Get the value of a named float property on the given object. Only for the property that cannot be get with 'GetEditorProperty' | |
set_float_property | Set the value of a named float property on the given object. Only for the property that cannot be set with 'SetEditorProperty' | |
get_int_property | Get the value of a named int property on the given object. Only for the property that cannot be get with 'GetEditorProperty' | |
set_int_property | Set the value of a named int property on the given object. Only for the property that cannot be set with 'SetEditorProperty' | |
get_vector_property | Get the value of a named Vector property on the given object. Only for the property that cannot be get with 'GetEditorProperty' | |
set_vector_property | Set the value of a named Vector property on the given object. Only for the property that cannot be set with 'SetEditorProperty' | |
get_object_property | Get the value of a named UObject property on the given object. Only for the property that cannot be get with 'GetEditorProperty' | |
set_object_property | Set the value of a named object property on the given object. Only for the property that cannot be set with 'SetEditorProperty' | |
get_object_flags | Get actors that in specified folder, in World Outliner. | |
call_function | Calling a function by name on given object. | |
get_all_objects | Get all UObject in the 'world'. | |
get_objects_by_class | Get all specified class's UObjects in the 'world'. | |
get_all_worlds | Get all 'worlds' in editor。 | |
get_bp_class_hierarchy_package | Get the classes hierarchy of the blueprint instance class. | |
get_redirectors_destination_object | Get the destination object of the Redirector. | |
fix_up_redirectors_in_folder | Fixup all redirector In specified folders | |
fix_up_redirectors | Fix up specified redirectors. | |
get_selected_assets_paths | Get the selected assets paths in content browser | |
set_selected_assets_by_paths | Select specified assets in content browser. | |
get_selected_folder | Get the selected folder's paths in content browser. | |
set_selected_folder | Select specified folder in content browser. | |
set_folder_color | Set the of specified folder's color in content browser. | |
clear_folder_color | Clear the of specified folder's color in content browser. | |
sync_to_assets | Sync Assets in Content Browser. | |
get_selected_components | Get selected components in World Outliner. | |
create_folder_in_outliner | Create new folder in World Outliner. | |
set_selected_folder_path | Sets the folder path for all the selected actors. | |
delete_folder | Delete specified folder in World Outliner. | |
get_actors_from_folder | Get actors that in specified folder, in World Outliner. | |
rename_folder_in_world | Rename the specified path to a new name. | |
close_editor_for_assets | Close all active editors for the supplied asset. | |
get_all_deps | Get all dependencies of specified package path. | |
get_all_refs | Get all referencers of specified package path | |
get_assets_data_by_package_names | Gets asset data for the assets in the packages | |
get_assets_data_by_class | Get AssetDatas for the assets in specified folders and types. | |
list_assets_by_class | Get asset paths(assetData.ObjectPath)for the specified folders and types. | |
select_none | De-select all actors. Does nothing if GEdSelectionLock is true. | |
select_named_actor | Select actor by name(ID Name) | |
select_component | Select specified component of current actor | |
select_actor | Select specified actor. | |
find_actor_by_name | Get actor by name(ID Name) in specified World | |
find_actors_by_label_name | Get actor by Label name(display Name) in specified World | |
execute_console_command | Execute Console Command | |
exec_python_command | Execute Python Command if Python is available | |
set_anim_blueprint | Assign the animBlueprint to the SkeletalMeshComponent, this will clear and re-initializes the anim instance with the new class and sets animation mode to 'AnimationBlueprint' | |
get_anim_blueprint_generated_class | Get the generated class of the animBlueprint | |
get_blueprint_generated_class | Get the generated class of the Blueprint | |
get_static_mesh_section_info | Get the material indexes of specified LOD in static mesh | |
set_static_mesh_lod_material_id | Assign the specified section material in Mesh | |
message_dialog | Open a modal message box dialog | |
confirm_dialog | Open a modal message box dialog with Yes/No/Cancel button. | |
open_file_dialog | Open a files picker dialog. | |
save_file_dialog | Open a save file dialog. | |
open_directory_dialog | Open a directory picker dialog. | |
get_plugin_base_dir | Get the base directory of named plug-in. | |
set_clipboard_content | Set the string content to clipboard | |
get_clipboard_content | Get the string content From clipboard | |
notification | Adds a floating notification | |
get_all_chameleon_data_paths | Get the chameleonData by JSON file path | |
get_chameleon_data | Get the chameleonData by JSON file path | |
multi_line_trace_at_once_by_profile | Trace Multi rays against the world using a specific profile in a gird and return the first blocking hits, | |
sample_heights | Trace rays against the world using a specific profile in a gird and return the first blocking hits, | |
gc | Deletes all unreferenced objects, keeping objects that have any of the passed in KeepFlags set. Will wait for other threads to unlock GC. | |
pilot_level_actor | Moves the viewport camera according to the actors location and rotation | |
eject_pilot_level_actor | Eject the viewport camera | |
get_pilot_level_actor | Get the Pilot actor of current Active viewport | |
get_level_viewport_camera_info | Get the location and rotation of level viewport camera | |
get_level_viewport_camera_fov | Get the fov of level viewport camera | |
set_level_viewport_camera_fov | Set the fov of level viewport camera | |
get_level_viewport_camera_aspect | Get the aspect of level viewport camera | |
get_level_viewport_size | Get the size of level viewport | |
get_level_viewport_camera_speed | Get the speed setting(1-8) of level viewport camera | |
set_level_viewport_camera_speed | Set the speed setting(1-8) of level viewport camera | |
set_level_viewport_camera_info | Set the location and rotation of level viewport camera | |
set_level_viewport_real_time | Set the viewport real-time state. | |
request_viewport_focus_on_selection | Move the editor camera in front of selection. | |
set_level_viewport_is_in_game_view | Set IsInGameView of level view. | |
set_level_viewport_locked | Set Whether showing the exact camera view when locking a viewport to a camera. | |
get_resource_size | Get the size of the object/resource for use in memory tools | |
spawn_actor_from_object | Create an actor and place it in the world editor. The Actor can be created from a Factory, Archetype, Blueprint, Class or an Asset. | |
spawn_actor_from_class | Create an actor and place it in the world editor. Can be created from a Blueprint or a Class. | |
add_component | Create a specified Component for actor. | |
delete_asset | Delete the asset in path. | |
enable_world_composition | Enable World Composition in current level. | |
export_map | Exports the specified actor mesh to .obj file. | |
diff_assets | Compare assets by 3rd compare tools, for instance: p4merge etc.. | |
open_pick_path_dialog | Open A 'UE style' Pick Path Dialog | |
open_new_asset_path_dialog | Open A 'UE style' Pick Asset Path Dialog | |
save_thumbnail | Save the Thumbnail of assets to disc. | |
apply_instance_changes_to_blueprint | Apply Instance Changes To Blueprint | |
get_viewport_pixels | Get the raw pixels from first active viewport | |
get_viewport_pixels_as_texture | Get the content of first active viewport as Texture2D | |
get_viewport_pixels_as_data | Get the raw pixels from first active viewport as RawData | |
get_viewport_linear_color_pixels | Get the raw linear color pixels from first active viewport | |
viewport_redraw | Redraw the first active viewport | |
update_reflection_capture_preview_shape | None | |
break_soft_object | Break the SoftObject content into Array: [AssetPathString, SubPathString] | |
get_unreal_version | Get the Version of Unreal Engine in a map(dict). The keys: ["Major", "Minor", "Patch"] | |
get_ta_python_version | Get the Version of TAPython in a map(dict). The keys: ["Major", "Minor", "Patch"] | |
guid_from_string | Generate a Guid instance from Guid value string. The new Guid's value will to the input guid string. | |
get_modifier_keys_state | Get the modifier keys state in TMap. Control/Alt/Shift/Command/CapsLock etc. | |
get_latest_context_object | None | |
snapshot_details | Take a snapshot of the details panel and save it to a file. | |
get_class_path_name | Get the ClassPathName of the asset. | |
calculate_projection_matrix | Calculate the Projection Matrix by fov and near plane. | |
calculate_view_matrix | Calculate the View Matrix by ViewLocation and ViewRotation. | |
calculate_vp_matrix | Calculate the ViewProjection Matrix by ViewLocation, ViewRotation, HorzFOVDegrees and NearPlane. | |
calculate_inv_view_projection_matrix | Calculate the inverse ViewProjection Matrix by ViewLocation, ViewRotation, HorzFOVDegrees and NearPlane. | |
project_world_to_view | Project world position to view position. | |
frustum_trace | Trace rays against the world using a specific profile in a gird in Frustum and return the hits. |
get_all_property_names¶
Get all property names on the given 'UClass'
unreal.PythonBPLib.get_all_property_names(class_, flag=-1) -> Array[str]
Get all property names on the given 'UClass'
Args:
class_ (type(Class)): The UClass of the Properties you are looking for.
flag (int32): The EPropertyFlags for filter the Properties, 1 = EPropertyFlags.CPF_Edit, the default value -1 for all properties.
Returns:
Array[str]: all the property names of the Class.
get_bool_property¶
Get the bool value of a named bool property on the given object. Only for the property that cannot be get with 'GetEditorProperty'
unreal.PythonBPLib.get_bool_property(object, property_name) -> bool
Get the bool value of a named bool property on the given object. Only for the property that cannot be get with 'GetEditorProperty'
Args:
object (Object): The object you want to retrieve a property value from.
property_name (str): The name of the object's bool property.
Returns:
bool: The bool value of property.
set_bool_property¶
Set the value of a named bool property on the given object. Only for the property that cannot be set with 'SetEditorProperty'
unreal.PythonBPLib.set_bool_property(object, property_name, new_value) -> bool
Set the value of a named bool property on the given object. Only for the property that cannot be set with 'SetEditorProperty'
Args:
object (Object): The object you want to set a property value on.
property_name (str): The name of the object's bool property.
new_value (bool): The new bool value
Returns:
bool: Whether the property was set.
get_string_property¶
Get the value of a named FString property on the given object. Only for the property that cannot be get with 'GetEditorProperty'
unreal.PythonBPLib.get_string_property(object, property_name) -> str
Get the value of a named FString property on the given object. Only for the property that cannot be get with 'GetEditorProperty'
Args:
object (Object): The object you want to retrieve a property value from.
property_name (str): The name of the object's FString property.
Returns:
str: The string value of property.
set_string_property¶
Set the value of a named FString property on the given object. Only for the property that cannot be set with 'SetEditorProperty'
unreal.PythonBPLib.set_string_property(object, property_name, new_value) -> bool
Set the value of a named FString property on the given object. Only for the property that cannot be set with 'SetEditorProperty'
Args:
object (Object): The object you want to set a property value on.
property_name (str): The name of the object's FString property.
new_value (str): The new FString value
Returns:
bool: Whether the property was set.
get_float_property¶
Get the value of a named float property on the given object. Only for the property that cannot be get with 'GetEditorProperty'
unreal.PythonBPLib.get_float_property(object, property_name) -> float
Get the value of a named float property on the given object. Only for the property that cannot be get with 'GetEditorProperty'
Args:
object (Object): The object you want to retrieve a property value from.
property_name (str): The name of the object's float property.
Returns:
float: The float value of property.
set_float_property¶
Set the value of a named float property on the given object. Only for the property that cannot be set with 'SetEditorProperty'
unreal.PythonBPLib.set_float_property(object, property_name, new_value) -> bool
Set the value of a named float property on the given object. Only for the property that cannot be set with 'SetEditorProperty'
Args:
object (Object): The object you want to set a property value on.
property_name (str): The name of the object's float property.
new_value (float): The new float value
Returns:
bool: Whether the property was set.
get_int_property¶
Get the value of a named int property on the given object. Only for the property that cannot be get with 'GetEditorProperty'
unreal.PythonBPLib.get_int_property(object, property_name) -> int32
Get the value of a named int property on the given object. Only for the property that cannot be get with 'GetEditorProperty'
Args:
object (Object): The object you want to retrieve a property value from.
property_name (str): The name of the object's int property.
Returns:
int32: The int value of property.
set_int_property¶
Set the value of a named int property on the given object. Only for the property that cannot be set with 'SetEditorProperty'
unreal.PythonBPLib.set_int_property(object, property_name, new_value) -> bool
Set the value of a named int property on the given object. Only for the property that cannot be set with 'SetEditorProperty'
Args:
object (Object): The object you want to set a property value on.
property_name (str): The name of the object's int property.
new_value (int32): The new int value
Returns:
bool: Whether the property was set.
get_vector_property¶
Get the value of a named Vector property on the given object. Only for the property that cannot be get with 'GetEditorProperty'
unreal.PythonBPLib.get_vector_property(object, property_name) -> Vector
Get the value of a named Vector property on the given object. Only for the property that cannot be get with 'GetEditorProperty'
note: added in v1.0.9
Args:
object (Object): The object you want to retrieve a property value from.
property_name (str): The name of the object's int property.
Returns:
Vector: The Vector value of property.
set_vector_property¶
Set the value of a named Vector property on the given object. Only for the property that cannot be set with 'SetEditorProperty'
unreal.PythonBPLib.set_vector_property(object, property_name, new_value) -> bool
Set the value of a named Vector property on the given object. Only for the property that cannot be set with 'SetEditorProperty'
note: added in v1.0.9
Args:
object (Object): The object you want to set a property value on.
property_name (str): The name of the object's int property.
new_value (Vector): The new Vector value
Returns:
bool: Whether the property was set.
get_object_property¶
Get the value of a named UObject property on the given object. Only for the property that cannot be get with 'GetEditorProperty'
unreal.PythonBPLib.get_object_property(object, property_name) -> Object
Get the value of a named UObject property on the given object. Only for the property that cannot be get with 'GetEditorProperty'
Args:
object (Object): The object you want to retrieve a property value from.
property_name (str): The name of the object's UObject property.
Returns:
Object: The UObject value of property.
set_object_property¶
Set the value of a named object property on the given object. Only for the property that cannot be set with 'SetEditorProperty'
unreal.PythonBPLib.set_object_property(object, property_name, new_value) -> bool
Set the value of a named object property on the given object. Only for the property that cannot be set with 'SetEditorProperty'
Args:
object (Object): The object you want to set a property value on.
property_name (str): The name of the object's UObject property.
new_value (Object): The new object value
Returns:
bool: Whether the property was set.
get_object_flags¶
Get actors that in specified folder, in World Outliner.
unreal.PythonBPLib.get_object_flags(object) -> int32
Get actors that in specified folder, in World Outliner.
note: added in v1.0.4. The Result can be better displayed with the Utilities.Utils.EObjectFlags(IntFlag)
Args:
object (Object): The object you want to get the EObjectFlags.
Returns:
int32: The flag values in int32
call_function¶
Calling a function by name on given object.
unreal.PythonBPLib.call_function(object, functio_name_and_args) -> bool
Calling a function by name on given object.
deprecated: Use obj.call_method instead
Args:
object (Object): The object you want to call the function.
functio_name_and_args (str): The function name and the args.
Returns:
bool: Whether the function was called.
get_all_objects¶
Get all UObject in the 'world'.
unreal.PythonBPLib.get_all_objects(world, include_dead) -> Array[Object]
Get all UObject in the 'world'.
Args:
world (World): The world owned the UObjects.
include_dead (bool): Whether include the 'dead' (PendingKill | Unreachable) UObject or not.
Returns:
Array[Object]:
out_objects (Array[Object]): The All UObject in the world.
get_objects_by_class¶
Get all specified class's UObjects in the 'world'.
unreal.PythonBPLib.get_objects_by_class(world, object_class) -> Array[Object]
Get all specified class's UObjects in the 'world'.
Args:
world (World): The world owned the actors.
object_class (type(Class)): The specified of classes for query.
Returns:
Array[Object]:
out_objects (Array[Object]): The UObjects of specified class in the world.
get_all_worlds¶
Get all 'worlds' in editor。
unreal.PythonBPLib.get_all_worlds() -> Array[World]
Get all 'worlds' in editor。
Returns:
Array[World]:
out_worlds (Array[World]): The worlds in the editor.
get_bp_class_hierarchy_package¶
Get the classes hierarchy of the blueprint instance class.
unreal.PythonBPLib.get_bp_class_hierarchy_package(class_) -> Array[Package] or None
Get the classes hierarchy of the blueprint instance class.
Args:
class_ (type(Class)): The blueprint instance class you want to query.
Returns:
Array[Package] or None: Whether Retrieve the BP hierarchy succeeded.
out_bpg_classes_package (Array[Package]): Array of classes hierarchy. 0th = this
get_redirectors_destination_object¶
Get the destination object of the Redirector.
unreal.PythonBPLib.get_redirectors_destination_object(redirector_obj) -> Object
Get the destination object of the Redirector.
Args:
redirector_obj (Object): the Redirector Object.
Returns:
Object: a pointer to the Redirector's destination object.
fix_up_redirectors_in_folder¶
Fixup all redirector In specified folders
unreal.PythonBPLib.fix_up_redirectors_in_folder(folder_paths, allowed_to_prompt_to_load_assets=True) -> bool
Fixup all redirector In specified folders
note: Param FolderPaths
Args:
folder_paths (Array[str]): The folder paths array for fixup redirectors.
allowed_to_prompt_to_load_assets (bool):
Returns:
bool: Whether fixup task succeeded.
fix_up_redirectors¶
Fix up specified redirectors.
unreal.PythonBPLib.fix_up_redirectors(redirector_objs) -> bool
Fix up specified redirectors.
Args:
redirector_objs (Array[Object]): The redirector objects to be fixed.
Returns:
bool: Whether fix up task succeeded
get_selected_assets_paths¶
Get the selected assets paths in content browser
unreal.PythonBPLib.get_selected_assets_paths() -> Array[str]
Get the selected assets paths in content browser
Returns:
Array[str]: The paths of selected assets.
set_selected_assets_by_paths¶
Select specified assets in content browser.
unreal.PythonBPLib.set_selected_assets_by_paths(paths) -> None
Select specified assets in content browser.
Args:
paths (Array[str]): The assets paths that will be selected, if empty, deselected current selection.
get_selected_folder¶
Get the selected folder's paths in content browser.
unreal.PythonBPLib.get_selected_folder() -> Array[str]
Get the selected folder's paths in content browser.
Returns:
Array[str]: The paths of current selected folders.
set_selected_folder¶
Select specified folder in content browser.
unreal.PythonBPLib.set_selected_folder(folders) -> None
Select specified folder in content browser.
Args:
folders (Array[str]):
set_folder_color¶
Set the of specified folder's color in content browser.
unreal.PythonBPLib.set_folder_color(folder_path, color) -> None
Set the of specified folder's color in content browser.
Args:
folder_path (str): The folder path in project. For example: "/Game/StarterContent"
color (LinearColor): The color of folder.
clear_folder_color¶
Clear the of specified folder's color in content browser.
unreal.PythonBPLib.clear_folder_color(folder_path) -> None
Clear the of specified folder's color in content browser.
Args:
folder_path (str): The folder path in project. For example: "/Game/StarterContent"
sync_to_assets¶
Sync Assets in Content Browser.
unreal.PythonBPLib.sync_to_assets(asset_data_list, allow_locked_browsers=False, focus_content_browser=True) -> None
Sync Assets in Content Browser.
Args:
asset_data_list (Array[AssetData]): Asset Data list
allow_locked_browsers (bool): Allow Sync in Locked Browsers
focus_content_browser (bool): Set focus to the content browser
get_selected_components¶
Get selected components in World Outliner.
unreal.PythonBPLib.get_selected_components() -> Array[ActorComponent]
Get selected components in World Outliner.
Returns:
Array[ActorComponent]: The selected actor components.
create_folder_in_outliner¶
Create new folder in World Outliner.
unreal.PythonBPLib.create_folder_in_outliner(world, new_folder_name) -> None
Create new folder in World Outliner.
Args:
world (World): World Context.
new_folder_name (Name): The name of new folder.
set_selected_folder_path¶
Sets the folder path for all the selected actors.
unreal.PythonBPLib.set_selected_folder_path(path) -> None
Sets the folder path for all the selected actors.
Args:
path (Name): The folder path name in World Outliner.
delete_folder¶
Delete specified folder in World Outliner.
unreal.PythonBPLib.delete_folder(world, folder_to_delete) -> None
Delete specified folder in World Outliner.
Args:
world (World):
folder_to_delete (Name): The name of folder path which need to be deleted.
get_actors_from_folder¶
Get actors that in specified folder, in World Outliner.
unreal.PythonBPLib.get_actors_from_folder(world, path) -> Array[Actor]
Get actors that in specified folder, in World Outliner.
note: added in v1.0.4
Args:
world (World): World Context
path (str): The folder path name in World Outliner.
Returns:
Array[Actor]:
out_actors (Array[Actor]):
rename_folder_in_world¶
Rename the specified path to a new name.
unreal.PythonBPLib.rename_folder_in_world(world, old_path, new_path) -> bool
Rename the specified path to a new name.
Args:
world (World): World Context
old_path (Name): Old Folder Path
new_path (Name): New Folder Path
Returns:
bool:
close_editor_for_assets¶
Close all active editors for the supplied asset.
unreal.PythonBPLib.close_editor_for_assets(assets) -> None
Close all active editors for the supplied asset.
note: Also can use unreal.get_editor_subsystem(unreal.AssetEditorSubsystem).close_all_editors_for_asset(assets) instead
Args:
assets (Array[Object]): Array of assets that will be closed.
get_all_deps¶
Get all dependencies of specified package path.
unreal.PythonBPLib.get_all_deps(package_path, recursive, dependency_type=3) -> (out_dps_wf=Array[str], parent_indexs=Array[int32])
Get all dependencies of specified package path.
Args:
package_path (Name): the name of the package for which to gather dependencies.
recursive (bool): recursive or not.
dependency_type (int32): Which kinds of dependency to include in the output list. For example: 3: package (Soft|Hard), 18: manage(SoftManager|HardManage), 25: all
Returns:
tuple:
out_dps_wf (Array[str]): a list of packages that are referenced by the package whose path is PackageName, wide first.
parent_indexs (Array[int32]):
get_all_refs¶
Get all referencers of specified package path
unreal.PythonBPLib.get_all_refs(package_path, recursive, dependency_type=3) -> (out_refs_wf=Array[str], parent_index=Array[int32])
Get all referencers of specified package path
Args:
package_path (Name): the name of the package for which to gather references.
recursive (bool): recursive or not
dependency_type (int32): which kinds of dependency to include in the output list. For example: 3: package (Soft|Hard), 18: manage(SoftManager|HardManage) ,25: all
Returns:
tuple:
out_refs_wf (Array[str]): a list of packages that reference the package whose path is PackageName, wide first
parent_index (Array[int32]): a list of index of OutRefsWF element's parent
get_assets_data_by_package_names¶
Gets asset data for the assets in the packages
unreal.PythonBPLib.get_assets_data_by_package_names(package_names) -> Array[AssetData]
Gets asset data for the assets in the packages
note: This is 'batch' version of unreal.AssetRegistry.get_assets_by_package_name(...)
Args:
package_names (Array[str]): the package names for the requested assets (eg, /Game/MyFolder/MyAsset)
Returns:
Array[AssetData]:
out_asset_datas (Array[AssetData]):
get_assets_data_by_class¶
Get AssetDatas for the assets in specified folders and types.
unreal.PythonBPLib.get_assets_data_by_class(paths_folders, class_names) -> Array[AssetData]
Get AssetDatas for the assets in specified folders and types.
Args:
paths_folders (Array[str]): Array of target folders.
class_names (Array[Name]): Specified class types. For example, ["World", "MaterialInstance", "StaticMesh", and so on..]
Returns:
Array[AssetData]:
out_asset_datas (Array[AssetData]): Result of AssetDatas.
list_assets_by_class¶
Get asset paths(assetData.ObjectPath)for the specified folders and types.
unreal.PythonBPLib.list_assets_by_class(paths_folders, class_names) -> Array[Name]
Get asset paths(assetData.ObjectPath)for the specified folders and types.
Args:
paths_folders (Array[str]): Array of target folders.
class_names (Array[Name]): Specified class types.
Returns:
Array[Name]:
out_object_path (Array[Name]): Result of asset paths.
select_none¶
De-select all actors. Does nothing if GEdSelectionLock is true.
unreal.PythonBPLib.select_none(note_selection_change=True, deselect_bsp_surfs=True) -> None
De-select all actors. Does nothing if GEdSelectionLock is true.
Args:
note_selection_change (bool): If true, call NoteSelectionChange().
deselect_bsp_surfs (bool): If true, also deselected all BSP surfaces.
select_named_actor¶
Select actor by name(ID Name)
unreal.PythonBPLib.select_named_actor(name, clear_selected=True) -> Actor
Select actor by name(ID Name)
Args:
name (str): The ID Name of actor, not the label name.
clear_selected (bool): If true, deselected before select new actor.
Returns:
Actor: A pointer to the named actor or NULL if not found.
select_component¶
Select specified component of current actor
unreal.PythonBPLib.select_component(component, selected, notify=True) -> None
Select specified component of current actor
Args:
component (ActorComponent): The Component to be selected.
selected (bool): Select or deSelect.
notify (bool): Notify or not.
select_actor¶
Select specified actor.
unreal.PythonBPLib.select_actor(actor, selected, notify, select_even_if_hidden=False, force_refresh=False) -> None
Select specified actor.
Args:
actor (Actor): The Actor to be selected.
selected (bool): Select or deSelect.
notify (bool): Notify or not.
select_even_if_hidden (bool): If True, actor will be selected even it's hidden
force_refresh (bool): Force Refresh or not
find_actor_by_name¶
Get actor by name(ID Name) in specified World
unreal.PythonBPLib.find_actor_by_name(name, world=None, include_dead=True) -> Actor
Get actor by name(ID Name) in specified World
Args:
name (str): Name(ID Name) of actor
world (World): World Context
include_dead (bool): Include dead object or not
Returns:
Actor: A pointer to the named actor or NULL if not found.
find_actors_by_label_name¶
Get actor by Label name(display Name) in specified World
unreal.PythonBPLib.find_actors_by_label_name(name, world=None, include_dead=True) -> Array[Actor]
Get actor by Label name(display Name) in specified World
note: added in v1.0.3
Args:
name (str): Name(Label Name) of actor
world (World): World Context
include_dead (bool):
Returns:
Array[Actor]: A pointer to the named actor or NULL if not found.
execute_console_command¶
Execute Console Command
unreal.PythonBPLib.execute_console_command(console_command) -> None
Execute Console Command
Args:
console_command (str): The console command
exec_python_command¶
Execute Python Command if Python is available
unreal.PythonBPLib.exec_python_command(python_command, force_game_thread=False) -> None
Execute Python Command if Python is available
Args:
python_command (str): The python command
force_game_thread (bool): Force running python command in GameThread. For example modify the UI in a thread.
set_anim_blueprint¶
Assign the animBlueprint to the SkeletalMeshComponent, this will clear and re-initializes the anim instance with the new class and sets animation mode to 'AnimationBlueprint'
unreal.PythonBPLib.set_anim_blueprint(mesh_component, anim_blueprint) -> None
Assign the animBlueprint to the SkeletalMeshComponent, this will clear and re-initializes the anim instance with the new class and sets animation mode to 'AnimationBlueprint'
deprecated: Use the function in PythonMeshLib instead.
Args:
mesh_component (SkeletalMeshComponent): Skeletal mesh component
anim_blueprint (AnimBlueprint): The new AnimBlueprint
get_anim_blueprint_generated_class¶
Get the generated class of the animBlueprint
unreal.PythonBPLib.get_anim_blueprint_generated_class(anim_blueprint) -> type(Class)
Get the generated class of the animBlueprint
Args:
anim_blueprint (AnimBlueprint): Skeletal mesh component return a Pointer to the 'most recent' fully generated class
Returns:
type(Class):
get_blueprint_generated_class¶
Get the generated class of the Blueprint
unreal.PythonBPLib.get_blueprint_generated_class(blueprint) -> Object
Get the generated class of the Blueprint
deprecated: Use blueprint.generated_class() instead
Args:
blueprint (Blueprint): The blueprint instance you want to query. return a Pointer to the 'most recent' fully generated class
Returns:
Object:
get_static_mesh_section_info¶
Get the material indexes of specified LOD in static mesh
unreal.PythonBPLib.get_static_mesh_section_info(mesh, lod_level) -> Array[int32]
Get the material indexes of specified LOD in static mesh
Args:
mesh (StaticMesh): The mesh component
lod_level (int32): Specified LOD
Returns:
Array[int32]:
out_material_indexs (Array[int32]): Result Material Indexes array
set_static_mesh_lod_material_id¶
Assign the specified section material in Mesh
unreal.PythonBPLib.set_static_mesh_lod_material_id(mesh, lod_level, section_index, id_in_mesh_static_material, modify_immediately=True) -> None
Assign the specified section material in Mesh
Args:
mesh (StaticMesh): The mesh component.
lod_level (int32): Specified LOD.
section_index (int32): The Section ID in mesh.
id_in_mesh_static_material (int32): The Material Index in mesh's material slots.
modify_immediately (bool): Modify Immediately or not.
message_dialog¶
Open a modal message box dialog
unreal.PythonBPLib.message_dialog(message, dialog_title) -> None
Open a modal message box dialog
para: DialogTitle Text of title in dialog
Args:
message (str): Text of message to show
dialog_title (str):
confirm_dialog¶
Open a modal message box dialog with Yes/No/Cancel button.
unreal.PythonBPLib.confirm_dialog(message, dialog_title, with_cancel_button=False) -> bool
Open a modal message box dialog with Yes/No/Cancel button.
Args:
message (str): Text of message to show.
dialog_title (str): Text of title in dialog.
with_cancel_button (bool): Show cancel button or not.
Returns:
bool:
open_file_dialog¶
Open a files picker dialog.
unreal.PythonBPLib.open_file_dialog(dialog_title, default_path, default_file, file_types) -> Array[str]
Open a files picker dialog.
DefaultFile: Default file name of dialog
FileTypes: File types filter. For example: "Saved JSON (*.json)|*.json"
OutFilenames: The picked files paths
Args:
dialog_title (str): Text of dialog title
default_path (str): Default path of dialog
default_file (str):
file_types (str):
Returns:
Array[str]:
out_filenames (Array[str]):
save_file_dialog¶
Open a save file dialog.
unreal.PythonBPLib.save_file_dialog(dialog_title, default_path, default_file, file_types) -> Array[str]
Open a save file dialog.
DefaultFile: Default file name of dialog
FileTypes: File types filter
OutFilenames: The picked files path
Args:
dialog_title (str): Text of dialog title
default_path (str): Default path of dialog
default_file (str):
file_types (str):
Returns:
Array[str]:
out_filenames (Array[str]):
open_directory_dialog¶
Open a directory picker dialog.
unreal.PythonBPLib.open_directory_dialog(dialog_title, default_path) -> str or None
Open a directory picker dialog.
OutFolderName: The picked folder path
Args:
dialog_title (str): Text of dialog title
default_path (str): Default path of dialog
Returns:
str or None:
out_folder_name (str):
get_plugin_base_dir¶
Get the base directory of named plug-in.
unreal.PythonBPLib.get_plugin_base_dir(plugin_name) -> str
Get the base directory of named plug-in.
Args:
plugin_name (str): Name of the plug-in
Returns:
str:
set_clipboard_content¶
Set the string content to clipboard
unreal.PythonBPLib.set_clipboard_content(str) -> None
Set the string content to clipboard
Args:
str (str): Text to paste
get_clipboard_content¶
Get the string content From clipboard
unreal.PythonBPLib.get_clipboard_content() -> str
Get the string content From clipboard
Returns:
str:
dest (str):
notification¶
Adds a floating notification
unreal.PythonBPLib.notification(message, info_level=0, expire_duration=5.000000, width_override=-1.000000, log_to_console=True, hyperlink_text="", on_hyperlink_click_command="") -> None
log: 0, warning: 1, Error 2 ||-1
Args:
message (str):
info_level (int32):
expire_duration (float):
width_override (float):
log_to_console (bool):
hyperlink_text (str):
on_hyperlink_click_command (str):
get_all_chameleon_data_paths¶
Get the chameleonData by JSON file path
unreal.PythonBPLib.get_all_chameleon_data_paths() -> Array[str]
Get the chameleonData by JSON file path
Returns:
Array[str]: All path of current Chameleon Tools's JSON file paths.
get_chameleon_data¶
Get the chameleonData by JSON file path
unreal.PythonBPLib.get_chameleon_data(tools_json_path) -> ChameleonData
Get the chameleonData by JSON file path
Args:
tools_json_path (str): Path of the JSON file path, which was binded when create the widget
Returns:
ChameleonData:
multi_line_trace_at_once_by_profile¶
Trace Multi rays against the world using a specific profile in a gird and return the first blocking hits,
unreal.PythonBPLib.multi_line_trace_at_once_by_profile(context_obj, start_locs, end_locs, profile_name, draw_debug_type, draw_time) -> (out_is_hit=Array[bool], out_hit_locs=Array[Vector])
Trace Multi rays against the world using a specific profile in a gird and return the first blocking hits,
Args:
context_obj (Object): World Content Object
start_locs (Array[Vector]): Center of the ray trace gird
end_locs (Array[Vector]): Width of the grid
profile_name (Name): The 'profile' used to determine which components to hit
draw_debug_type (DrawDebugTrace): Draw Debug Type: unreal.DrawDebugTrace.FOR_DURATION, FOR_ONE_FRAME, NONE, PERSISTENT
draw_time (float): Debug line display duration
Returns:
tuple:
out_is_hit (Array[bool]):
out_hit_locs (Array[Vector]): The locations of hit result.
sample_heights¶
Trace rays against the world using a specific profile in a gird and return the first blocking hits,
unreal.PythonBPLib.sample_heights(context_obj, center, width, height, grid_size, trace_depth, profile_name, draw_debug_type, draw_time, default_height) -> (out_x_count=int32, out_y_count=int32, out_hit_locs=Array[Vector])
Trace rays against the world using a specific profile in a gird and return the first blocking hits,
Args:
context_obj (Object): World Content Object
center (Vector): Center of the ray trace gird
width (float): Width of the grid
height (float): The height of ray trace start point
grid_size (float): The ray trace interval size
trace_depth (float): Distance from trace start point to the end point
profile_name (Name): The 'profile' used to determine which components to hit
draw_debug_type (DrawDebugTrace): Draw Debug Type: unreal.DrawDebugTrace.FOR_DURATION, FOR_ONE_FRAME, NONE, PERSISTENT
draw_time (float): Debug line display duration
default_height (float): The 'default height' when trace has no result
Returns:
tuple:
out_x_count (int32): The count of trace point in axis-x
out_y_count (int32): The count of trace point in axis-y
out_hit_locs (Array[Vector]): The locations of hit result.
gc¶
Deletes all unreferenced objects, keeping objects that have any of the passed in KeepFlags set. Will wait for other threads to unlock GC.
unreal.PythonBPLib.gc(keep_flags, perform_full_purge=True) -> None
Deletes all unreferenced objects, keeping objects that have any of the passed in KeepFlags set. Will wait for other threads to unlock GC.
Args:
keep_flags (int32): objects with those flags will be kept regardless of being referenced or not
perform_full_purge (bool): if true, perform a full purge after the mark pass
pilot_level_actor¶
Moves the viewport camera according to the actors location and rotation
unreal.PythonBPLib.pilot_level_actor(actor_to_pilot) -> None
Moves the viewport camera according to the actors location and rotation
Args:
actor_to_pilot (Actor): The actor to pilot
eject_pilot_level_actor¶
Eject the viewport camera
unreal.PythonBPLib.eject_pilot_level_actor() -> None
Eject the viewport camera
get_pilot_level_actor¶
Get the Pilot actor of current Active viewport
unreal.PythonBPLib.get_pilot_level_actor() -> Actor
Get the Pilot actor of current Active viewport
Returns:
Actor: The pilot actor
get_level_viewport_camera_info¶
Get the location and rotation of level viewport camera
unreal.PythonBPLib.get_level_viewport_camera_info() -> (camera_location=Vector, camera_rotation=Rotator) or None
Get the location and rotation of level viewport camera
Returns:
tuple or None:
camera_location (Vector): Location of level viewport camera
camera_rotation (Rotator): Rotation of level viewport camera
get_level_viewport_camera_fov¶
Get the fov of level viewport camera
unreal.PythonBPLib.get_level_viewport_camera_fov() -> float
Get the fov of level viewport camera
Returns:
float: The fov of camera in degree.
set_level_viewport_camera_fov¶
Set the fov of level viewport camera
unreal.PythonBPLib.set_level_viewport_camera_fov(fov) -> bool
Set the fov of level viewport camera
note: added in v1.2.0
Args:
fov (float): Fov value of level viewport camera.
Returns:
bool: True if fov is set successfully.
get_level_viewport_camera_aspect¶
Get the aspect of level viewport camera
unreal.PythonBPLib.get_level_viewport_camera_aspect() -> float
Get the aspect of level viewport camera
note: added in v1.2.0
Returns:
float: The aspect of camera.
get_level_viewport_size¶
Get the size of level viewport
unreal.PythonBPLib.get_level_viewport_size() -> IntPoint
Get the size of level viewport
note: added in v1.2.0
Returns:
IntPoint: The size(FIntPoint) of viewport
get_level_viewport_camera_speed¶
Get the speed setting(1-8) of level viewport camera
unreal.PythonBPLib.get_level_viewport_camera_speed() -> int32
Get the speed setting(1-8) of level viewport camera
note: added in v1.0.9
Returns:
int32: the speed setting of viewport's camera
set_level_viewport_camera_speed¶
Set the speed setting(1-8) of level viewport camera
unreal.PythonBPLib.set_level_viewport_camera_speed(speed) -> None
Set the speed setting(1-8) of level viewport camera
note: added in v1.0.9
Args:
speed (int32): Speed value of level viewport camera. 1 <= Speed <=8
set_level_viewport_camera_info¶
Set the location and rotation of level viewport camera
unreal.PythonBPLib.set_level_viewport_camera_info(camera_location, camera_rotation) -> None
Set the location and rotation of level viewport camera
Args:
camera_location (Vector): Location of level viewport camera
camera_rotation (Rotator): Rotation of level viewport camera
set_level_viewport_real_time¶
Set the viewport real-time state.
unreal.PythonBPLib.set_level_viewport_real_time(realtime) -> None
Set the viewport real-time state.
Args:
realtime (bool): Whether real-time or not
request_viewport_focus_on_selection¶
Move the editor camera in front of selection.
unreal.PythonBPLib.request_viewport_focus_on_selection(context_obj=None) -> None
Move the editor camera in front of selection.
Args:
context_obj (Object): Context Object for get the world.
set_level_viewport_is_in_game_view¶
Set IsInGameView of level view.
unreal.PythonBPLib.set_level_viewport_is_in_game_view(game_view) -> None
Set IsInGameView of level view.
Args:
game_view (bool): Is game view.
set_level_viewport_locked¶
Set Whether showing the exact camera view when locking a viewport to a camera.
unreal.PythonBPLib.set_level_viewport_locked(locked) -> None
Set Whether showing the exact camera view when locking a viewport to a camera.
Args:
locked (bool): Game view locked state.
get_resource_size¶
Get the size of the object/resource for use in memory tools
unreal.PythonBPLib.get_resource_size(object, exclusive) -> int32
Get the size of the object/resource for use in memory tools
This is the simple version which just returns the total number of bytes used by this object.
note: Exclusive: Only include memory used by non-UObject resources that are directly owned by this UObject. This is used to show memory actually used at runtime, otherwise include exclusive resources and UObject serialized memory for this and all child UObjects, but not memory for external referenced assets or editor only members. This is used in the editor to estimate maximum required memory. Detail sea EResourceSizeMode
Args:
object (Object): The object you want to query.
exclusive (bool): Exclusive or not
Returns:
int32: The cumulative size of this object in memory
spawn_actor_from_object¶
Create an actor and place it in the world editor. The Actor can be created from a Factory, Archetype, Blueprint, Class or an Asset.
unreal.PythonBPLib.spawn_actor_from_object(obj_to_use, location, rotation=[0.000000, 0.000000, 0.000000], transient=False, select_actors=False) -> Actor
Create an actor and place it in the world editor. The Actor can be created from a Factory, Archetype, Blueprint, Class or an Asset.
The actor will be created in the current level and will be selected.
note: This is alternative version of EditorLevelLibaray.SpawnActorFromObject, and fixed the memory leak issus in before UE 4.27
Args:
obj_to_use (Object):
location (Vector): Location of the new actor.
rotation (Rotator):
transient (bool):
select_actors (bool):
Returns:
Actor: The created actor.
spawn_actor_from_class¶
Create an actor and place it in the world editor. Can be created from a Blueprint or a Class.
unreal.PythonBPLib.spawn_actor_from_class(actor_class, location, rotation=[0.000000, 0.000000, 0.000000], transient=False, select_actors=False) -> Actor
Create an actor and place it in the world editor. Can be created from a Blueprint or a Class.
The actor will be created in the current level and will be selected.
note: This is alternative version of EditorLevelLibaray.SpawnActorFromClass, and fixed the memory leak issus in before UE 4.27
Args:
actor_class (type(Class)): Asset to attempt to use for an actor to place.
location (Vector): Location of the new actor.
rotation (Rotator):
transient (bool):
select_actors (bool):
Returns:
Actor: The created actor.
add_component¶
Create a specified Component for actor.
unreal.PythonBPLib.add_component(component_class, actor, parent_component, name="None") -> ActorComponent
Create a specified Component for actor.
Args:
component_class (type(Class)): The Component type.
actor (Actor): The actor owner the created component.
parent_component (SceneComponent): The parent component for created component.The root component will be used when null.
name (Name): The Name for the created Component
Returns:
ActorComponent: The created component.
delete_asset¶
Delete the asset in path.
unreal.PythonBPLib.delete_asset(asset_path_to_delete, show_confirmation=True) -> bool
Delete the asset in path.
note: This can't undo.
Args:
asset_path_to_delete (str): The Component type.
show_confirmation (bool): Show confirmation dialog or not.
Returns:
bool:
enable_world_composition¶
Enable World Composition in current level.
unreal.PythonBPLib.enable_world_composition(world, enable) -> bool
Enable World Composition in current level.
Args:
world (World): The World context.
enable (bool): Enable the World Composition option or not.
Returns:
bool:
export_map¶
Exports the specified actor mesh to .obj file.
unreal.PythonBPLib.export_map(actor, filename, export_selected_actors_only) -> None
Exports the specified actor mesh to .obj file.
note: Useful when export landscape to mesh obj.
Args:
actor (Actor): The actor to be export.
filename (str): Filename to export to.
export_selected_actors_only (bool): If true, export only the selected actors.
diff_assets¶
Compare assets by 3rd compare tools, for instance: p4merge etc..
unreal.PythonBPLib.diff_assets(asset_a, asset_b) -> None
Compare assets by 3rd compare tools, for instance: p4merge etc..
Args:
asset_a (Object):
asset_b (Object):
open_pick_path_dialog¶
Open A 'UE style' Pick Path Dialog
unreal.PythonBPLib.open_pick_path_dialog(dialog_title="Pick Path", default_path="/Game/") -> str
Open A 'UE style' Pick Path Dialog
note: The DefaultPaht should starts with '/Game', and ends with '/' if pick a folder in 'Content'; 'Engine Content/some_folder' for folder in 'Engine Content'
Args:
dialog_title (str): The Title for Dialog
default_path (str): Default Folder, should ends with '/'.
Returns:
str:
open_new_asset_path_dialog¶
Open A 'UE style' Pick Asset Path Dialog
unreal.PythonBPLib.open_new_asset_path_dialog(dialog_title="Pick Asset Path", default_path="", allow_read_only_folders=True) -> str
Open A 'UE style' Pick Asset Path Dialog
note: The DefaultPaht should starts with '/Game'
Args:
dialog_title (str): The Title for Dialog
default_path (str): Default path and name for new asset path.
allow_read_only_folders (bool):
Returns:
str:
save_thumbnail¶
Save the Thumbnail of assets to disc.
unreal.PythonBPLib.save_thumbnail(object_path, output_path) -> None
Save the Thumbnail of assets to disc.
Args:
object_path (str): The specified path of asset
output_path (str): Thumbnail output path
apply_instance_changes_to_blueprint¶
Apply Instance Changes To Blueprint
unreal.PythonBPLib.apply_instance_changes_to_blueprint(actor) -> int32
Apply Instance Changes To Blueprint
Args:
actor (Actor): The target actor
Returns:
int32: Changed Properties count
get_viewport_pixels¶
Get the raw pixels from first active viewport
unreal.PythonBPLib.get_viewport_pixels() -> (Array[Color], out_size_xy=IntPoint)
Get the raw pixels from first active viewport
note: added in v1.0.4
Returns:
IntPoint: Pixel Color Array, and the size of image in FIntPoint
out_size_xy (IntPoint):
get_viewport_pixels_as_texture¶
Get the content of first active viewport as Texture2D
unreal.PythonBPLib.get_viewport_pixels_as_texture() -> Texture2D
Get the content of first active viewport as Texture2D
note: added in v1.2.0
note: need UE5.0+
Returns:
Texture2D: Texture2D of viewport's content
get_viewport_pixels_as_data¶
Get the raw pixels from first active viewport as RawData
unreal.PythonBPLib.get_viewport_pixels_as_data() -> (Array[uint8], out_size_xy=IntPoint)
Get the raw pixels from first active viewport as RawData
note: added in v1.2.0
Returns:
IntPoint: RawData(uint8) Array, and the size of image(FIntPoint)
out_size_xy (IntPoint):
get_viewport_linear_color_pixels¶
Get the raw linear color pixels from first active viewport
unreal.PythonBPLib.get_viewport_linear_color_pixels(remove_alpha=True) -> (Array[LinearColor], out_size_xy=IntPoint)
Get the raw linear color pixels from first active viewport
note: added in v1.0.11
Args:
remove_alpha (bool):
Returns:
IntPoint: Pixel Color Array, and the size of image
out_size_xy (IntPoint):
viewport_redraw¶
Redraw the first active viewport
unreal.PythonBPLib.viewport_redraw() -> None
Redraw the first active viewport
note: added in v1.0.4
update_reflection_capture_preview_shape¶
unreal.PythonBPLib.update_reflection_capture_preview_shape(capture_component) -> None
Update Reflection Capture Preview Shape
Args:
capture_component (ReflectionCaptureComponent):
break_soft_object¶
Break the SoftObject content into Array: [AssetPathString, SubPathString]
unreal.PythonBPLib.break_soft_object(soft_object_path) -> Array[str]
Break the SoftObject content into Array: [AssetPathString, SubPathString]
note: added in v1.0.4
Args:
soft_object_path (SoftObjectPath):
Returns:
Array[str]: AssetPathString and SubPathString of the SoftObect in a array.
get_unreal_version¶
Get the Version of Unreal Engine in a map(dict). The keys: ["Major", "Minor", "Patch"]
unreal.PythonBPLib.get_unreal_version() -> Map[str, int32]
Get the Version of Unreal Engine in a map(dict). The keys: ["Major", "Minor", "Patch"]
note: added in v1.0.4
Returns:
Map[str, int32]: The versions of current engine.
get_ta_python_version¶
Get the Version of TAPython in a map(dict). The keys: ["Major", "Minor", "Patch"]
unreal.PythonBPLib.get_ta_python_version() -> Map[str, int32]
Get the Version of TAPython in a map(dict). The keys: ["Major", "Minor", "Patch"]
note: added in v1.0.9
Returns:
Map[str, int32]: The versions of current engine.
guid_from_string¶
Generate a Guid instance from Guid value string. The new Guid's value will to the input guid string.
unreal.PythonBPLib.guid_from_string(guid_str) -> Guid
Generate a Guid instance from Guid value string. The new Guid's value will to the input guid string.
note: added in v1.0.4
Args:
guid_str (str): string of guid value, the length should equal 32.
Returns:
Guid: Guid
get_modifier_keys_state¶
Get the modifier keys state in TMap. Control/Alt/Shift/Command/CapsLock etc.
unreal.PythonBPLib.get_modifier_keys_state() -> Map[str, bool]
Get the modifier keys state in TMap. Control/Alt/Shift/Command/CapsLock etc.
note: added in v1.0.10
Returns:
Map[str, bool]: Modifier keys state in TMap<FString, bool>. Keys: "AnyModifiersDown", "IsShiftDown", "IsLeftShiftDown", "IsRightShiftDown", "IsControlDown", "IsLeftControlDown", "IsRightControlDown", "IsAltDown", "IsLeftAltDown", "IsRightAltDown", "IsAltDown", "IsLeftControlDown", "IsRightControlDown", "IsCommandDown", "IsLeftCommandDown", "AreCapsLocked", "IsRightCommandDown"
get_latest_context_object¶
unreal.PythonBPLib.get_latest_context_object() -> ToolMenuContext
UFUNCTION(BlueprintCallable, meta = (Keywords = "Python Editor"), Category = "PythonEditor")
static void GetContext(FName NameIn, UClass* InClass);
Returns:
ToolMenuContext:
snapshot_details¶
Take a snapshot of the details panel and save it to a file.
unreal.PythonBPLib.snapshot_details(start_from_docking, override_window_size=[0.000000, 0.000000], image_file_path="") -> Array[str]
Take a snapshot of the details panel and save it to a file.
note: added in v1.0.10
Args:
start_from_docking (bool): Whether to start from docking or not.
override_window_size (Vector2D): Override the window size.
image_file_path (str): The path of image file to save.
Returns:
Array[str]: The path of image file saved.
get_class_path_name¶
Get the ClassPathName of the asset.
unreal.PythonBPLib.get_class_path_name(asset) -> str
Get the ClassPathName of the asset.
note: added in v1.0.11, need UE5.0+
Args:
asset (Object): The asset to get ClassPathName.
Returns:
str: The ClassPathName of the asset.
calculate_projection_matrix¶
Calculate the Projection Matrix by fov and near plane.
unreal.PythonBPLib.calculate_projection_matrix(horz_fov_degrees, near_plane=1.000000) -> Matrix
Calculate the Projection Matrix by fov and near plane.
note: added in v1.2.0
Args:
horz_fov_degrees (float): The horizontal fov in degree.
near_plane (float): The near plane.
Returns:
Matrix: The Projection Matrix.
calculate_view_matrix¶
Calculate the View Matrix by ViewLocation and ViewRotation.
unreal.PythonBPLib.calculate_view_matrix(view_location, view_rotation) -> Matrix
Calculate the View Matrix by ViewLocation and ViewRotation.
note: added in v1.2.0
Args:
view_location (Vector): The ViewLocation.
view_rotation (Rotator): The ViewRotation.
Returns:
Matrix: The View Matrix.
calculate_vp_matrix¶
Calculate the ViewProjection Matrix by ViewLocation, ViewRotation, HorzFOVDegrees and NearPlane.
unreal.PythonBPLib.calculate_vp_matrix(view_location, view_rotation, horz_fov_degrees, near_plane=1.000000) -> Matrix
Calculate the ViewProjection Matrix by ViewLocation, ViewRotation, HorzFOVDegrees and NearPlane.
note: added in v1.2.0
Args:
view_location (Vector): The ViewLocation.
view_rotation (Rotator): The ViewRotation.
horz_fov_degrees (float): The horizontal fov in degree.
near_plane (float): The near plane.
Returns:
Matrix: The ViewProjection Matrix.
calculate_inv_view_projection_matrix¶
Calculate the inverse ViewProjection Matrix by ViewLocation, ViewRotation, HorzFOVDegrees and NearPlane.
unreal.PythonBPLib.calculate_inv_view_projection_matrix(view_location, view_rotation, horz_fov_degrees, near_plane) -> Matrix
Calculate the inverse ViewProjection Matrix by ViewLocation, ViewRotation, HorzFOVDegrees and NearPlane.
note: added in v1.2.0
Args:
view_location (Vector): The ViewLocation.
view_rotation (Rotator): The ViewRotation.
horz_fov_degrees (float): The horizontal fov in degree.
near_plane (float): The near plane.
Returns:
Matrix: The inverse ViewProjection Matrix.
project_world_to_view¶
Project world position to view position.
unreal.PythonBPLib.project_world_to_view(world_position, view_projection_matrix) -> Vector or None
Project world position to view position.
note: added in v1.2.0
Args:
world_position (Vector): The world position.
view_projection_matrix (Matrix): The ViewProjection Matrix.
Returns:
Vector or None: Pos in view space or not.
out_view_pos (Vector): The view position.
frustum_trace¶
Trace rays against the world using a specific profile in a gird in Frustum and return the hits.
unreal.PythonBPLib.frustum_trace(world, view_info, x_steps, y_steps, include_border, trace_distance, profile_name, debug_draw) -> Array[TAPythonPrimitiveHitResult]
Trace rays against the world using a specific profile in a gird in Frustum and return the hits.
note: added in v1.2.0
note: need UE5.0+
Args:
world (World): The world to trace in.
view_info (MinimalViewInfo): The ViewInfo of the camera.
x_steps (int32): The count of trace point in frustum axis-x
y_steps (int32): The count of trace point in frustum axis-y
include_border (bool): Include the border of frustum or not.
trace_distance (float): Distance from trace start point to the end point
profile_name (Name): The 'profile' used to determine which components to hit
debug_draw (bool): Debug draw or not.
Returns:
Array[TAPythonPrimitiveHitResult]:
primitive_hit_results (Array[TAPythonPrimitiveHitResult]):
PythonControlRigLib¶
Function Name | Description | |
---|---|---|
get_control_shape_transform | None |
get_control_shape_transform¶
unreal.PythonControlRigLib.get_control_shape_transform(rig_hierarchy, control_element, initial=True) -> Transform
Get Control Shape Transform
Args:
rig_hierarchy (RigHierarchy):
control_element (RigElementKey):
initial (bool):
Returns:
Transform:
PythonDataTableLib¶
Function Name | Description | |
---|---|---|
get_data_table_struct_path | Get the row struct's path of the given DataTable. | |
get_data_table_struct | Get the row struct of the given DataTable. | |
get_table_as_json | Get the datatable content as JSON | |
get_row_names | Get the Row names of the given datatable. | |
get_column_names | Get the Column names of the given datatable. | |
get_shape | Get the Shape of the given datatable. The title and the row names are not included. | |
remove_row | Remove the specified row of the given datatable | |
add_row | Add a row in the given datatable | |
duplicate_row | Duplicate a row in the given datatable | |
rename_row | Rename the specified row in the given datatable | |
reset_row | Reset the specified row in the given datatable to default values. | |
move_row | Reset the specified row in the given datatable to default values. | |
get_row_name | Gets the Row name of the specified row in datatable | |
get_column_name | Gets the Column name of the specified column in datatable | |
get_flatten_data_table | Get the content of datatable as a 1D string List. | |
get_property_as_string | Get the specified cell's value as string in datatable | |
get_property_as_string_at | Get the specified cell's value as string in datatable | |
set_property_by_string | Set the specified cell's property in datatable | |
set_property_by_string_at | Set the specified cell's property in datatable |
get_data_table_struct_path¶
Get the row struct's path of the given DataTable.
unreal.PythonDataTableLib.get_data_table_struct_path(data_table) -> str
Get the row struct's path of the given DataTable.
Args:
data_table (DataTable): The DataTable for query.
Returns:
str: The package path of struct, empty string if failed.
get_data_table_struct¶
Get the row struct of the given DataTable.
unreal.PythonDataTableLib.get_data_table_struct(data_table) -> ScriptStruct
Get the row struct of the given DataTable.
Args:
data_table (DataTable): The DataTable for query.
Returns:
ScriptStruct: The row struct of the datatable.
get_table_as_json¶
Get the datatable content as JSON
unreal.PythonDataTableLib.get_table_as_json(data_table) -> str
Get the datatable content as JSON
Args:
data_table (DataTable): The DataTable you want to query.
Returns:
str: The datatable content as JSON
get_row_names¶
Get the Row names of the given datatable.
unreal.PythonDataTableLib.get_row_names(data_table) -> Array[Name]
Get the Row names of the given datatable.
Args:
data_table (DataTable): The DataTable you want to query.
Returns:
Array[Name]: The row names list.
get_column_names¶
Get the Column names of the given datatable.
unreal.PythonDataTableLib.get_column_names(data_table, friendly_name=True, include_name=False) -> Array[Name]
Get the Column names of the given datatable.
Args:
data_table (DataTable): The DataTable you want to query.
friendly_name (bool): Get the Friendly Name or Raw Name.
include_name (bool): Include the Row Name Column or not.
Returns:
Array[Name]: The Column names list.
get_shape¶
Get the Shape of the given datatable. The title and the row names are not included.
unreal.PythonDataTableLib.get_shape(data_table) -> Array[int32]
Get the Shape of the given datatable. The title and the row names are not included.
Args:
data_table (DataTable): The DataTable you want to query.
Returns:
Array[int32]: return the row number and column number of the datatable: [RowNumber, ColumnNumber]
remove_row¶
Remove the specified row of the given datatable
unreal.PythonDataTableLib.remove_row(data_table, row_name) -> bool
Remove the specified row of the given datatable
Args:
data_table (DataTable): The DataTable you want to modify.
row_name (Name): The Row Name
Returns:
bool: True if the row has been removed
add_row¶
Add a row in the given datatable
unreal.PythonDataTableLib.add_row(data_table, row_name) -> bool
Add a row in the given datatable
Args:
data_table (DataTable): The DataTable you want to modify.
row_name (Name): The Row Name of new line
Returns:
bool: True if the row has been added
duplicate_row¶
Duplicate a row in the given datatable
unreal.PythonDataTableLib.duplicate_row(data_table, source_row_name, row_name) -> bool
Duplicate a row in the given datatable
Args:
data_table (DataTable): The DataTable you want to modify.
source_row_name (Name): The Row Name of the source Row
row_name (Name): The Row Name of new line
Returns:
bool: True if the row has been duplicated
rename_row¶
Rename the specified row in the given datatable
unreal.PythonDataTableLib.rename_row(data_table, old_name, new_name) -> bool
Rename the specified row in the given datatable
Args:
data_table (DataTable): The DataTable you want to modify.
old_name (Name): The old Row Name
new_name (Name): The new Row Name
Returns:
bool: True if the row has been renamed
reset_row¶
Reset the specified row in the given datatable to default values.
unreal.PythonDataTableLib.reset_row(data_table, row_name) -> bool
Reset the specified row in the given datatable to default values.
Args:
data_table (DataTable): The DataTable you want to modify.
row_name (Name): The Row Name
Returns:
bool: True if the row has been reset
move_row¶
Reset the specified row in the given datatable to default values.
unreal.PythonDataTableLib.move_row(data_table, row_name, up, num_rows_to_move_by=1) -> bool
Reset the specified row in the given datatable to default values.
Args:
data_table (DataTable): The DataTable you want to modify.
row_name (Name): The Row Name of the 'source row'
up (bool): Move up or not
num_rows_to_move_by (int32): Number of rows to move by.
Returns:
bool: True if the row has been moved
get_row_name¶
Gets the Row name of the specified row in datatable
unreal.PythonDataTableLib.get_row_name(data_table, row_id) -> Name
Gets the Row name of the specified row in datatable
Args:
data_table (DataTable): The DataTable you want to modify.
row_id (int32): The index of the row
Returns:
Name: The Row name
get_column_name¶
Gets the Column name of the specified column in datatable
unreal.PythonDataTableLib.get_column_name(data_table, column_id, friendly_name=True) -> Name
Gets the Column name of the specified column in datatable
Args:
data_table (DataTable): The DataTable you want to modify
column_id (int32): The index of the column
friendly_name (bool): Whether get the friendly name or raw name or not
Returns:
Name: The Row name
get_flatten_data_table¶
Get the content of datatable as a 1D string List.
unreal.PythonDataTableLib.get_flatten_data_table(data_table, include_header=False) -> Array[str]
Get the content of datatable as a 1D string List.
note: The length of return value will equal RowNumber * ColumnNumber, when bIncludeHeader set to false
Args:
data_table (DataTable): The DataTable you want to modify
include_header (bool): Whether include the title and row name column.
Returns:
Array[str]: The content in 1D string List
get_property_as_string¶
Get the specified cell's value as string in datatable
unreal.PythonDataTableLib.get_property_as_string(data_table, row_name, column_name) -> str
Get the specified cell's value as string in datatable
Args:
data_table (DataTable): The DataTable you want to query.
row_name (Name): The Row name of the cell.
column_name (Name): The Column name of the cell.
Returns:
str: The property of the cell as string.
get_property_as_string_at¶
Get the specified cell's value as string in datatable
unreal.PythonDataTableLib.get_property_as_string_at(data_table, row_id, column_id) -> str
Get the specified cell's value as string in datatable
Args:
data_table (DataTable): The DataTable you want to query.
row_id (int32): The Row index of the cell. The title is not include
column_id (int32): The Column index of the cell. The title is not include
Returns:
str: The property of the cell as string.
set_property_by_string¶
Set the specified cell's property in datatable
unreal.PythonDataTableLib.set_property_by_string(data_table, row_name, column_name, value_as_string) -> bool
Set the specified cell's property in datatable
Args:
data_table (DataTable): The DataTable you want to query.
row_name (Name): The Row name of the cell.
column_name (Name): The Column name of the cell.
value_as_string (str): The new property in string format.
Returns:
bool: True if the new property has been set
set_property_by_string_at¶
Set the specified cell's property in datatable
unreal.PythonDataTableLib.set_property_by_string_at(data_table, row_index, column_index, value_as_string) -> bool
Set the specified cell's property in datatable
Args:
data_table (DataTable): The DataTable you want to query.
row_index (int32): The Row index of the cell. The title is not include
column_index (int32): The Column index of the cell. The title is not include
value_as_string (str): The new property in string format.
Returns:
bool: True if the new property has been set
PythonEnumLib¶
Function Name | Description | |
---|---|---|
get_display_name_map | Get the DiaplayNameMap of the given User Define Enum. Key: Raw Enum Num, Value:Display Name | |
set_enum_items | Set the items of the given User Define Enum. | |
get_enum_len | Get the number of the given User Define Enum's items. | |
get_display_name_by_index | Get the display name of the given User Define Enum | |
set_display_name | Get the display name of the given User Define Enum | |
get_description_by_index | Get the Description of the given User Define Enum Item | |
set_description_by_index | Set the Description of the given User Define Enum Item | |
get_name_by_index | Get the raw name of the given User Define Enum | |
move_enum_item | Moves the enumerator at the given initial index to a new target index, shifting other enumerators as needed. | |
is_bitflags_type | Check if the enumerator-as-bitflags meta data is set | |
set_bitflags_type | Set the state of the bitflags of the given User Define Enum | |
get_cpp_form | Get the CppForm value as int of the given User Define Enum |
get_display_name_map¶
Get the DiaplayNameMap of the given User Define Enum. Key: Raw Enum Num, Value:Display Name
unreal.PythonEnumLib.get_display_name_map(enum) -> Map[Name, Text]
Get the DiaplayNameMap of the given User Define Enum. Key: Raw Enum Num, Value:Display Name
note: Return value is a map, unordered.
Args:
enum (UserDefinedEnum): The User Define Enum you want to query.
Returns:
Map[Name, Text]: The DisplayNameMap in enum. (type: <class 'Map'>)
set_enum_items¶
Set the items of the given User Define Enum.
unreal.PythonEnumLib.set_enum_items(enum, display_names) -> None
Set the items of the given User Define Enum.
Args:
enum (UserDefinedEnum): The User Define Enum you want to modify.
display_names (Array[str]): The display names of the enum's items. The Raw Enum Name will generated automaticly.
get_enum_len¶
Get the number of the given User Define Enum's items.
unreal.PythonEnumLib.get_enum_len(enum) -> int32
Get the number of the given User Define Enum's items.
Args:
enum (UserDefinedEnum): The User Define Enum you want to query.
Returns:
int32: Number of User Define Enum
get_display_name_by_index¶
Get the display name of the given User Define Enum
unreal.PythonEnumLib.get_display_name_by_index(enum, index) -> str
Get the display name of the given User Define Enum
Args:
enum (UserDefinedEnum): The User Define Enum you want to query.
index (int32): The index of the enum item, 0-based.
Returns:
str: The display name of the enum item
set_display_name¶
Get the display name of the given User Define Enum
unreal.PythonEnumLib.set_display_name(enum, index, new_display_name) -> bool
Get the display name of the given User Define Enum
Args:
enum (UserDefinedEnum): The User Define Enum you want to query.
index (int32): The index of the enum item, 0-based.
new_display_name (str): The new display name
Returns:
bool: True if the new name set.
get_description_by_index¶
Get the Description of the given User Define Enum Item
unreal.PythonEnumLib.get_description_by_index(enum, index) -> str
Get the Description of the given User Define Enum Item
Args:
enum (UserDefinedEnum): The User Define Enum you want to query.
index (int32): The index of the enum item, 0-based.
Returns:
str: The description name of the enum item
set_description_by_index¶
Set the Description of the given User Define Enum Item
unreal.PythonEnumLib.set_description_by_index(enum, index, description) -> bool
Set the Description of the given User Define Enum Item
Args:
enum (UserDefinedEnum): The User Define Enum you want to query.
index (int32): The index of the enum item, 0-based.
description (str): The description of the enum item.
Returns:
bool: True if the description set.
get_name_by_index¶
Get the raw name of the given User Define Enum
unreal.PythonEnumLib.get_name_by_index(enum, index) -> str
Get the raw name of the given User Define Enum
Args:
enum (UserDefinedEnum): The User Define Enum you want to query.
index (int32): The index of the enum item, 0-based.
Returns:
str: The raw name of the enum item
move_enum_item¶
Moves the enumerator at the given initial index to a new target index, shifting other enumerators as needed.
unreal.PythonEnumLib.move_enum_item(enum, initial_index, target_index) -> None
Moves the enumerator at the given initial index to a new target index, shifting other enumerators as needed.
E.g. with enum [A, B, C, D, E], moving index 1 to index 3 results in [A, C, D, B, E].
Args:
enum (UserDefinedEnum): The User Define Enum you want to modify.
initial_index (int32): The initial index of the enum item
target_index (int32): The target index of the enum item
is_bitflags_type¶
Check if the enumerator-as-bitflags meta data is set
unreal.PythonEnumLib.is_bitflags_type(enum) -> bool
Check if the enumerator-as-bitflags meta data is set
Args:
enum (UserDefinedEnum): The User Define Enum you want to query.
Returns:
bool: Whether has Bitflags or not.
set_bitflags_type¶
Set the state of the bitflags of the given User Define Enum
unreal.PythonEnumLib.set_bitflags_type(enum, bitflags_type) -> None
Set the state of the bitflags of the given User Define Enum
Args:
enum (UserDefinedEnum): The User Define Enum you want to query.
bitflags_type (bool): Bitflags Value
get_cpp_form¶
Get the CppForm value as int of the given User Define Enum
unreal.PythonEnumLib.get_cpp_form(enum) -> int32
Get the CppForm value as int of the given User Define Enum
Args:
enum (UserDefinedEnum): The User Define Enum you want to query.
Returns:
int32: ECppForm value as int. 0: Regular, 1: Namespaced, 2EnumClass
PythonLandscapeLib¶
Function Name | Description | |
---|---|---|
create_landscape | Create A Landscape in Editor. | |
create_landscape_proxy | Create A StreamingProxy in Editor. | |
create_landscape_proxy_with_guid | Create A StreamingProxy in Editor. | |
add_adjacent_landscape_proxy | Add A Neighbor StreamingProxy in specified direction | |
get_landscape_guid | Get the guid from landscape | |
get_landscape_components | Get the Components from landscape | |
set_heightmap_data | Set height data for specified Landscape | |
get_heightmap_data | Get height data for specified Landscape | |
cal_landscape_size | Calculate the Size of Landscape (the size of heightmap data). | |
landscape_get_grass_components | Get the HISM component for drawing GrassType. | |
landscape_flush_grass_components | Flush the grass cache of landscape. | |
landscape_update_grass | Update the grass cache of landscape proxy. |
create_landscape¶
Create A Landscape in Editor.
unreal.PythonLandscapeLib.create_landscape(landscape_transform, section_size, sections_per_component, component_count_x, component_count_y) -> Landscape
Create A Landscape in Editor.
Args:
landscape_transform (Transform): The transform of landscape.
section_size (int32): The Section Size of the landscape. (63, 127, 255 and so on.)
sections_per_component (int32): The Section count of each component. (1 or 2)
component_count_x (int32): Number of components in Axis X
component_count_y (int32): Number of components in Axis Y
Returns:
Landscape: The created Landscape.
create_landscape_proxy¶
Create A StreamingProxy in Editor.
unreal.PythonLandscapeLib.create_landscape_proxy(landscape_transform, section_size, sections_per_component, component_count_x, component_count_y, shared_landscape_actor) -> LandscapeStreamingProxy
Create A StreamingProxy in Editor.
note: Haven't test in UE5 yet.
Args:
landscape_transform (Transform): The transform of landscape.
section_size (int32): The Section Size of the landscape. (63, 127, 255 and so on.)
sections_per_component (int32): The Section count of each component. (1 or 2)
component_count_x (int32): Number of components in Axis X
component_count_y (int32): Number of components in Axis Y
shared_landscape_actor (Landscape): The shared landscape witch share the GUID with the proxy
Returns:
LandscapeStreamingProxy: The created LandscapeStreamingProxy.
create_landscape_proxy_with_guid¶
Create A StreamingProxy in Editor.
unreal.PythonLandscapeLib.create_landscape_proxy_with_guid(landscape_transform, section_size, sections_per_component, component_count_x, component_count_y, guid, quads_space_offset_x=-1, quads_space_offset_y=-1) -> LandscapeStreamingProxy
Create A StreamingProxy in Editor.
note: Haven't test in UE5 yet.
Args:
landscape_transform (Transform): The transform of landscape.
section_size (int32): The Section Size of the landscape. (63, 127, 255 and so on.)
sections_per_component (int32): The Section count of each component. (1 or 2)
component_count_x (int32): Number of components in Axis X
component_count_y (int32): Number of components in Axis Y
guid (Guid): The GUID with the proxy
quads_space_offset_x (int32):
quads_space_offset_y (int32):
Returns:
LandscapeStreamingProxy: The created LandscapeStreamingProxy.
add_adjacent_landscape_proxy¶
Add A Neighbor StreamingProxy in specified direction
unreal.PythonLandscapeLib.add_adjacent_landscape_proxy(world_in, source_landscape, direction) -> LandscapeStreamingProxy
East:0 South:1 West:2 North:3
Args:
world_in (World):
source_landscape (LandscapeProxy):
direction (int32):
Returns:
LandscapeStreamingProxy:
get_landscape_guid¶
Get the guid from landscape
unreal.PythonLandscapeLib.get_landscape_guid(landscape_proxy) -> Guid
Get the guid from landscape
Args:
landscape_proxy (LandscapeProxy): The landscape instance.
Returns:
Guid: The Guid of the landscape.
get_landscape_components¶
Get the Components from landscape
unreal.PythonLandscapeLib.get_landscape_components(landscape_proxy) -> Array[LandscapeComponent]
Get the Components from landscape
Args:
landscape_proxy (LandscapeProxy): The landscape instance.
Returns:
Array[LandscapeComponent]: The Components of the landscape.
set_heightmap_data¶
Set height data for specified Landscape
unreal.PythonLandscapeLib.set_heightmap_data(landscape, height_data) -> bool
Set height data for specified Landscape
Args:
landscape (LandscapeProxy): The target landscape instance.
height_data (Array[int32]): The Height Data for landscape in flatten int list format. (0-65535)
Returns:
bool: Succeeded or not.
get_heightmap_data¶
Get height data for specified Landscape
unreal.PythonLandscapeLib.get_heightmap_data(landscape) -> Array[int32]
Get height data for specified Landscape
Args:
landscape (LandscapeProxy): The landscape instance for query.
Returns:
Array[int32]:
height_data (Array[int32]): The Height Data of the landscape in flatten int list format. (0-65535)
cal_landscape_size¶
Calculate the Size of Landscape (the size of heightmap data).
unreal.PythonLandscapeLib.cal_landscape_size(section_size, sections_per_component, component_count_x, component_count_y) -> (out_size_x=int32, out_size_y=int32)
Calculate the Size of Landscape (the size of heightmap data).
Args:
section_size (int32): The Section Size of the landscape.
sections_per_component (int32): The Section count of each component. (1 or 2)
component_count_x (int32): Number of components in Axis X.
component_count_y (int32): Number of components in Axis Y.
Returns:
tuple:
out_size_x (int32): The size of landscape in Axis X, (ComponentCountX * QuadsPerComponent + 1).
out_size_y (int32): The size of landscape in Axis Y.
landscape_get_grass_components¶
Get the HISM component for drawing GrassType.
unreal.PythonLandscapeLib.landscape_get_grass_components(landscape_proxy) -> Array[HierarchicalInstancedStaticMeshComponent]
Get the HISM component for drawing GrassType.
Args:
landscape_proxy (LandscapeProxy): The landscape owned the GrassTypes.
Returns:
Array[HierarchicalInstancedStaticMeshComponent]:
out_grasses (Array[HierarchicalInstancedStaticMeshComponent]): The HISM component for drawing GrassTypes.
landscape_flush_grass_components¶
Flush the grass cache of landscape.
unreal.PythonLandscapeLib.landscape_flush_grass_components(landscape_proxy, flush_grass_maps=True) -> None
Flush the grass cache of landscape.
Args:
landscape_proxy (LandscapeProxy):
flush_grass_maps (bool): Flush GrassMaps or not.
landscape_update_grass¶
Update the grass cache of landscape proxy.
unreal.PythonLandscapeLib.landscape_update_grass(landscape_proxy, cameras, force_sync) -> None
Update the grass cache of landscape proxy.
note: added in v1.0.9
Args:
landscape_proxy (LandscapeProxy): The landscape owned the GrassTypes.
cameras (Array[Vector]): Cameras to use for culling, if empty, then NO culling
force_sync (bool): if true, block and finish all work
PythonLevelLib¶
Function Name | Description | |
---|---|---|
remove_level_from_world | Remove specified level from current world. | |
get_levels | Get all levels in the world. |
remove_level_from_world¶
Remove specified level from current world.
unreal.PythonLevelLib.remove_level_from_world(level_short_name) -> bool
Remove specified level from current world.
Args:
level_short_name (str): The short name of level to be removed.
Returns:
bool: Succeed or not.
get_levels¶
Get all levels in the world.
unreal.PythonLevelLib.get_levels(world_in) -> Array[Level]
Get all levels in the world.
Args:
world_in (World): The world owned the Levels.
Returns:
Array[Level]: The Levels in the world.
PythonMaterialLib¶
Function Name | Description | |
---|---|---|
get_static_switch_parameter_values | Get the Static Switch Infos of material instance | |
set_static_switch_parameter_value | Set the Static Switch Infos of material instance | |
set_static_switch_parameters_values | Batch set the Static Switch's status of material instance. | |
get_mf_static_switch_parameter | Get the Static Switch Infos of material function. | |
get_static_parameters_summary | Get the numbers of each StaticSwitchParameter of material instance. | |
log_mat | Log out all the connections in the material | |
get_material_expressions | Log out all the Material Expressions in the material | |
get_all_referenced_expressions | Get Material Expressions in the material with specified feature level | |
get_material_connections | Get all the connections in the material | |
get_material_function_connections | Get all the connections in the material function | |
get_material_expression_input_names | Get the input pin's names of the material expression | |
get_material_expression_output_names | Get the output pin's names of the material expression | |
get_material_expression_captions | The captions of the material expression | |
set_shading_model | Set the shading model of the material, for the hidden shading model | |
get_material_expression_id | Get the ParameterExpressionId of the material expression. | |
log_mf | Log out all the connections in the material function | |
get_material_function_expressions | Get all the expressions in the Material Function | |
get_material_function_output_expressions | Get all the output expressions in the Material Function | |
get_selected_material_nodes | Get the selected nodes in material editor. | |
log_material_expression | Log Detail information of the MaterialExpression, include inputs, outputs etc. | |
log_editing_nodes | Log Detail information of the Material or Material Function | |
get_selected_nodes_in_material_editor | Get the selected nodes in material editor. | |
get_hlsl_code | Get the HLSL code of the Material | |
get_shader_map_info | Get the ShaderMaps infos in string format. | |
get_material_content | Get the material's content in JSON Format | |
get_material_function_content | Get the material function's content in JSON Format | |
connect_material_expressions | Create connection between two material expressions | |
disconnect_expression | Disconnection the material expression's input | |
connect_material_property | Connect a material expression output to one of the material property inputs (e.g. diffuse color, world position offset etc) | |
disconnect_material_property | Disconnect the material property input | |
get_material_proper_str_from_guid | Get EMaterialProperty in string format from a guid | |
gen_guid_from_material_property_str | Generate a Guid from EMaterialProperty | |
add_input_at_expression_set_material_attributes | Add an Attribute Get Type pin for material expression "GetMaterialAttributes" | |
add_output_at_expression_get_material_attributes | Add an Attribute Get Type pin for material expression "GetMaterialAttributes" |
get_static_switch_parameter_values¶
Get the Static Switch Infos of material instance
unreal.PythonMaterialLib.get_static_switch_parameter_values(material_interface) -> Array[StaticSwitchInfo]
Get the Static Switch Infos of material instance
Args:
material_interface (MaterialInterface): The material instance you want to query.
Returns:
Array[StaticSwitchInfo]:
out_static_parameters (Array[StaticSwitchInfo]): The result of static switch infos, (StaticSwitchInfo: name, value, override).
set_static_switch_parameter_value¶
Set the Static Switch Infos of material instance
unreal.PythonMaterialLib.set_static_switch_parameter_value(material_instance, switch_name, enabled, update_static_permutation=True) -> None
Set the Static Switch Infos of material instance
Args:
material_instance (MaterialInstanceConstant):
switch_name (str): The name of static switch.
enabled (bool): Enabled the switch or not.
update_static_permutation (bool): Update static permutation or not.
set_static_switch_parameters_values¶
Batch set the Static Switch's status of material instance.
unreal.PythonMaterialLib.set_static_switch_parameters_values(material_instance, switch_names, values, overrides) -> None
Batch set the Static Switch's status of material instance.
Args:
material_instance (MaterialInstanceConstant):
switch_names (Array[str]): The names of each static switches you want to set.
values (Array[bool]): The bool values of each static switches.
overrides (Array[bool]): The overrides bool values of each static switches.
get_mf_static_switch_parameter¶
Get the Static Switch Infos of material function.
unreal.PythonMaterialLib.get_mf_static_switch_parameter(material_function) -> Array[StaticSwitchInfo]
Get the Static Switch Infos of material function.
Args:
material_function (MaterialFunction): The material function you want to query.
Returns:
Array[StaticSwitchInfo]:
out_static_parameters (Array[StaticSwitchInfo]): The result of static switch infos, (StaticSwitchInfo: name, value, override).
get_static_parameters_summary¶
Get the numbers of each StaticSwitchParameter of material instance.
unreal.PythonMaterialLib.get_static_parameters_summary(material_instance) -> (out_parameters_count=Array[int32], out_info=Array[str])
Get the numbers of each StaticSwitchParameter of material instance.
Args:
material_instance (MaterialInstance):
Returns:
tuple:
out_parameters_count (Array[int32]): The Count of each parameters: [StaticSwitchParameters, StaticComponentMaskParameters, TerrainLayerWeightParameters, MaterialLayersParameters]
out_info (Array[str]): The name of each parameters.
log_mat¶
Log out all the connections in the material
unreal.PythonMaterialLib.log_mat(material_interface) -> None
Log out all the connections in the material
note: added in v1.0.8
Args:
material_interface (MaterialInterface): The source material
get_material_expressions¶
Log out all the Material Expressions in the material
unreal.PythonMaterialLib.get_material_expressions(material_interface) -> Array[MaterialExpression]
Log out all the Material Expressions in the material
note: added in v1.0.8
Args:
material_interface (MaterialInterface): The source material
Returns:
Array[MaterialExpression]:
out_expressions (Array[MaterialExpression]):
get_all_referenced_expressions¶
Get Material Expressions in the material with specified feature level
unreal.PythonMaterialLib.get_all_referenced_expressions(material_interface, feature_level=3) -> Array[MaterialExpression]
Get Material Expressions in the material with specified feature level
note: added in v1.0.8
Args:
material_interface (MaterialInterface): The source material
feature_level (int32): ERHIFeatureLevel value in integer. 0: ES2_REMOVED, 1: ES3_1, 2: SM4_REMOVED, 3: SM_5, 4: SM6. Default == 3(SM_5)
Returns:
Array[MaterialExpression]:
out_expressions (Array[MaterialExpression]):
get_material_connections¶
Get all the connections in the material
unreal.PythonMaterialLib.get_material_connections(material_interface) -> Array[TAPythonMaterialConnection]
Get all the connections in the material
note: added in v1.0.8
Args:
material_interface (MaterialInterface): The source material
Returns:
Array[TAPythonMaterialConnection]: The connections
get_material_function_connections¶
Get all the connections in the material function
unreal.PythonMaterialLib.get_material_function_connections(material_function) -> Array[TAPythonMaterialConnection]
Get all the connections in the material function
note: added in v1.0.8
Args:
material_function (MaterialFunction): The source material function
Returns:
Array[TAPythonMaterialConnection]: The connections
get_material_expression_input_names¶
Get the input pin's names of the material expression
unreal.PythonMaterialLib.get_material_expression_input_names(expression, raw_name=False) -> Array[str]
Get the input pin's names of the material expression
note: added in v1.0.8
Args:
expression (MaterialExpression): The source material expression
raw_name (bool): Set True will return the raw name that will not remove input type nor shorten the pin name. For instance the 'Input' will be none.
Returns:
Array[str]: The input pin's names in array
get_material_expression_output_names¶
Get the output pin's names of the material expression
unreal.PythonMaterialLib.get_material_expression_output_names(expression) -> Array[str]
Get the output pin's names of the material expression
note: added in v1.0.8
Args:
expression (MaterialExpression): The source material expression
Returns:
Array[str]: The output pin's names in array
get_material_expression_captions¶
The captions of the material expression
unreal.PythonMaterialLib.get_material_expression_captions(expression) -> Array[str]
The captions of the material expression
note: added in v1.0.8
Args:
expression (MaterialExpression): The source material expression
Returns:
Array[str]: The captions in array
set_shading_model¶
Set the shading model of the material, for the hidden shading model
unreal.PythonMaterialLib.set_shading_model(material, shading_model_value) -> None
Set the shading model of the material, for the hidden shading model
note: added in v1.0.8
Args:
material (Material): The source material
shading_model_value (int32): The int value of the EMaterialShadingModel
get_material_expression_id¶
Get the ParameterExpressionId of the material expression.
unreal.PythonMaterialLib.get_material_expression_id(expression) -> Guid
Get the ParameterExpressionId of the material expression.
note: added in v1.0.8
Args:
expression (MaterialExpression): The source expression material
Returns:
Guid: The ParameterExpressionId
log_mf¶
Log out all the connections in the material function
unreal.PythonMaterialLib.log_mf(material_function) -> None
Log out all the connections in the material function
note: added in v1.0.8
Args:
material_function (MaterialFunction): The source material expression
get_material_function_expressions¶
Get all the expressions in the Material Function
unreal.PythonMaterialLib.get_material_function_expressions(material_function, recursive=False) -> Array[MaterialExpression]
Get all the expressions in the Material Function
note: added in v1.0.8
Args:
material_function (MaterialFunction): The source material expression
recursive (bool): Recursive or not
Returns:
Array[MaterialExpression]:
out_expressions (Array[MaterialExpression]):
get_material_function_output_expressions¶
Get all the output expressions in the Material Function
unreal.PythonMaterialLib.get_material_function_output_expressions(material_function) -> Array[MaterialExpressionFunctionOutput]
Get all the output expressions in the Material Function
note: added in v1.0.8
Args:
material_function (MaterialFunction): The source material expression
Returns:
Array[MaterialExpressionFunctionOutput]:
output_expressions (Array[MaterialExpressionFunctionOutput]):
get_selected_material_nodes¶
Get the selected nodes in material editor.
unreal.PythonMaterialLib.get_selected_material_nodes(material) -> Array[MaterialExpression]
Get the selected nodes in material editor.
note: Use this function in OnMaterialEditorMenu in MenuConfig.ini, the asset path of the material will be passed automatic.
note: For example: unreal.PythonMaterialLib.get_selected_nodes_in_material_editor(unreal.load_asset(%asset_paths[0]))
note: added in v1.0.8
Args:
material (Material): The editing material
Returns:
Array[MaterialExpression]:
out_expressions (Array[MaterialExpression]):
log_material_expression¶
Log Detail information of the MaterialExpression, include inputs, outputs etc.
unreal.PythonMaterialLib.log_material_expression(material_expression) -> None
Log Detail information of the MaterialExpression, include inputs, outputs etc.
note: added in v1.0.8
Args:
material_expression (MaterialExpression): The material expression you want to query.
log_editing_nodes¶
Log Detail information of the Material or Material Function
unreal.PythonMaterialLib.log_editing_nodes(material_or_mf) -> None
Log Detail information of the Material or Material Function
note: added in v1.0.8
Args:
material_or_mf (Object): The material or material function you want to query.
get_selected_nodes_in_material_editor¶
Get the selected nodes in material editor.
unreal.PythonMaterialLib.get_selected_nodes_in_material_editor(material_or_mf) -> Array[MaterialExpression]
Get the selected nodes in material editor.
note: The Material Root Node is not included.
note: added in v1.0.8
Args:
material_or_mf (Object): The material or the material function you want to query.
Returns:
Array[MaterialExpression]: The selected MaterialExpression nodes.
get_hlsl_code¶
Get the HLSL code of the Material
unreal.PythonMaterialLib.get_hlsl_code(material_interface) -> str or None
Get the HLSL code of the Material
note: The FeatureLevel if SM5
note: added in v1.0.8
Args:
material_interface (MaterialInterface): The material you want to query.
Returns:
str or None: None or the HLSL source code
out_source (str):
get_shader_map_info¶
Get the ShaderMaps infos in string format.
unreal.PythonMaterialLib.get_shader_map_info(material, platform_str, detail=False) -> str
Get the ShaderMaps infos in string format.
note: added in v1.0.8
Args:
material (Material): The material you want to query.
platform_str (str): EShaderPlatform String: PCD3D_SM5, METAL, METAL_MRT, PCD3D_ES3_1, OPENGL_PCES3_1, METAL_SM5, VULKAN_PCES3_1, VULKAN_SM5, VULKAN_ES3_1_ANDROID, METAL_MACES3_1, OPENGL_ES3_1_ANDROID, METAL_MRT_MAC, METAL_TVOS, METAL_MRT_TVOS
detail (bool): Log Detail ShaderMap or not
Returns:
str: The ShaderMap info content as JSON
get_material_content¶
Get the material's content in JSON Format
unreal.PythonMaterialLib.get_material_content(material, only_editable=True, include_comments=False) -> str
Get the material's content in JSON Format
note: added in v1.0.8
Args:
material (Material): The material you want to query.
only_editable (bool): Get the Editable properties only or not.
include_comments (bool): Include the Comments in Material Editor's graph or not.
Returns:
str: The material's content in JSON Format
get_material_function_content¶
Get the material function's content in JSON Format
unreal.PythonMaterialLib.get_material_function_content(material_function, only_editable=True, include_comments=False) -> str
Get the material function's content in JSON Format
note: added in v1.0.8
Args:
material_function (MaterialFunction): The material function you want to query.
only_editable (bool): Get the Editable properties only or not.
include_comments (bool): Include the Comments in Material Editor's graph or not.
Returns:
str: The material's content in JSON Format
connect_material_expressions¶
Create connection between two material expressions
unreal.PythonMaterialLib.connect_material_expressions(from_expression, from_output_name, to_expression, to_input_name) -> bool
Create connection between two material expressions
note: Same as the function in UMaterialEditingLibrary, add extra log when failed.
note: added in v1.0.8
Args:
from_expression (MaterialExpression): Expression to make connection from
from_output_name (str): Name of output of FromExpression to make connection from. Leave empty to use first output.
to_expression (MaterialExpression): Expression to make connection to
to_input_name (str): Name of input of ToExpression to make connection to. Leave empty to use first input.
Returns:
bool: True if connected
disconnect_expression¶
Disconnection the material expression's input
unreal.PythonMaterialLib.disconnect_expression(expression, input_name) -> bool
Disconnection the material expression's input
note: added in v1.0.8
Args:
expression (MaterialExpression): Expression
input_name (str):
Returns:
bool: True if disconnected
connect_material_property¶
Connect a material expression output to one of the material property inputs (e.g. diffuse color, world position offset etc)
unreal.PythonMaterialLib.connect_material_property(from_expression, from_output_name, material_property_str) -> bool
Connect a material expression output to one of the material property inputs (e.g. diffuse color, world position offset etc)
note: added in v1.0.8
Args:
from_expression (MaterialExpression): Expression to make connection from
from_output_name (str): Name of output of FromExpression to make connection from
material_property_str (str): EMaterialProperty value in string from. So we can connect to the "Hidden" Property, for instance: MP_WorldPositionOffset, MP_CustomData0, MP_CustomizedUVs0 and so on
Returns:
bool: True if connected
disconnect_material_property¶
Disconnect the material property input
unreal.PythonMaterialLib.disconnect_material_property(material, material_property_str) -> bool
Disconnect the material property input
note: added in v1.0.8
Args:
material (Material): The target material
material_property_str (str): EMaterialProperty value in string from. So we can connect to the "Hidden" Property, for instance: MP_WorldPositionOffset, MP_CustomData0, MP_CustomizedUVs0 and so on
Returns:
bool: True if connected
get_material_proper_str_from_guid¶
Get EMaterialProperty in string format from a guid
unreal.PythonMaterialLib.get_material_proper_str_from_guid(guid) -> str
Get EMaterialProperty in string format from a guid
note: It's a python version of FMaterialAttributeDefinitionMap::GetProperty(guid)
note: added in v1.0.8
Args:
guid (Guid): The Guid which used in AttributeGetTypes/AttributeSetTypes
Returns:
str: EMaterialProperty value in string
gen_guid_from_material_property_str¶
Generate a Guid from EMaterialProperty
unreal.PythonMaterialLib.gen_guid_from_material_property_str(property_str) -> Guid
Generate a Guid from EMaterialProperty
note: It's a python version of FMaterialAttributeDefinitionMap::GetID(Property)
note: added in v1.0.8
Args:
property_str (str): EMaterialProperty String: MP_BaseColor, MP_Metallic, MP_Specular, MP_Normal, MP_WorldPositionOffset, MP_CustomData0, MP_CustomizedUVs0 and so on
Returns:
Guid: The new Guid
add_input_at_expression_set_material_attributes¶
Add an Attribute Get Type pin for material expression "GetMaterialAttributes"
unreal.PythonMaterialLib.add_input_at_expression_set_material_attributes(expression_set_material_attributes, property_str) -> None
Add an Attribute Get Type pin for material expression "GetMaterialAttributes"
note: added in v1.0.8
Args:
expression_set_material_attributes (MaterialExpressionSetMaterialAttributes): The target expression.
property_str (str): EMaterialProperty String: MP_BaseColor, MP_Metallic, MP_Specular, MP_Normal, MP_WorldPositionOffset, MP_CustomData0, MP_CustomizedUVs0 and so on
add_output_at_expression_get_material_attributes¶
Add an Attribute Get Type pin for material expression "GetMaterialAttributes"
unreal.PythonMaterialLib.add_output_at_expression_get_material_attributes(expression_get_material_attributes, property_str) -> None
Add an Attribute Get Type pin for material expression "GetMaterialAttributes"
note: added in v1.0.8
Args:
expression_get_material_attributes (MaterialExpressionGetMaterialAttributes): The target expression.
property_str (str): EMaterialProperty String: MP_BaseColor, MP_Metallic, MP_Specular, MP_Normal, MP_WorldPositionOffset, MP_CustomData0, MP_CustomizedUVs0 and so on
PythonMeshLib¶
Function Name | Description | |
---|---|---|
get_static_mesh_materials | Get all Static Materials of static mesh. | |
set_static_mesh_materials | Get all Static Materials of static mesh. | |
get_imported_original_mat_names | Get the names from Mesh's ImportMaterialOriginalNameData of StaticMesh's ImportData | |
get_original_lod_data_count | Get number of LODs from ImportMeshData. It's may not equal to the number of actual mesh asset, which can generate lods in editor. | |
get_original_lod_mat_names | Get the Section Original Material Names from specified LOD of mesh. | |
is_this_lod_generated_by_mesh_reduction | Is Specified LOD is generated in editor. | |
set_lod_section_material_slot_index | Set Material Slot Index of Specified mesh LOD. | |
get_section_cast_shadow | Is specified section of LOD cast shadow. | |
get_overlapping_box_count | Get the number of instances that overlap a given box | |
get_overlapping_sphere_count | Get the number of instances that overlap a given sphere | |
get_static_mesh_sockets | Get the static mesh sockets of the mesh object | |
set_static_mesh_sockets | Set the static mesh sockets of the mesh object | |
set_static_mesh_socket_name | Set the name of static mesh socket. | |
convert_procedural_mesh_to_static_mesh | UStaticMesh* StaticMeshvert the procedural mesh to static mesh asset | |
apply_nanite | Set and Apply the Enable Nanite of static mesh asset. UE5 Only. | |
set_uvs_from_camera_projection | Project the DynamicMesh to specified UVSet in current view. | |
get_visible_triangles | Get the visible triangles of DynamicMesh in current view. | |
rasterize_and_trace_triangles_uv | Trace the visibility of DynamicMesh in current view.(Experimental) | |
trace_dynamic_mesh_triangles_visibility | Trace the visibility of DynamicMesh's triangles in current view. | |
get_triangles_face_normal_in_view | Get the face normal of DynamicMesh in current view. (Experimental) | |
cal_triangles_derivatives | Calculate the merged ddxy of DynamicMesh's triangles in current view. (Experimental) | |
export_normal_and_derivatives | Export the current normal and mip of DynamicMesh in current view as raw data. (Experimental) |
get_static_mesh_materials¶
Get all Static Materials of static mesh.
unreal.PythonMeshLib.get_static_mesh_materials(mesh) -> Array[StaticMaterial]
Get all Static Materials of static mesh.
Args:
mesh (StaticMesh): The Static Mesh owned the Materials.
Returns:
Array[StaticMaterial]:
out_materials (Array[StaticMaterial]): The Static Materials of the mesh in list.
set_static_mesh_materials¶
Get all Static Materials of static mesh.
unreal.PythonMeshLib.set_static_mesh_materials(mesh, materials, slot_names) -> None
Get all Static Materials of static mesh.
Args:
mesh (StaticMesh): The target static mesh.
materials (Array[StaticMaterial]): The material list you want to set to the mesh.
slot_names (Array[Name]): The new material slot names of the mesh.
get_imported_original_mat_names¶
Get the names from Mesh's ImportMaterialOriginalNameData of StaticMesh's ImportData
unreal.PythonMeshLib.get_imported_original_mat_names(mesh) -> Array[str] or None
Get the names from Mesh's ImportMaterialOriginalNameData of StaticMesh's ImportData
Args:
mesh (StaticMesh): The target static mesh.
Returns:
Array[str] or None:
out_material_names (Array[str]): The names in material original name data.
get_original_lod_data_count¶
Get number of LODs from ImportMeshData. It's may not equal to the number of actual mesh asset, which can generate lods in editor.
unreal.PythonMeshLib.get_original_lod_data_count(mesh) -> int32
Get number of LODs from ImportMeshData. It's may not equal to the number of actual mesh asset, which can generate lods in editor.
Args:
mesh (StaticMesh): The target static mesh.
Returns:
int32: The number of LOD.
get_original_lod_mat_names¶
Get the Section Original Material Names from specified LOD of mesh.
unreal.PythonMeshLib.get_original_lod_mat_names(mesh, lod_level) -> Array[str] or None
Get the Section Original Material Names from specified LOD of mesh.
Args:
mesh (StaticMesh): The target static mesh.
lod_level (int32): Specified LOD level.
Returns:
Array[str] or None:
out_material_names (Array[str]): The Material's names.
is_this_lod_generated_by_mesh_reduction¶
Is Specified LOD is generated in editor.
unreal.PythonMeshLib.is_this_lod_generated_by_mesh_reduction(mesh, lod_level) -> bool
Is Specified LOD is generated in editor.
result: Whether this LOD's mesh is generated in editor or not.
Args:
mesh (StaticMesh): The target static mesh.
lod_level (int32): Specified LOD level.
Returns:
bool:
set_lod_section_material_slot_index¶
Set Material Slot Index of Specified mesh LOD.
unreal.PythonMeshLib.set_lod_section_material_slot_index(static_mesh, lod_index, section_index, new_material_slot_index, new_material_slot_name) -> None
Set Material Slot Index of Specified mesh LOD.
Args:
static_mesh (StaticMesh):
lod_index (int32):
section_index (int32): The section index of LOD.
new_material_slot_index (int32): The new material slot index for the section.
new_material_slot_name (Name): The name for material slot.
get_section_cast_shadow¶
Is specified section of LOD cast shadow.
unreal.PythonMeshLib.get_section_cast_shadow(static_mesh, lod_level, section_id) -> bool
Is specified section of LOD cast shadow.
result: Whether this section of mesh cast shadow.
Args:
static_mesh (StaticMesh):
lod_level (int32): Specified LOD level.
section_id (int32): Specified section id of LOD.
Returns:
bool:
get_overlapping_box_count¶
Get the number of instances that overlap a given box
unreal.PythonMeshLib.get_overlapping_box_count(hism, box) -> int32
Get the number of instances that overlap a given box
result: The overlapped number of instances.
Args:
hism (HierarchicalInstancedStaticMeshComponent): The target HierarchicalInstancedStaticMeshComponent.
box (Box): Box for overlapping test.
Returns:
int32:
get_overlapping_sphere_count¶
Get the number of instances that overlap a given sphere
unreal.PythonMeshLib.get_overlapping_sphere_count(hism, sphere_center, sphere_radius) -> int32
Get the number of instances that overlap a given sphere
result: The overlapped number of instances.
Args:
hism (HierarchicalInstancedStaticMeshComponent): The target HierarchicalInstancedStaticMeshComponent.
sphere_center (Vector): The center position of Sphere for overlapping test.
sphere_radius (float): The radius of Sphere.
Returns:
int32:
get_static_mesh_sockets¶
Get the static mesh sockets of the mesh object
unreal.PythonMeshLib.get_static_mesh_sockets(obj) -> Array[StaticMeshSocket]
Get the static mesh sockets of the mesh object
result: The static mesh sockets of the mesh.
Args:
obj (Object): The target mesh.
Returns:
Array[StaticMeshSocket]:
set_static_mesh_sockets¶
Set the static mesh sockets of the mesh object
unreal.PythonMeshLib.set_static_mesh_sockets(obj, sockets) -> bool
Set the static mesh sockets of the mesh object
result: Succeed or not.
Args:
obj (Object): The target mesh.
sockets (Array[StaticMeshSocket]): The sockets for mesh.
Returns:
bool:
set_static_mesh_socket_name¶
Set the name of static mesh socket.
unreal.PythonMeshLib.set_static_mesh_socket_name(socket, socket_name) -> StaticMeshSocket
Set the name of static mesh socket.
deprecated: SetStaticMeshSocketName is deprecated, use set_editor_property('socket_name', new_socket_name) instead
result: The mesh socket.
Args:
socket (StaticMeshSocket): The target Socket.
socket_name (Name): The new name of socket.
Returns:
StaticMeshSocket:
convert_procedural_mesh_to_static_mesh¶
UStaticMesh* StaticMeshvert the procedural mesh to static mesh asset
unreal.PythonMeshLib.convert_procedural_mesh_to_static_mesh(proc_mesh_comp, package_path, recompute_normals=False, recompute_tangents=False, remove_degenerates=False, use_high_precision_tangent_basis=False, use_full_precision_u_vs=False, generate_lightmap_u_vs=True) -> StaticMesh
UStaticMesh* StaticMeshvert the procedural mesh to static mesh asset
Args:
proc_mesh_comp (ProceduralMeshComponent): The ProcMeshComp mesh Component
package_path (str): The StaticMesh Asset package path
recompute_normals (bool): Recompute mesh normal or not, default = false
recompute_tangents (bool): Recompute mesh tangents or not, default = false
remove_degenerates (bool): Remove Degenerates triangles or not, default = false
use_high_precision_tangent_basis (bool): Use high precision tangent basis or not, default = false
use_full_precision_u_vs (bool): Stored UVs with full floating point precision or not, default = false
generate_lightmap_u_vs (bool): Generate Lightmap UVs or not, default = true
Returns:
StaticMesh: return the converted static mesh
apply_nanite¶
Set and Apply the Enable Nanite of static mesh asset. UE5 Only.
unreal.PythonMeshLib.apply_nanite(static_mesh, enable_nanite) -> None
Set and Apply the Enable Nanite of static mesh asset. UE5 Only.
note: This function will trigger Nanite mesh rebuild, which will cost several seconds or more.
Args:
static_mesh (StaticMesh): The target static mesh asset.
enable_nanite (bool): Enable Nanite or not.
set_uvs_from_camera_projection¶
Project the DynamicMesh to specified UVSet in current view.
unreal.PythonMeshLib.set_uvs_from_camera_projection(target_mesh, uv_set_index, selection, m, view_info) -> DynamicMesh
Project the DynamicMesh to specified UVSet in current view.
note: need UE 5.1+
Args:
target_mesh (DynamicMesh): The target DynamicMesh.
uv_set_index (int32): The UVSet index of mesh.
selection (GeometryScriptMeshSelection): The selection of mesh.
m (Matrix): The transform matrix of DynamicMesh.
view_info (MinimalViewInfo): The current view info.
Returns:
DynamicMesh: The projected DynamicMesh.
get_visible_triangles¶
Get the visible triangles of DynamicMesh in current view.
unreal.PythonMeshLib.get_visible_triangles(target_mesh, mesh_transform, view_info, invert) -> (DynamicMesh, selection_out=GeometryScriptMeshSelection)
Get the visible triangles of DynamicMesh in current view.
note: need UE 5.1+
Args:
target_mesh (DynamicMesh): The target DynamicMesh.
mesh_transform (Transform): The transform of DynamicMesh.
view_info (MinimalViewInfo): The current view info.
invert (bool): Invert the selection or not.
Returns:
GeometryScriptMeshSelection: The visible triangles of DynamicMesh(FGeometryScriptMeshSelection).
selection_out (GeometryScriptMeshSelection):
rasterize_and_trace_triangles_uv¶
Trace the visibility of DynamicMesh in current view.(Experimental)
unreal.PythonMeshLib.rasterize_and_trace_triangles_uv(world, target_mesh, triangle_ids, uv_channel, texture_width, texture_height, transform, start_point, profile_name, debug_draw) -> (blocked_points=Array[IntPoint], not_blocked_points=Array[IntPoint], each_triangles_pixel_counts=Array[int32], each_triangles_blocked_pixel_counts=Array[int32])
Trace the visibility of DynamicMesh in current view.(Experimental)
note: added in v1.2.0 (Experimental)
note: need UE5.2+
Args:
world (World): The world of DynamicMesh.
target_mesh (DynamicMesh): The target DynamicMesh.
triangle_ids (Array[int32]): The triangle ids of DynamicMesh for trace.
uv_channel (int32): The uv channel of DynamicMesh.
texture_width (int32): The width of texture.
texture_height (int32): The height of texture.
transform (Transform): The transform of DynamicMesh.
start_point (Vector): The start point of trace.
profile_name (Name): The trace profile name.
debug_draw (bool): Debug draw or not.
Returns:
tuple:
blocked_points (Array[IntPoint]):
not_blocked_points (Array[IntPoint]):
each_triangles_pixel_counts (Array[int32]):
each_triangles_blocked_pixel_counts (Array[int32]):
trace_dynamic_mesh_triangles_visibility¶
Trace the visibility of DynamicMesh's triangles in current view.
unreal.PythonMeshLib.trace_dynamic_mesh_triangles_visibility(target_mesh_component, triangle_ids, view_info, debug_draw, profile_name) -> TAPythonPrimitiveHitResult or None
Trace the visibility of DynamicMesh's triangles in current view.
note: added in v1.2.0
note: need UE5.2+
Args:
target_mesh_component (DynamicMeshComponent): The target DynamicMeshComponent.
triangle_ids (Array[int32]): The triangle ids of DynamicMesh.
view_info (MinimalViewInfo): The current view info.
debug_draw (bool): Debug draw or not.
profile_name (Name): The trace profile name.
Returns:
TAPythonPrimitiveHitResult or None: TAPythonPrimitiveHitResult or None:
result (TAPythonPrimitiveHitResult):
get_triangles_face_normal_in_view¶
Get the face normal of DynamicMesh in current view. (Experimental)
unreal.PythonMeshLib.get_triangles_face_normal_in_view(target_mesh_component, triangle_ids, view_info) -> Array[Vector]
Get the face normal of DynamicMesh in current view. (Experimental)
note: added in v1.2.0 (Experimental)
note: need UE5.2+
Args:
target_mesh_component (DynamicMeshComponent): The target DynamicMeshComponent.
triangle_ids (Array[int32]): The triangle ids of DynamicMesh.
view_info (MinimalViewInfo): The current view info.
Returns:
Array[Vector]: The face normals of each triangle of DynamicMesh.
cal_triangles_derivatives¶
Calculate the merged ddxy of DynamicMesh's triangles in current view. (Experimental)
unreal.PythonMeshLib.cal_triangles_derivatives(mesh_component, triangle_ids, uv_channel, view_info, view_size) -> Array[Vector2D]
Calculate the merged ddxy of DynamicMesh's triangles in current view. (Experimental)
note: added in v1.2.0 (Experimental)
note: need UE5.2+
Args:
mesh_component (DynamicMeshComponent): The target DynamicMeshComponent.
triangle_ids (Array[int32]): The triangle ids of DynamicMesh.
uv_channel (int32): The uv channel of DynamicMesh.
view_info (MinimalViewInfo): The current view info.
view_size (Vector2D): The size of current view
Returns:
Array[Vector2D]: The merged ddxy of DynamicMesh's triangles, which not the same as ddx,ddy in shader.
export_normal_and_derivatives¶
Export the current normal and mip of DynamicMesh in current view as raw data. (Experimental)
unreal.PythonMeshLib.export_normal_and_derivatives(mesh_component, triangle_ids, uv_channel, view_info, view_size, export_tex_size) -> Array[uint8]
Export the current normal and mip of DynamicMesh in current view as raw data. (Experimental)
note: added in v1.2.0 (Experimental)
note: need UE5.2+
Args:
mesh_component (DynamicMeshComponent): The target DynamicMeshComponent.
triangle_ids (Array[int32]): The triangle ids of DynamicMesh.
uv_channel (int32): The uv channel of DynamicMesh.
view_info (MinimalViewInfo): The current view info.
view_size (Vector2D): The size of current view
export_tex_size (int32): The width and height of exported square texture.
Returns:
Array[uint8]: The raw data of exported texture.
PythonPhysicsAssetLib¶
Function Name | Description | |
---|---|---|
get_selected_bodies_indexes | Get the indexes of the selected bodies in Physics Asset Editor | |
rotate_selected_body | Set the rotation of the selected body in Physics Asset Editor | |
rotate_selected_constraint | Set the rotation of the selected constraint in Physics Asset Editor | |
get_selected | None | |
get_body_center | Get the center value of the specified body | |
set_body_center | Set the center value of the specified body | |
get_body_rotation | Get the rotation value of the first body | |
get_bodies_rotations | Get the rotation value of the first body | |
set_body_rotation | Set the rotation value of the specified body | |
get_body_radius | Get the Radius value of the body | |
set_body_radius | Set the Radius value of the body | |
get_body_length | Get the rotation value of the first body | |
set_body_length | Get the rotation value of the first body | |
get_body_size | Get the Size value of the box body | |
set_body_size | Set the Size value of the box body | |
scale_body | Scale the specified body | |
get_edited_physics_assets | Get all PhysicsAsset currently being tracked with open editors | |
get_physics_asset_from_top_window | Get the PhysicsAsset from the top opened editor window. | |
log_selected | None | |
get_selected_item_names | Get all the selected items name in PhysicsAsset editor window. | |
select_body_by_name | Select the Body by name in PhysicsAsset editor window. | |
select_body_by_names | Select the Bodies by name in PhysicsAsset editor window. | |
select_shape_by_name | Select the Shape by name in PhysicsAsset editor window. | |
select_shape_by_names | Select the Shapes by name in PhysicsAsset editor window. | |
select_constraint_by_name | Select the constraint by name in PhysicsAsset editor window. | |
select_constraint_by_names | Select the constraints by name in PhysicsAsset editor window. | |
add_constraints | Add constraint to specified bodies | |
get_skeleton_hierarchy | Get the bones hierarchy | |
get_bodies_hierarchy | Get all the bodies names and their parent bone's index | |
get_constraints_names | Get all the constraint's display names of PhysicsAsset | |
get_bone_indexes_of_constraint | Get the parent and child bone's indexes of the specified Constraint | |
get_bone_index_from_body | Get the first Body under the specified bone | |
get_bodies_from_bone | Get the Bodies under the specified bone | |
get_constraint_instance_accessor | Get the ConstraintInstanceAccessor from PhysicsAsset | |
reset_constraint_properties | Reset the specified Constraint's values | |
update_profile_instance | Update the Profile according to the specified Constraint | |
break_constraint_accessor | Get the Owner and Constraint Index from ConstraintInstanceAccessor | |
get_constraint_name | Get the Constraint's name by Constraint Index |
get_selected_bodies_indexes¶
Get the indexes of the selected bodies in Physics Asset Editor
unreal.PythonPhysicsAssetLib.get_selected_bodies_indexes(physics_asset) -> Array[int32]
Get the indexes of the selected bodies in Physics Asset Editor
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
Returns:
Array[int32]: Indexes values in list
rotate_selected_body¶
Set the rotation of the selected body in Physics Asset Editor
unreal.PythonPhysicsAssetLib.rotate_selected_body(physics_asset, rotation) -> bool
Set the rotation of the selected body in Physics Asset Editor
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset):
rotation (Rotator): The rotation value
Returns:
bool: True if succeed
rotate_selected_constraint¶
Set the rotation of the selected constraint in Physics Asset Editor
unreal.PythonPhysicsAssetLib.rotate_selected_constraint(physics_asset, rotation) -> bool
Set the rotation of the selected constraint in Physics Asset Editor
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset):
rotation (Rotator): The rotation value
Returns:
bool: True if succeed
get_selected¶
unreal.PythonPhysicsAssetLib.get_selected(physics_asset) -> bool
Get Selected
Args:
physics_asset (PhysicsAsset):
Returns:
bool:
get_body_center¶
Get the center value of the specified body
unreal.PythonPhysicsAssetLib.get_body_center(physics_asset, body_index) -> Vector or None
Get the center value of the specified body
prarm: BodyIndex The index of body
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
body_index (int32):
Returns:
Vector or None: None or Center value
result (Vector):
set_body_center¶
Set the center value of the specified body
unreal.PythonPhysicsAssetLib.set_body_center(physics_asset, body_index, center) -> bool
Set the center value of the specified body
prarm: BodyIndex The index of body
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
body_index (int32):
center (Vector): The new Center value
Returns:
bool: True if succeed
get_body_rotation¶
Get the rotation value of the first body
unreal.PythonPhysicsAssetLib.get_body_rotation(physics_asset, body_index) -> Rotator or None
Get the rotation value of the first body
prarm: BodyIndex The index of body
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
body_index (int32):
Returns:
Rotator or None: None or Rotation value
result (Rotator):
get_bodies_rotations¶
Get the rotation value of the first body
unreal.PythonPhysicsAssetLib.get_bodies_rotations(physics_asset, body_index) -> Array[Rotator] or None
Get the rotation value of the first body
prarm: BodyIndex The index of body
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
body_index (int32):
Returns:
Array[Rotator] or None: None or Rotation values
result (Array[Rotator]):
set_body_rotation¶
Set the rotation value of the specified body
unreal.PythonPhysicsAssetLib.set_body_rotation(physics_asset, body_index, rotation) -> bool
Set the rotation value of the specified body
prarm: BodyIndex The index of body
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
body_index (int32):
rotation (Rotator): The new Rotation value
Returns:
bool: True if succeed
get_body_radius¶
Get the Radius value of the body
unreal.PythonPhysicsAssetLib.get_body_radius(physics_asset, body_index) -> float or None
Get the Radius value of the body
prarm: BodyIndex The index of body
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
body_index (int32):
Returns:
float or None: None or Radius values
radius (float):
set_body_radius¶
Set the Radius value of the body
unreal.PythonPhysicsAssetLib.set_body_radius(physics_asset, body_index, radius) -> bool
Set the Radius value of the body
prarm: BodyIndex The index of body
prarm: Radius The new radius
note: Support Sphere and Capsule body.
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
body_index (int32):
radius (float):
Returns:
bool: True if succeed
get_body_length¶
Get the rotation value of the first body
unreal.PythonPhysicsAssetLib.get_body_length(physics_asset, body_index) -> float or None
Get the rotation value of the first body
prarm: BodyIndex The index of body
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
body_index (int32):
Returns:
float or None: None or Length of the capsule body
length (float):
set_body_length¶
Get the rotation value of the first body
unreal.PythonPhysicsAssetLib.set_body_length(physics_asset, body_index, length) -> bool
Get the rotation value of the first body
prarm: BodyIndex The index of body
prarm: Length The new Length value for the capsule body
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
body_index (int32):
length (float):
Returns:
bool: True if succeed
get_body_size¶
Get the Size value of the box body
unreal.PythonPhysicsAssetLib.get_body_size(physics_asset, body_index) -> Vector or None
Get the Size value of the box body
prarm: BodyIndex The index of body
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
body_index (int32):
Returns:
Vector or None: None or Size value of the Box Body
size (Vector):
set_body_size¶
Set the Size value of the box body
unreal.PythonPhysicsAssetLib.set_body_size(physics_asset, body_index, size) -> bool
Set the Size value of the box body
prarm: BodyIndex The index of body
prarm: Size The new size value for the box body
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
body_index (int32):
size (Vector):
Returns:
bool: True if succeed
scale_body¶
Scale the specified body
unreal.PythonPhysicsAssetLib.scale_body(physics_asset, body_index, scale) -> bool
Scale the specified body
prarm: BodyIndex The index of body
prarm: Scale The scale value for body
Suppport: Sphere, Capsule and Box bodies
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
body_index (int32):
scale (float):
Returns:
bool: True if succeed
get_edited_physics_assets¶
Get all PhysicsAsset currently being tracked with open editors
unreal.PythonPhysicsAssetLib.get_edited_physics_assets() -> Array[PhysicsAsset]
Get all PhysicsAsset currently being tracked with open editors
note: added in v1.0.10
Returns:
Array[PhysicsAsset]: The opened PhysicsAssets.
get_physics_asset_from_top_window¶
Get the PhysicsAsset from the top opened editor window.
unreal.PythonPhysicsAssetLib.get_physics_asset_from_top_window() -> PhysicsAsset
Get the PhysicsAsset from the top opened editor window.
note: Will return null if the PhysicsAsset Editor window is docked.
note: added in v1.0.10
Returns:
PhysicsAsset: The opened PhysicsAsset.
log_selected¶
unreal.PythonPhysicsAssetLib.log_selected(physics_asset) -> None
Log Selected
Args:
physics_asset (PhysicsAsset):
get_selected_item_names¶
Get all the selected items name in PhysicsAsset editor window.
unreal.PythonPhysicsAssetLib.get_selected_item_names(physics_asset) -> Array[Name]
Get all the selected items name in PhysicsAsset editor window.
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The name of body.
Returns:
Array[Name]: True if succeed
select_body_by_name¶
Select the Body by name in PhysicsAsset editor window.
unreal.PythonPhysicsAssetLib.select_body_by_name(physics_asset, name_in) -> bool
Select the Body by name in PhysicsAsset editor window.
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
name_in (Name):
Returns:
bool: True if succeed
select_body_by_names¶
Select the Bodies by name in PhysicsAsset editor window.
unreal.PythonPhysicsAssetLib.select_body_by_names(physics_asset, names) -> bool
Select the Bodies by name in PhysicsAsset editor window.
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
names (Array[Name]): The bodies names.
Returns:
bool: True if any succeed
select_shape_by_name¶
Select the Shape by name in PhysicsAsset editor window.
unreal.PythonPhysicsAssetLib.select_shape_by_name(physics_asset, name_in) -> bool
Select the Shape by name in PhysicsAsset editor window.
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
name_in (Name): The name of shape.
Returns:
bool: True if succeed
select_shape_by_names¶
Select the Shapes by name in PhysicsAsset editor window.
unreal.PythonPhysicsAssetLib.select_shape_by_names(physics_asset, names) -> bool
Select the Shapes by name in PhysicsAsset editor window.
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
names (Array[Name]): The shapes names.
Returns:
bool: True if any succeed
select_constraint_by_name¶
Select the constraint by name in PhysicsAsset editor window.
unreal.PythonPhysicsAssetLib.select_constraint_by_name(physics_asset, name_in) -> bool
Select the constraint by name in PhysicsAsset editor window.
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
name_in (Name): The name of constraint.
Returns:
bool: True if succeed
select_constraint_by_names¶
Select the constraints by name in PhysicsAsset editor window.
unreal.PythonPhysicsAssetLib.select_constraint_by_names(physics_asset, names) -> bool
Select the constraints by name in PhysicsAsset editor window.
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
names (Array[Name]): The constraints names.
Returns:
bool: True if any succeed.
add_constraints¶
Add constraint to specified bodies
unreal.PythonPhysicsAssetLib.add_constraints(physics_asset, parent_body_index, child_bodies_indexes) -> Array[Name]
Add constraint to specified bodies
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
parent_body_index (int32): The parent body index of the new constraint
child_bodies_indexes (Array[int32]): The child bodies indexes of the new constraint, one constraint for one body
Returns:
Array[Name]: Added constraint names
get_skeleton_hierarchy¶
Get the bones hierarchy
unreal.PythonPhysicsAssetLib.get_skeleton_hierarchy(physics_asset) -> (bone_names=Array[Name], parents_indexes=Array[int32])
Get the bones hierarchy
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
Returns:
tuple:
bone_names (Array[Name]):
parents_indexes (Array[int32]):
get_bodies_hierarchy¶
Get all the bodies names and their parent bone's index
unreal.PythonPhysicsAssetLib.get_bodies_hierarchy(physics_asset) -> (bodies_names=Array[Name], parent_bones_indexes=Array[int32])
Get all the bodies names and their parent bone's index
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
Returns:
tuple:
bodies_names (Array[Name]):
parent_bones_indexes (Array[int32]):
get_constraints_names¶
Get all the constraint's display names of PhysicsAsset
unreal.PythonPhysicsAssetLib.get_constraints_names(physics_asset) -> Array[Name]
Get all the constraint's display names of PhysicsAsset
note: Display name format: "[ {parent_bone_name} -> {child_bone_name} ] Constraint"
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
Returns:
Array[Name]:
constraints_names (Array[Name]):
get_bone_indexes_of_constraint¶
Get the parent and child bone's indexes of the specified Constraint
unreal.PythonPhysicsAssetLib.get_bone_indexes_of_constraint(physics_asset, constraint_index) -> (parent_bone_index=int32, child_bone_index=int32)
Get the parent and child bone's indexes of the specified Constraint
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
constraint_index (int32): The index of Constraint
Returns:
tuple:
parent_bone_index (int32):
child_bone_index (int32):
get_bone_index_from_body¶
Get the first Body under the specified bone
unreal.PythonPhysicsAssetLib.get_bone_index_from_body(physics_asset, body_index) -> int32
Get the first Body under the specified bone
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
body_index (int32):
Returns:
int32: The bone's index
get_bodies_from_bone¶
Get the Bodies under the specified bone
unreal.PythonPhysicsAssetLib.get_bodies_from_bone(physics_asset, bone_index) -> Array[int32]
Get the Bodies under the specified bone
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
bone_index (int32): The index of Bone
Returns:
Array[int32]: The bodies's indexes in array
get_constraint_instance_accessor¶
Get the ConstraintInstanceAccessor from PhysicsAsset
unreal.PythonPhysicsAssetLib.get_constraint_instance_accessor(physics_asset, constraint_index) -> ConstraintInstanceAccessor
Get the ConstraintInstanceAccessor from PhysicsAsset
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
constraint_index (int32): The index of constraint
Returns:
ConstraintInstanceAccessor: The ConstraintInstanceAccessor
reset_constraint_properties¶
Reset the specified Constraint's values
unreal.PythonPhysicsAssetLib.reset_constraint_properties(physics_asset, constraint_index) -> None
Reset the specified Constraint's values
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
constraint_index (int32): The index of constraint
update_profile_instance¶
Update the Profile according to the specified Constraint
unreal.PythonPhysicsAssetLib.update_profile_instance(physics_asset, constraint_index) -> None
Update the Profile according to the specified Constraint
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
constraint_index (int32): The index of constraint
break_constraint_accessor¶
Get the Owner and Constraint Index from ConstraintInstanceAccessor
unreal.PythonPhysicsAssetLib.break_constraint_accessor(accessor) -> (owner=Object, constraint_index=int32) or None
Get the Owner and Constraint Index from ConstraintInstanceAccessor
note: added in v1.0.10
note: need UE5
Args:
accessor (ConstraintInstanceAccessor): The ConstraintInstanceAccessor instance
Returns:
tuple or None: None or tuple(Owner, ConstraintIndex)
owner (Object):
constraint_index (int32):
get_constraint_name¶
Get the Constraint's name by Constraint Index
unreal.PythonPhysicsAssetLib.get_constraint_name(physics_asset, constraint_index) -> Name
Get the Constraint's name by Constraint Index
note: added in v1.0.10
Args:
physics_asset (PhysicsAsset): The PhysicsAsset
constraint_index (int32): The index of constraint
Returns:
Name: Name of the Constraint
PythonRBFLib¶
Function Name | Description | |
---|---|---|
rbf_fun | None | |
set_rbf_params_deminsion | None |
rbf_fun¶
unreal.PythonRBFLib.rbf_fun(rbf_params, targets) -> PythonRBFFunction
RBFFun
Args:
rbf_params (RBFParams):
targets (Array[PythonRBFTarget]):
Returns:
PythonRBFFunction:
set_rbf_params_deminsion¶
unreal.PythonRBFLib.set_rbf_params_deminsion(rbf_params, dimensions) -> RBFParams
Set RBFParams Deminsion
Args:
rbf_params (RBFParams):
dimensions (int32):
Returns:
RBFParams:
PythonStructLib¶
Function Name | Description | |
---|---|---|
log_var_desc | Print out the detail infos of the given User Defined Struct. Include VarName, Category, Guid, PinValue and so on. | |
log_var_desc_by_friendly_name | Print out the detail info of the specified Variable of User Defined Struct. | |
get_variable_description | Get the content of VariableDescription of the specified Variable in User Defined Struct. | |
get_guid_from_friendly_name | Get the Guid of specified Variable in User Defined Struct by friendly name. | |
get_guid_from_property_name | Get the Guid of specified Variable in User Defined Struct by property name. | |
get_variable_names | Get the Variable Names of specified User Defined Struct. | |
get_friendly_names | Get the Friendly Names of specified User Defined Struct. | |
is_unique_friendly_name | Query is the Friendly Name unique or not. | |
add_variable | Add a new variable to specified User Defined Struct | |
add_directory_variable | Add a new variable to specified User Defined Struct | |
remove_variable_by_name | Remove the specified Variable in User Defined Struct by property name. | |
rename_variable | None | |
change_variable_default_value | Modify the default value of specified Variable in User Defined Struct. | |
get_variable_default_value | None |
log_var_desc¶
Print out the detail infos of the given User Defined Struct. Include VarName, Category, Guid, PinValue and so on.
unreal.PythonStructLib.log_var_desc(struct) -> None
Print out the detail infos of the given User Defined Struct. Include VarName, Category, Guid, PinValue and so on.
Args:
struct (UserDefinedStruct): The User Defined Struct you want to query.
log_var_desc_by_friendly_name¶
Print out the detail info of the specified Variable of User Defined Struct.
unreal.PythonStructLib.log_var_desc_by_friendly_name(struct, var_name) -> None
Print out the detail info of the specified Variable of User Defined Struct.
Args:
struct (UserDefinedStruct): The User Defined Struct you want to query.
var_name (str): The friend name of the specified variable.
get_variable_description¶
Get the content of VariableDescription of the specified Variable in User Defined Struct.
unreal.PythonStructLib.get_variable_description(struct, friendly_name) -> Map[str, str]
Get the content of VariableDescription of the specified Variable in User Defined Struct.
Args:
struct (UserDefinedStruct): The User Defined Struct you want to query.
friendly_name (str): The friend name of the specified variable.
Returns:
Map[str, str]: The content of VariableDescription as a Key, Value String Map.
get_guid_from_friendly_name¶
Get the Guid of specified Variable in User Defined Struct by friendly name.
unreal.PythonStructLib.get_guid_from_friendly_name(struct, friendly_name) -> Guid
Get the Guid of specified Variable in User Defined Struct by friendly name.
Args:
struct (UserDefinedStruct): The User Defined Struct you want to query.
friendly_name (str): The friendly name of the variable.
Returns:
Guid: The Guid of the variable.
get_guid_from_property_name¶
Get the Guid of specified Variable in User Defined Struct by property name.
unreal.PythonStructLib.get_guid_from_property_name(name) -> Guid
Get the Guid of specified Variable in User Defined Struct by property name.
note: The Guid of a Property Name is independent of which struct it belongs to
Args:
name (Name): The Property name of the Property variable.
Returns:
Guid: The Guid of the variable.
get_variable_names¶
Get the Variable Names of specified User Defined Struct.
unreal.PythonStructLib.get_variable_names(struct) -> Array[Name]
Get the Variable Names of specified User Defined Struct.
Args:
struct (UserDefinedStruct): The User Defined Struct you want to query.
Returns:
Array[Name]: The variable name list.
get_friendly_names¶
Get the Friendly Names of specified User Defined Struct.
unreal.PythonStructLib.get_friendly_names(struct) -> Array[str]
Get the Friendly Names of specified User Defined Struct.
Args:
struct (UserDefinedStruct): The User Defined Struct you want to query.
Returns:
Array[str]: The friendly names list.
is_unique_friendly_name¶
Query is the Friendly Name unique or not.
unreal.PythonStructLib.is_unique_friendly_name(struct, friendly_name) -> bool
Query is the Friendly Name unique or not.
Args:
struct (UserDefinedStruct): The User Defined Struct you want to query.
friendly_name (str): The New Friendly Name
Returns:
bool: True if the friendly name is unique in the struct.
add_variable¶
Add a new variable to specified User Defined Struct
unreal.PythonStructLib.add_variable(struct, category="PythonEditor", sub_category, sub_category_object, container_type_value, is_reference=False, friendly_name="") -> bool
Add a new variable to specified User Defined Struct
note: More example can be found in the website, or print out a exists variable with log_var_desc_by_friendly_name for reference.
Args:
struct (UserDefinedStruct): The User Defined Struct you want to modify.
category (Name): The Category of the new Variable
sub_category (Name): The SubCategory of the new Variable
sub_category_object (Object): The SubCategoryObject of the new Variable
container_type_value (int32): Container type. 0: single, 1: array, 2: set. Use add_directory_variable if you want add a dict variable
is_reference (bool): Whether e new Variable passed as reference
friendly_name (str): Friendly name of the new variable
Returns:
bool: True if the new variable has been added
add_directory_variable¶
Add a new variable to specified User Defined Struct
unreal.PythonStructLib.add_directory_variable(struct, category="PythonEditor", sub_category, sub_category_object, terminal_category, terminal_sub_category, terminal_sub_category_object, is_reference=False, friendly_name="") -> bool
Add a new variable to specified User Defined Struct
note: More example can be found in the website, or print out a exists variable with log_var_desc_by_friendly_name for reference.
Args:
struct (UserDefinedStruct): The User Defined Struct you want to modify.
category (Name): The Category of the new Variable's key
sub_category (Name): The SubCategory of the new Variable's key
sub_category_object (Object): The SubCategoryObject of the new Variable's key
terminal_category (Name): The Category of the new Variable's value
terminal_sub_category (Name): The SubCategory of the new Variable's value
terminal_sub_category_object (Object): The SubCategoryObject of the new Variable's value
is_reference (bool): Whether e new Variable passed as reference
friendly_name (str): Friendly name of the new variable
Returns:
bool: True if the new variable has been added
remove_variable_by_name¶
Remove the specified Variable in User Defined Struct by property name.
unreal.PythonStructLib.remove_variable_by_name(struct, var_name) -> bool
Remove the specified Variable in User Defined Struct by property name.
Args:
struct (UserDefinedStruct): The User Defined Struct you want to modify.
var_name (Name): The Property name of the variable.
Returns:
bool: None
rename_variable¶
unreal.PythonStructLib.rename_variable(struct, var_guid, new_friendly_name) -> bool
Rename Variable
Args:
struct (UserDefinedStruct):
var_guid (Guid):
new_friendly_name (str):
Returns:
bool:
change_variable_default_value¶
Modify the default value of specified Variable in User Defined Struct.
unreal.PythonStructLib.change_variable_default_value(struct, var_guid, new_default_value) -> bool
Modify the default value of specified Variable in User Defined Struct.
Args:
struct (UserDefinedStruct): The User Defined Struct you want to modify.
var_guid (Guid): The Guid of the variable.
new_default_value (str): The new default value in string format.
Returns:
bool: True if the default value has been set
get_variable_default_value¶
unreal.PythonStructLib.get_variable_default_value(struct, var_guid) -> str
Get Variable Default Value
Args:
struct (UserDefinedStruct):
var_guid (Guid):
Returns:
str:
PythonTestLib¶
Function Name | Description | |
---|---|---|
delay_call | Push a 'delay call' python command. | |
cancel_delay_call_by_id | Cancel specified delay call | |
cancel_delay_call | Cancel all running delay call | |
get_logs | Get Logs from Log History | |
clear_log_buffer | Clear the Log History buffers. The Log history is different with log in Output Console window. Clear History in Output Log Window will not clear the History Buffer |
delay_call¶
Push a 'delay call' python command.
unreal.PythonTestLib.delay_call(python_cmd, delay_seconds, on_finished_cmd="", repeat_count=1) -> Guid
Push a 'delay call' python command.
note: added in v1.0.9
Args:
python_cmd (str): Python command in string
delay_seconds (float): Time seconds for delay call
on_finished_cmd (str): Python command in string, when delay call finished
repeat_count (int32): The number of repeated calls
Returns:
Guid: Guid
cancel_delay_call_by_id¶
Cancel specified delay call
unreal.PythonTestLib.cancel_delay_call_by_id(guid) -> bool
Cancel specified delay call
note: added in v1.0.10
Args:
guid (Guid):
Returns:
bool: None
cancel_delay_call¶
Cancel all running delay call
unreal.PythonTestLib.cancel_delay_call() -> bool
Cancel all running delay call
note: added in v1.0.9
Returns:
bool: None
get_logs¶
Get Logs from Log History
unreal.PythonTestLib.get_logs(number_limit=-1, category_regex="") -> Array[str]
Get Logs from Log History
note: added in v1.0.9
Args:
number_limit (int32): Logs Maximum Number Limit, -1 for No Limit
category_regex (str): Regular expression for category filter.
Returns:
Array[str]: The Logs with timestamps and frame identifier (FrameCounter % 1000)
clear_log_buffer¶
Clear the Log History buffers. The Log history is different with log in Output Console window. Clear History in Output Log Window will not clear the History Buffer
unreal.PythonTestLib.clear_log_buffer() -> int32
Clear the Log History buffers. The Log history is different with log in Output Console window. Clear History in Output Log Window will not clear the History Buffer
note: added in v1.0.9
Returns:
int32: The number of Cleared logs
PythonTextureLib¶
Function Name | Description | |
---|---|---|
create_texture2d_from_raw | Create a Texture2D from pixel RawData | |
create_texture2d | Create a Texture2D with specified size | |
finish_compilation_texture | Blocks until completion of the requested textures | |
set_render_target_data | Set the RenderTexture2D By Raw Data. | |
get_render_target_raw_data | Get the Raw Data from RenderTarget2D | |
get_texture2d_content | Get the Raw Data from Texture2D |
create_texture2d_from_raw¶
Create a Texture2D from pixel RawData
unreal.PythonTextureLib.create_texture2d_from_raw(raw_data, width, height, channel_num, use_srgb=False, texture_filter_value=-1, bgr=False, flip_y=False) -> Texture2D
Create a Texture2D from pixel RawData
note: The Texture2D type is EPixelFormat::PF_R8G8B8A8
note: added in v1.0.7
Args:
raw_data (Array[uint8]): The flatten uint8 raw data of image, len(RawData) == RawDataWidth * RawDataHeight * RawDataChannelNum
width (int32): The width of the Texture2D
height (int32): The Height of the Texture2D
channel_num (int32): The Number of RawData's Channel. 1: grayscale; 2: grayscale with alpha; 3: rgb; 4 rgb with alpha
use_srgb (bool): Use SRGB or no0t
texture_filter_value (int32): The filter of texture: 0: Nearest, 1: Bilinear, 2: Trilinear, 3: Use setting from the Texture Group.
bgr (bool): Is the order of RawData is Blue, Green, Red, otherwise RGB
flip_y (bool):
Returns:
Texture2D: The created Texture2D
create_texture2d¶
Create a Texture2D with specified size
unreal.PythonTextureLib.create_texture2d(width, height, use_srgb=False, texture_filter_value=-1) -> Texture2D
Create a Texture2D with specified size
note: The Texture2D type is EPixelFormat::PF_B8G8R8A8
note: added in v1.2.0
Args:
width (int32): The width of the Texture2D
height (int32): The Height of the Texture2D
use_srgb (bool): Use SRGB or not
texture_filter_value (int32): The filter of texture: 0: Nearest, 1: Bilinear, 2: Trilinear, 3: Use setting from the Texture Group.
Returns:
Texture2D: The created Texture2D
finish_compilation_texture¶
Blocks until completion of the requested textures
unreal.PythonTextureLib.finish_compilation_texture(texture) -> Texture2D
Blocks until completion of the requested textures
note: added in v1.2.0
note: need UE5
Args:
texture (Texture2D):
Returns:
Texture2D: Texture2D
set_render_target_data¶
Set the RenderTexture2D By Raw Data.
unreal.PythonTextureLib.set_render_target_data(render_target_texture, raw_data, raw_data_width, raw_data_height, raw_data_channel_num, use_srgb=False, texture_filter_value=-1, bgr=False) -> None
Set the RenderTexture2D By Raw Data.
note: The order of RawData is row first. Lower left corner is the first pixel, and upper right is the last
note: added in v1.0.7
Args:
render_target_texture (TextureRenderTarget2D): The target RenderTarget2D
raw_data (Array[uint8]): The flatten uint8 raw data of image, len(RawData) == RawDataWidth * RawDataHeight * RawDataChannelNum
raw_data_width (int32): The width of the RawData, we can fill the rt with smaller RawData
raw_data_height (int32): The Height of the RawData
raw_data_channel_num (int32): The Number of RawData's Channel. 1: grayscale; 2: grayscale with alpha; 3: rgb; 4 rgb with alpha
use_srgb (bool): Use SRGB or not
texture_filter_value (int32): The filter of texture: 0: Nearest, 1: Bilinear, 2: Trilinear, Use setting from the Texture Group.
bgr (bool): Is the order of RawData is Blue, Green, Red, otherwise RGB
get_render_target_raw_data¶
Get the Raw Data from RenderTarget2D
unreal.PythonTextureLib.get_render_target_raw_data(render_target_texture) -> Array[uint8]
Get the Raw Data from RenderTarget2D
note: added in v1.0.7
Args:
render_target_texture (TextureRenderTarget2D): The source RenderTarget2D
Returns:
Array[uint8]:
out_raw_data (Array[uint8]):
get_texture2d_content¶
Get the Raw Data from Texture2D
unreal.PythonTextureLib.get_texture2d_content(texture, mip_level) -> Array[uint8] or None
Get the Raw Data from Texture2D
note: added in v1.2.1
Args:
texture (Texture2D): The source Texture2D
mip_level (int32): The mip level of the Texture2D
Returns:
Array[uint8] or None: The raw data of the Texture2D, pixel order is BGRA
dst_data (Array[uint8]):