Previously, all Unreal Types generated by python scripts would be created inside package "/Engine/PythonTypes". This was changed by [CL 32478991 in ue5-main branch], which meant to "remove the restriction that Unreal types generated from Python scripts must have globally unique names". Currently, Python-generated unreal types are placed in several transient packages, each one created for a specific python source file. These packages have paths of the form "/Game/Python/<filename>_PY" for files located in the "Content/Python" directory.
To maintain backwards-compatibility redirectors were created from the old-style type names to the most recent modular/hashed type names. This works for classes, structs and enums. However, no redirectors were created for the CDOs of python-generated unreal classes, which broke backwards-compatibility with scripts that relied on the paths of those CDOs.
One important use-case that makes heavy use of CDO paths is the usage of the Remote Control API to remotely call functions from Python-defined Blueprint Function Libraries. This is achieved by sending HTTP PUT requests to Unreal Engine with the endpoint "/object/call" and with payloads of the form:
{
"objectPath": "/Engine/PythonTypes.Default__<CLASS_NAME>",
"functionName": "<FUNCTION_NAME>",
"parameters":
,
"generateTransaction": True
}
The need of the "objectPath" above means that the change introduced by CL 32478991 broke compatibility with all previously existing python scripts that made use of this technique. Adding redirectors to the CDOs of python-generated unreal classes can probably fix this.
Note that it might also be desireable to create a new endpoint "/class/call" to allow for the clean remote call of static class functions using the Remote Control API. This would be an improvement for the API, but it would not solve the backwards-compatibility issue.
1. Download, extract, compile and open the repro project
2. Send the following HTTP PUT requests to "http://localhost:30010/remote/object/call":
2.1. The following works to call a function from a CPP-defined BPLibrary:
{
"ObjectPath": "/Script/TestRemoteControl.Default__MyBlueprintFunctionLibrary",
"FunctionName": "PrintMessageFromCpp",
"Parameters": {},
"GenerateTransaction": true
}
2.2. The following works to call a function from a Python-defined BPLibrary in UE up to UE 5.4, but not in UE 5.5:
{
"ObjectPath": "/Engine/PythonTypes.Default__MyPythonFunctionLibrary",
"FunctionName": "print_message_from_python",
"Parameters": {},
"GenerateTransaction": true
}
2.3. The following works to call a function from a Python-defined BPLibrary in UE 5.5, but not in UE up to 5.4:
{
"ObjectPath": "/Game/Python/my_import_PY.Default__MyImportFunctionLibrary",
"FunctionName": "print_message_from_import",
"Parameters": {},
"GenerateTransaction": true
}
2.4. The following works to call a function from a Python-import-defined BPLibrary in UE 5.5, but not in UE up to 5.4:
{
"ObjectPath": "/Game/Python/init_unreal_PY.Default__MyPythonFunctionLibrary",
"FunctionName": "print_message_from_python",
"Parameters": {},
"GenerateTransaction": true
}
Note: The requests can be sent, for example, by using a software such as [Link Removed], or by using an external Python script such as the one below:
import requests
url = "http://localhost:30010/remote/object/call"
payload = {
"objectPath": "/Engine/PythonTypes.Default__MyPythonFunctionLibrary",
"functionName": "print_message_from_python",
"parameters": {},
"generateTransaction": True
}
headers =
{'Content-type': 'application/json', 'Accept': 'text/plain'}timeout = 100
try:
response = requests.put(url, json=payload, headers=headers, timeout=timeout).json()
except requests.exceptions.ConnectionError:
print("Connection error")
How does TextureRenderTarget2D get TArray<uint8> type data?
Why does the REMOVE method of map container remove elements have memory leaks?
How do I set a material as a post-processing material?
What is the cause of the packaging error falling back to 'GameUserSettings' in ue5?
How to delete some elements correctly when deleting an array loop?
What is the difference between Camera and CineCamera?
What controls of umg have mouse wheel events in UE4.27?
What ConsoleCommand can be executed to improve the quality of pixel stream images?
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-247331 in the post.
0 |
Component | UE - Editor - Workflow Systems |
---|---|
Affects Versions | 5.5.3 |
Created | Feb 11, 2025 |
---|---|
Updated | Feb 18, 2025 |