This change consists of multiple changes:
Core:
- Deprecation of ANY_PACKAGE macro. Added ANY_PACKAGE_DEPRECATED macro which can still be used for backwards compatibility purposes (only used in CoreUObject)
- Deprecation of StaticFindObjectFast* functions that take bAnyPackage parameter
- Added UStruct::GetStructPathName function that returns FTopLevelAssetPath representing the path name (package + object FName, super quick compared to UObject::GetPathName) + wrapper UClass::GetClassPathName to make it look better when used with UClasses
- Added (Static)FindFirstObject* functions that find a first object given its Name (no Outer). These functions are used in places I consider valid to do global UObject (UClass) lookups like parsing command line parameters / checking for unique object names
- Added static UClass::TryFindType function which serves a similar purpose as FindFirstObject however it's going to throw a warning (with a callstack / maybe ensure in the future?) if short class name is provided. This function is used in places that used to use short class names but now should have been converted to use path names to catch any potential regressions and or edge cases I missed.
- Added static UClass::TryConvertShortNameToPathName utility function
- Added static UClass::TryFixShortClassNameExportPath utility function
- Object text export paths will now also include class path (Texture2D'/Game/Textures/Grass.Grass' -> /Script/Engine.Texture2D'/Game/Textures/Grass.Grass')
- All places that manually generated object export paths for objects will now use FObjectPropertyBase::GetExportPath
- Added a new startup test that checks for short type names in UClass/FProperty MetaData values
AssetRegistry:
- Deprecated any member variables (FAssetData / FARFilter) or functions that use FNames to represent class names and replaced them with FTopLevelAssetPath
- Added new member variables and new function overloads that use FTopLevelAssetPath to represent class names
- This also applies to a few other modules' APIs to match AssetRegistry changes
Everything else:
- Updated code that used ANY_PACKAGE (depending on the use case) to use FindObject(nullptr, PathToObject), UClass::TryFindType (used when path name is expected, warns if it's a short name) or FindFirstObject (usually for finding types based on user input but there's been a few legitimate use cases not related to user input)
- Updated code that used AssetRegistry API to use FTopLevelAssetPaths and USomeClass::StaticClass()->GetClassPathName() instead of GetFName()
- Updated meta data and hardcoded FindObject(ANY_PACKAGE, "EEnumNameOrClassName") calls to use path names
#jira UE-99463
#rb many.people
[FYI] Marcus.Wassmer
#preflight 629248ec2256738f75de9b32
#codereviewnumbers 20320742, 20320791, 20320799, 20320756, 20320809, 20320830, 20320840, 20320846, 20320851, 20320863, 20320780, 20320765, 20320876, 20320786
#ROBOMERGE-OWNER: robert.manuszewski
#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 20430220 via CL 20433854 via CL 20435474 via CL 20435484
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246)
[CL 20448496 by robert manuszewski in ue5-main branch]
#jira UE-154049 - //UE5/Main - Static Analysis Win64 (MSVC) - PyGenUtil.cpp warning: (<non-zero constant> && <expression>) always evaluates to the result of <expression>
#rb Trivial
#preflight 628e7c2ec826bd5a7f02e5e8
[CL 20370010 by Patrick Laflamme in ue5-main branch]
- The 'Off' mode turns type hinting off and produce the Python stub as before.
- The 'Auto-Completion' mode aims to provide types in Python IDE auto-completion while leaving out some information/complexity that clutter the function definition.
- The 'Type Checker' mode aims to provide the closest to the truth (with some limitations) of the supported API types. Type coercion makes it harder to see the exact types.
Known limitations:
- We don't know when a reflected UObject can legally be None. In 'Type Checker' mode, the UObject are always marked as typing.Optional[] everywhere to denotate that they can be None. Obviously, some methods never returns None and some method will fails if an Object is None. It might be annoying to users in some case.
#jira UE-119557 - Consider adding type hinting support to the unreal.py stub file
#rb Jamie.Dale
#preflight 628cf27f7778f10598b1e56d
[CL 20349869 by Patrick Laflamme in ue5-main branch]
Added a test in test_wrapper_types.py to validate before and after the fix.
#jira UE-148631 - GitHub 9069 : Python Type Registry Name Collision Fix
#9069
#rb Jamie.Dale
#preflight 628253a5c57a894cf67eab9d
[CL 20223162 by Patrick Laflamme in ue5-main branch]
It seems those change generates failures in some automation tasks checking asset references.
#rb None
#preflight None
[CL 20191520 by Patrick Laflamme in ue5-main branch]
Added a test in test_wrapper_types.py to validate before and after the fix.
#jira UE-148631 - GitHub 9069 : Python Type Registry Name Collision Fix
#9069
#rb Jamie.Dale
#preflight 627ebc38631ab4370513e79d
[CL 20188886 by Patrick Laflamme in ue5-main branch]
#fyi Patrick.Laflamme
Original CL Desc
-----------------------------------------------------------------
Fixed Python calling the wrong delegate if the same delegate name/type was declared in two different UObject.
Added a test in test_wrapper_types.py to validate before and after the fix.
#jira UE-148631 - GitHub 9069 : Python Type Registry Name Collision Fix
#9069
#rb Jamie.Dale
#preflight 627d5e294a05ef0394d5ac65
[CL 20173858 by bob tellez in ue5-main branch]
Added a test in test_wrapper_types.py to validate before and after the fix.
#jira UE-148631 - GitHub 9069 : Python Type Registry Name Collision Fix
#rb Jamie.Dale
#preflight 627d5e294a05ef0394d5ac65
[CL 20169181 by Patrick Laflamme in ue5-main branch]
#jira UE-150446 - //UE5/Main - UE.EditorAutomation(RunTest=Editor) Win64 - test_wrapper_types test fails due to ensure condition failing referencing PyConversion.h
#rb Trivial
#preflight 626ffdf6645c64f3a249bd21
[CL 20009793 by Patrick Laflamme in ue5-main branch]
#jira UE-149733 - //UE5/Main - Static Analysis Win64 (PVS-Studio) - PyWrapperTypeRegistry.cpp warning: The 'InTypeMethod.MethodFunc.Func' pointer was utilized before it was verified against nullptr
#rb Trivial
#preflight 626058cbdd47b4ad217f80c8
[CL 19836351 by Patrick Laflamme in ue5-main branch]
#rb Jamie.Dale
#jira UE-149707 - Change Python glue generation error into a warning when a make or a break function signature doesn't comply with Python requirements.
#preflight 62601f824617dd44291097f0
[CL 19830811 by Patrick Laflamme in ue5-main branch]
- Fixed the Python method declaration by adding "=..." when a default value was missing. This is legal in a Python stub to not specify the default value.
#rb Jamie.Dale
#preflight 625f25e3db15ac92dba883ee
[CL 19818316 by Patrick Laflamme in ue5-main branch]
- Added corresponding tests to test_wrapper_type
#jira UE-147015 - Missing Python wrapper for TFieldPath property for Python
#rb Jamie.Dale
#preflight 625eefb7d412434587fbf459
[CL 19812431 by Patrick Laflamme in ue5-main branch]
Since UK2Node_ExecutePythonScript uses wildcards for its pins, it's dependent on its linked inputs. During node reconstruction, we were updating the python node's pins based on incorrect data. For example, one of the input nodes needed to change its pin type from real/double to real/float during reconstruction. However, this reconstruction occurred after the linked python node was reconstructed. As a result, the python node assumed that its linked input node was using a real/double type.
We can fix this by simply changing the priority of UK2Node_ExecutePythonScript to Low_UsesDependentWildcard. Additionally, this change reverts 19482561.
#rb jamie.dale
#preflight 625882d8010ebc5d4e8a5cc7
#jira UE-146987
[CL 19810564 by dave jones2 in ue5-main branch]
This exposes UObjectBaseUtility's IsPackageExternal() and GetPackage() as
is_package_external() and get_package(), respectively, for UObject instances
that are wrapped to Python. GetOutermost() simply calls through to GetPackage(),
so the newly added get_package() is equivalent to the existing get_outermost(),
but the former is preferred according to the docstring for GetOutermost().
get_outermost() was left in place so as not to break existing Python code.
#rb jamie.dale
#preflight 6258b018010ebc5d4e92afdc
[CL 19772809 by matt johnson in ue5-main branch]
- Class parameters using short paths now parse correctly.
- Default values are now validated to avoid false positives (eg, LatentInfo, WorldContext, etc).
#jira
#preflight 62559d3a69015afc27ac0569
#rb Patrick.Laflamme
#rnx
#ROBOMERGE-AUTHOR: jamie.dale
#ROBOMERGE-SOURCE: CL 19724916 via CL 19727708 via CL 19729028 via CL 19729517
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v938-19570697)
[CL 19733237 by jamie dale in ue5-main branch]
The latter is used by BP functions, as well as C++ functions that have default arguments that UHT can't parse (eg, a default TMap argument).
#jira
#preflight 62470f9d470aff98e97e71db
#rb Patrick.Laflamme
#rnx
#ROBOMERGE-AUTHOR: jamie.dale
#ROBOMERGE-SOURCE: CL 19590554 via CL 19591745 via CL 19591775 via CL 19591795
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v938-19570697)
[CL 19593534 by jamie dale in ue5-main branch]