Commit Graph

244 Commits

Author SHA1 Message Date
jamie dale
44dc0680b2 Added a guard when converting to FName in Python, to verify the name fits within NAME_SIZE
[FYI] Malachi.Duncan

#ROBOMERGE-SOURCE: CL 16938846 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v838-16927207)

[CL 16938855 by jamie dale in ue5-release-engine-test branch]
2021-07-23 13:16:11 -04:00
jamie dale
da9ca8b7d8 Added missing __repr__ function to the basic Python wrapped types
[FYI] Malachi.Duncan

#ROBOMERGE-SOURCE: CL 16910247 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v836-16769935)

[CL 16910254 by jamie dale in ue5-release-engine-test branch]
2021-07-21 11:42:49 -04:00
jamie dale
63144c3236 Added support for per-plugin Python site-packages
Plugins can now add third-party Python scripts within their Content/Python/Lib/site-packages and Content/Python/Lib/{Platform}/site-packages folders, and these will be automatically available for import within UE.

#rb JeanMichel.Dignard, Timothy.Daoust

#ROBOMERGE-SOURCE: CL 16884142 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v836-16769935)

[CL 16884152 by jamie dale in ue5-release-engine-test branch]
2021-07-19 11:34:56 -04:00
matt kuhlenschmidt
8a71ad940c Minor adjustments to the output log drawer.
- ~ key now also works for python command boxes
- Improved tooltip for the output log drawer
- Cosmetic UI changes.

#ROBOMERGE-SOURCE: CL 16352021 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v804-16311228)

[CL 16352157 by matt kuhlenschmidt in ue5-release-engine-test branch]
2021-05-17 11:31:32 -04:00
aurel cordonnier
50944fd712 Merge UE5/RES @ 16162155 to UE5/Main
This represents UE4/Main @ 16130047 and Dev-PerfTest @ 16126156

[CL 16163576 by aurel cordonnier in ue5-main branch]
2021-04-29 19:32:06 -04:00
Jamie Dale
f3b5253145 Isolate the embedded Python interpreter from the general Python system environment
The following flags are now set when initializing the embedded Python interpreter:
 - Py_IgnoreEnvironmentFlag - Ignore PYTHONPATH when calculating sys.path.
 - Py_IsolatedFlag - Skip adding the user's site-packages directory to sys.path.

To counter the loss of PYTHONPATH, a new UE_PYTHONPATH environment variable is now available with the same rules as PYTHONPATH.

#jira UE-113583
#rb Rex.Hill

[CL 16064481 by Jamie Dale in ue5-main branch]
2021-04-20 14:53:29 -04:00
Marc Audy
01b7c9f4f5 Merge UE5/RES @ 15958325 to UE5/Main
This represents UE4/Main @ 15913390 and Dev-PerfTest @ 15913304

[CL 15958515 by Marc Audy in ue5-main branch]
2021-04-08 14:32:07 -04:00
louise rasmussen
825c64a6f5 Level Editor Menu Re-org, Part 1
#JIRA UETOOL-3039
#rb Lauren.Barnes
#lockdown Simon.Tourangeau
#preflight 606b8e0315d4190001b1698b

#ROBOMERGE-SOURCE: CL 15924633 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v786-15839533)

[CL 15924652 by louise rasmussen in ue5-main branch]
2021-04-05 19:11:24 -04:00
jamie dale
ea4bbb8f16 Fixed warnings emitted from exporting interfaces to Python
- Only export interface functions if there isn't already a function with this name on the type.
 - Added tests for interfaces, including interface inheritance, and multiple inheritance on an object.

#jira UE-112343, UE-112342
#rb Jurre.deBarre

#ROBOMERGE-SOURCE: CL 15876710 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v786-15839533)

[CL 15876772 by jamie dale in ue5-main branch]
2021-03-31 12:25:01 -04:00
jurre debaare
135dfef6fc Generating functions from inherited UInterfaces when generating glue for Python scripting
#rb Jamie.Dale
#jira none

#ROBOMERGE-SOURCE: CL 15819722 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v785-15821902)

[CL 15823697 by jurre debaare in ue5-main branch]
2021-03-25 10:53:26 -04:00
jamie dale
ae4bb81cc4 Renamed literal UE4 references in PythonScriptPlugin
#jira UE-111113, UE-111234, UE-111238, UE-111115, UE-111118, UE-111144, UE-111225, UE-111135, UE-111209, UE-111240, UE-111197, UE-111127, UE-111244, UE-111139, UE-111156, UE-111202, UE-111153, UE-111211, UE-111215, UE-111218, UE-111121, UE-111132, UE-111123, UE-111228, UE-111178
#rb none
#rnx

#ROBOMERGE-SOURCE: CL 15750502 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v781-15675533)

[CL 15753936 by jamie dale in ue5-main branch]
2021-03-20 04:30:34 -04:00
Marc Audy
0cbbc781ca Merge UE5/Release-Engine-Staging @ 15740152 to UE5/Main
This represents UE4/Main @ 15709114

[CL 15740605 by Marc Audy in ue5-main branch]
2021-03-18 15:20:03 -04:00
Tim Smith
a2237e050d LiveCoding Re-instancing
LIMITATIONS:

1) Re-instancing will only update UClass instance data.
2) Adding and removing properties should only be done towards the end of a class or structure and can not be followed by complex data types.
3) Adding and removing properties from a base class should not be done if a derived class contains complex data types.

KNOWN ISSUES:

1) Changes to enumerations and structures will not be reflected in existing blueprints.  However, adding new nodes to the blueprint will show the updated enumeration or structure.
2) If a class contains an enumeration or structure as a member, the class will not be re-instanced if enumeration or structure is changed.

CHANGES:

1) LiveCodingServer
1a) Modified to always execute certain static instances during load.
1b) Modified to exclude the _Statics static structures to avoid patching to old copies.

2) Added support for LiveCoding reinstancing
2a) Refactored deferred registration system for UClass, UEnum, and UScriptStruct to use a common system that works for normal game, hot reload and live coding.
2b) Type specific version check data is possible (i.e. enum doesn't have a size)
2c) Single registration static for UClass
2d) Single registration class for all types that is just a blind forward to API.
2e) Static and dynamic registrations use different API entry points to avoid having overloaded argument lists that just apply to one or the other.
2f) Shims for older API

3) New common "Reload" system to avoid using HotReload code.
3a) Support common delegates regardless of who is reloading/reinstancing.
3b) Re-instancing code moved from HotReload to Kismet2 (where the bulk of the re-instance code already existed).
3c) Modified PyWrapper to use new helper class instead of depending on HotRelaod
3d) Added WITH_RELOAD which is defined if HotReload or LiveCoding is enabled.
3e) Modifed existing code to use new #define and delegates.

Robert did the review on the changes covered by Part 2.  Remaining changes are all straightforward.

#rb robert.manuszewski
#jira UE-74493

[CL 15736777 by Tim Smith in ue5-main branch]
2021-03-18 08:13:59 -04:00
paul chipchase
2f83d98619 Add an overload to the /= operator for FString that is compatible with FStringView/TStringBuilder/FString and removed the FString specific /= operator.
- To maintain backwards compatibility an overload for non TCHAR raw string types has also been added which will be converted to the correct format via a temp FString first.
  - Fixed cases of Fstring /= char* found in AndroidPlatformFile.cpp and PythonScriptPluginPreload.cpp
- Added unit tests for the /= operator when passing in TCHAR*, ANSICHAR*, FString, FStringView and TStringBuilder in various forms.
- Changed GetNumfor TStringBuilderBase to return int32 (which is what TStringBuilderBase::Len() returns anyway) rather than SIZE_T to prevent compiler warnings about casting types.

#rb Steve.Robb

[CL 15674959 by paul chipchase in ue5-main branch]
2021-03-11 04:03:02 -04:00
jamie dale
7d4b261557 Pre-cache the available on-disk Unreal Python modules
This can save 1-2s during Python initialization, by removing repeated calls to FileExists for everything on sys.path.

It does limit Unreal Python modules to being stored within the root of a known Content/Python directory, however this limitation is in-line with all existing modules that ship with the Engine, and allows us to avoid the cost of recursively scanning for modules.

#rb Rex.Hill

#ROBOMERGE-SOURCE: CL 15594550 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v777-15581079)

[CL 15594583 by jamie dale in ue5-main branch]
2021-03-03 21:13:48 -04:00
Marc Audy
9753392e2b Merge UE5/RES CL# 15462083 to UE5/Main
This represents UE4/Main @ 15414221

[CL 15463811 by Marc Audy in ue5-main branch]
2021-02-18 18:13:28 -04:00
jamie dale
18ce6ceb65 Fixed Python shutdown crash when Slate callbacks are bound
Slate can shutdown prior to the Python plugin, which means it can clear an array of delegates (which may contain captured Python objects) without taking the Python GIL. TPyAutoGILPtr has been added as a way to capture Python instances that will safely take the GIL during copy, move, or destruction operations.

#rb Patrick.Laflamme

#ROBOMERGE-SOURCE: CL 15366274 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15368939 by jamie dale in ue5-main branch]
2021-02-09 15:03:10 -04:00
Devin Doucette
1d2f2a5d1f Fixed string usage issues found by UE_NODISCARD
#rb trivial
#rnx

[CL 15161974 by Devin Doucette in ue5-main branch]
2021-01-21 23:53:05 -04:00
Marc Audy
bc88b73a29 Merge Release-Engine-Staging to Main @ CL# 15151250
Represents UE4/Main @ 15133763

[CL 15158774 by Marc Audy in ue5-main branch]
2021-01-21 16:22:06 -04:00
Jurre deBaare
afc4f39522 Ensure that blueprint actions are cleared for to-be reinstanced Python UClasses
#jira none
#rb Jamie.Dale

[CL 15084614 by Jurre deBaare in ue5-main branch]
2021-01-14 11:33:45 -04:00
Jamie Dale
b1aecb6f97 Merging PythonScriptPlugin from //UE5/Release-Engine-Staging to Main (//UE5/Main)
#jira
#rb Marc.Audy
#rnx

[CL 15045368 by Jamie Dale in ue5-main branch]
2021-01-11 20:04:00 -04:00
Marc Audy
68150e0be7 Merge UE5/Release-Engine-Staging to UE5/Main @ 14611496
This represents UE4/Main @ 14594913

[CL 14612291 by Marc Audy in ue5-main branch]
2020-10-29 13:38:15 -04:00
Marc Audy
4c1bb11c29 Merge UE5/Release-Engine-Staging to UE5/Main @ 14548662
This represents UE4/Main @ 14525125 + cherrypicked fixes
#skipundocheck

[CL 14551026 by Marc Audy in ue5-main branch]
2020-10-22 19:19:16 -04:00
Marcus Wassmer
3b81cf8201 Merging using //UE5/Main_to_//UE5/Release-Engine-Staging @14384769
autoresolved files
#rb none

[CL 14384911 by Marcus Wassmer in ue5-main branch]
2020-09-24 00:43:27 -04:00
Marc Audy
7379fa99c5 Merging //UE5/Release-Engine-Staging to Main (//UE5/Main) @ 14229157
[CL 14233282 by Marc Audy in ue5-main branch]
2020-09-01 14:07:48 -04:00