Commit Graph

232 Commits

Author SHA1 Message Date
Lauren Barnes
6248f8d412 Replacing legacy EditorStyle calls with AppStyle
#preflight 6272a74d2f6d177be3c6fdda
#rb Matt.Kuhlenschmidt

#ROBOMERGE-OWNER: Lauren.Barnes
#ROBOMERGE-AUTHOR: lauren.barnes
#ROBOMERGE-SOURCE: CL 20057269 via CL 20070159 via CL 20072035 via CL 20072203
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)
#ROBOMERGE-CONFLICT from-shelf

[CL 20105363 by Lauren Barnes in ue5-main branch]
2022-05-09 13:12:28 -04:00
Matt Peters
d64cf41728 AssetRegistry includes (Engine Plugins): change #include "AssetData.h" -> #include "AssetRegistry/AssetData.h", and similar for the other moved AssetRegistry headers.
#rb Zousar.Shaker
#rnx
#preflight 6270563191629533ec2b6f6e

[CL 20017756 by Matt Peters in ue5-main branch]
2022-05-02 18:59:38 -04:00
Patrick Laflamme
f976071715 Fixed missing function declaration of Nativize(FieldPath) in PyConversion.h
#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]
2022-05-02 12:02:35 -04:00
Patrick Laflamme
2d06d8b837 Fixed static analysis error in PyWrapperTypeRegistry.cpp
#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]
2022-04-20 15:34:32 -04:00
Patrick Laflamme
cadfabd8df Changed a Python glue generation error into a warning when a make or a break function signature doesn't comply with Python requirements. Some licensees have sophisticated make/break functions that cannot be easily supported by Python. Downgrading from an error to a warning, with a message saying that the default make/break will be used instead to make/break the Python object, will prevent licensees from hitting a UE_DEBUG_BREAK every time the debugger is attached.
#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]
2022-04-20 11:08:36 -04:00
Patrick Laflamme
1279b9e740 Implemented a workaround to declare valid Python methods when the corresponding UFUNCTION has default parameter values declared in the meta data, but also has further parameters that don't have default values, which is illegal in C++ and Python, but because the C++ compiler doesn't interpret the meta data, those errors are not caught when compiling C++ code.
- 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]
2022-04-19 17:29:42 -04:00
Patrick Laflamme
82404718e3 Exposed TFieldPath<T> as 'FieldPath' to Python. That type is used in APIs and types exposed to Python.
- 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]
2022-04-19 13:38:41 -04:00
dave jones2
939f991649 UE-146987 - Cleaned up the original fix for erroneous implicit casts in python script nodes.
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]
2022-04-19 12:18:56 -04:00
matt johnson
e53c8beca4 PythonScriptPlugin: expose IsPackageExternal() and GetPackage() for object instances wrapped to Python
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]
2022-04-15 12:51:54 -04:00
Patrick Laflamme
c8816846a1 Fixed code alignment missing 1 tab.
#rb Trivial
#preflight Trivial

[CL 19762189 by Patrick Laflamme in ue5-main branch]
2022-04-14 16:10:19 -04:00
jamie dale
ca824fde63 Improved the parsing and validation of default parameter meta-data in Python
- 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]
2022-04-12 21:17:47 -04:00
Helge Mathee
a06c227d07 PythonScriptPlugin: Add import_text / export_text to wrapped structs
#rb jamie.dale
#jira na
#preflight https://horde.devtools.epicgames.com/job/624f06d16d3bb118aaefa1b9

[CL 19673734 by Helge Mathee in ue5-main branch]
2022-04-07 13:57:56 -04:00
jamie dale
e48aa1e99a Search for both 'CPP_Default_X' and 'X' in the function meta-data when resolving the default value of an argument
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]
2022-04-01 15:09:57 -04:00
jamie dale
502bb2e067 Avoid attempting to generate Python glue for non-C++ types when running the initial glue generation step
#preflight skip
#rb Patrick.Laflamme
#rnx

#ROBOMERGE-AUTHOR: jamie.dale
#ROBOMERGE-SOURCE: CL 19540585 via CL 19542169 via CL 19542171 via CL 19542178
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v937-19513599)

[CL 19544202 by jamie dale in ue5-main branch]
2022-03-29 12:44:13 -04:00
patrick laflamme
3468243bdc In Python stub generation, changed a check() to a checkf() to log the name of the UFunction that was detected as a delegate but didn't have the FUNC_Delegate flag.
#rb Jamie.Dale
#preflight 623cc56bf765c25e98e82454

#ROBOMERGE-AUTHOR: patrick.laflamme
#ROBOMERGE-SOURCE: CL 19502518 via CL 19505190 via CL 19505328
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v937-19513599)

[CL 19514626 by patrick laflamme in ue5-main branch]
2022-03-25 12:34:51 -04:00
dave jones2
135eb09732 UE-146778 - CIS Content Error: Unhandled implicit casts found during compilation of function
The BP compiler erroneously reports that python nodes might be missing implicit casts. However, UK2Node_ExecutePythonScript nodes handle argument slightly differently than conventional function nodes. The pins don't actually correspond to actual arguments on ExecutePythonScript. Instead, they more or less serve as references to their linked inputs, which ExecutePythonScript will pop from the stack and perform a direct conversion to a Python type. As a result, there's nothing to cast, and we can safely remove the entries from the ImplicitCastMap on the current content.

#rb jamie.dale
#jira UE-146778
#preflight 623b4fbeca34ffd7bf7db3e8

[CL 19482561 by dave jones2 in ue5-main branch]
2022-03-23 14:24:22 -04:00
jamie dale
7a31d8565b Moved the code to import default function argument values to a common location so it can be shared
#jira
#preflight 622b9e5eea76b02e348882e3
#rb Patrick.Laflamme

#ROBOMERGE-AUTHOR: jamie.dale
#ROBOMERGE-SOURCE: CL 19392086 via CL 19395541 via CL 19399560 via CL 19399642
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)

[CL 19403795 by jamie dale in ue5-main branch]
2022-03-16 03:49:31 -04:00
Patrick Laflamme
a64e090bae Fixed Python GIL (Global Interpreter Lock) deadlock while loading an asset.
- Released the GIL in Finalize() - rename class, get default object and refresh BlueprintActionDatabase

#jira FORT-444807 - Python Load_Asset is causing the editor to hang if it has to load certain assets
#rb Jamie.Dale, Patrick.Laflamme

#ushell-cherrypick of 19292501 by Max.Chen
#preflight 6226843d1938e4deaa7916fc

[CL 19293291 by Patrick Laflamme in ue5-main branch]
2022-03-07 17:37:07 -05:00
marc audy
cff01aa9fa Added support for native FProperty setters and getters.
Setters and getters are native functions called by FProperties when setting property values with *_InContainer functions.
Setters and getter function names can be manually specified with Setter = Func and Getter = Func keywords inside of UPROEPRTY macro but they will also be automatically parsed if the name is not explicitly specified if the setter or getter function name matches SetPropertyName and GetPropertyName pattern.
The latter behavior can be disabled in UHT's DefaultEngine.ini by setting AutomaticSettersAndGetters=False.
ImportText and ExportTextItem functions have been deprecated and should be replaced with *_InContainer or *_Direct variants.

#rb Steve.Robb
#preflight 6210a377a83e0bcefd03d9e1

#ROBOMERGE-OWNER: marc.audy
#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 19070318 via CL 19098059 via CL 19104650 via CL 19104661 via CL 19110012
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19147839 by marc audy in ue5-main branch]
2022-02-25 10:39:39 -05:00
robert manuszewski
c36e03d5e3 do clause support
#rb Andrew.Scheidecker
#preflight 620f3a108863746a104d6c36

#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 19047989 via CL 19048186 via CL 19048197 via CL 19048203 via CL 19049414
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v918-19018356)

[CL 19065767 by robert manuszewski in ue5-main branch]
2022-02-21 00:33:13 -05:00
patrick laflamme
ce6fb0e451 Fix CIS error in PyWrapperTypeRegistry.cpp.
#rb None
#preflight Trivial

#ROBOMERGE-AUTHOR: patrick.laflamme
#ROBOMERGE-SOURCE: CL 18807217 in //UE5/Release-5.0/... via CL 18809182 via CL 18822221
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545)

[CL 18823247 by patrick laflamme in ue5-main branch]
2022-02-02 05:29:00 -05:00
patrick laflamme
9cfdc160f5 Fixed Python plugin to allow resolving USTRUCT Make/Break functions specifed with 'HasNativeMake' and 'HasNativeBreak' later. This supports cases where the function are implemented in a C++ module that is loaded after the module declaring the USTRUCT. The implementation postpones resolving missing functions until FCoreDelegates::OnPostEngineInit is invoked. If one or more functions are still missing, corresponding error(s) are logged.
#jira UE-92057 - Investigate deferring the function resolution for Make/Break meta-data in Python
#rb Jamie.Dale
#preflight 61f84aa35a026d2d19b62c70

#ROBOMERGE-AUTHOR: patrick.laflamme
#ROBOMERGE-SOURCE: CL 18796649 in //UE5/Release-5.0/... via CL 18797780 via CL 18798499
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545)

[CL 18798615 by patrick laflamme in ue5-main branch]
2022-01-31 17:03:42 -05:00
patrick laflamme
b065712809 Fixed Python GIL (Global Interpreter Lock) deadlock while loading an asset.
- Released the GIL while loading or finding an asset.
  - Released the GIL while loading or finding an object.
  - Released the GIL while loading or finding packages.
  - Released the GIL while logging/flushing stdout/stderr from Python.

#rb Jamie.Dale
#preflight 61f2fb1d1f12674afbbf9933

#ROBOMERGE-AUTHOR: patrick.laflamme
#ROBOMERGE-SOURCE: CL 18764878 via CL 18764883 via CL 18764890 via CL 18765457 via CL 18765586
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18765591 by patrick laflamme in ue5-main branch]
2022-01-27 19:16:00 -05:00
Patrick Laflamme
868b0d24be Instrumented Python plugin loading time and saved about 500ms to the total module startup time.
#rb Jamie.Dale
#preflight 61f1bba6be0f0e0a623e7697

[CL 18745211 by Patrick Laflamme in ue5-main branch]
2022-01-26 16:44:45 -05:00
patrick laflamme
98e5880317 Fixed the Editor Python Executor to parse and escape quotes for -ExecutePythonScript command line parameters to allow quoting python arguments containing spaces.
#jira UE-136852 - Running python script with -ExecutePythonScript doesn't allow passing python arguments with spaces
#rb Jamie.Dale

#ROBOMERGE-AUTHOR: patrick.laflamme
#ROBOMERGE-SOURCE: CL 18405205 in //UE5/Release-5.0/... via CL 18405209
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v896-18170469)

[CL 18405211 by patrick laflamme in ue5-release-engine-test branch]
2021-12-08 09:14:28 -05:00