Commit Graph

145 Commits

Author SHA1 Message Date
Jamie Dale
47d89a1e16 Added a Blueprint node for calling Python with args
This allows people to create a Blueprint node that can define a blob of literal Python script, along with wildcard inputs and outputs to be used by the script itself.

The node takes care of marshalling data in and out of the Python script, and allows people to invoke custom Python from Blueprints without relying on Python generated BPFL types.

#jira UE-84932
#rb Dan.OConnor

[CL 10421545 by Jamie Dale in Dev-Editor branch]
2019-11-25 14:20:28 -05:00
Jamie Dale
b266566090 Clean-up native module references when shutting down Python
#rb Rex.Hill

[CL 10355258 by Jamie Dale in Dev-Editor branch]
2019-11-21 14:55:43 -05:00
Jamie Dale
da52d61658 PySlate now checks that FSlateApplication is available rather than crashing
#rb Rex.Hill

[CL 10349283 by Jamie Dale in Dev-Editor branch]
2019-11-21 14:10:27 -05:00
Jamie Dale
6d5ffe9fa3 Implemented set_editor_properties for Python wrapped structs
This will attempt to notify the nearest object in the Python owner context stack, and is otherwise identical to the implementation for wrapped objects (see 10265342).

#rb Lauren.Barnes
#rnx

[CL 10343893 by Jamie Dale in Dev-Editor branch]
2019-11-21 13:32:25 -05:00
Jamie Dale
fa47fcdea1 Added a way to force a change notify when using SetEditorProperty in Python or Editor Utilities, even if the value is unchanged
This may be needed if you've edited data on an instance indirectly (eg, modifying an array reference on the object), and need to force a change notification to update some dependent data.

In Python, this can be done by passing unreal.PropertyAccessChangeNotifyMode.ALWAYS as the notify_mode argument to set_editor_property.
In Editor Utilities, there is a new advanced pin available for setting the "Change Notify Mode".
In both cases the default method is to notify only when the value actually changes.

This change also significantly simplifies UK2Node_GetEditorProperty and UK2Node_SetEditorProperty by having them derive from UK2Node_CallFunction, rather than being a proxy node that expands to a UK2Node_CallFunction node.

#jira UE-80285
#rb Lauren.Barnes

[CL 10337069 by Jamie Dale in Dev-Editor branch]
2019-11-21 12:12:05 -05:00
Jamie Dale
f1f4f7fcb0 Generate UserDefinedEnum wrappers on-demand if marshalled via Python
This avoids the caller needing to have called unreal.get_blueprint_generated_types(...) for the type before trying to access it.

#rb Lauren.Barnes

[CL 10319031 by Jamie Dale in Dev-Editor branch]
2019-11-20 10:01:08 -05:00
Jamie Dale
29fa4b658e Fixed Python memory leak
#rb none
#rnx

[CL 10267523 by Jamie Dale in Dev-Editor branch]
2019-11-15 16:31:57 -05:00
Jamie Dale
8b807289c3 CIS fix
#rb none
#rnx

[CL 10266585 by Jamie Dale in Dev-Editor branch]
2019-11-15 15:40:51 -05:00
Jamie Dale
de4f7490d3 CIS fix
#rb none
#rnx

[CL 10266516 by Jamie Dale in Dev-Editor branch]
2019-11-15 15:37:02 -05:00
Jamie Dale
e96c641170 Added set_editor_properties to let you set multiple properties which only emit a single pre/post change notification
hism_comp.set_editor_properties({
    'cast_shadow': False,
    'instance_start_cull_distance': 12,
    'instance_end_cull_distance': 23,
    })

#rb Lauren.Barnes

[CL 10265342 by Jamie Dale in Dev-Editor branch]
2019-11-15 14:39:19 -05:00
Jamie Dale
046a164ece Exposed UserDefinedEnum types to Python
This is the first phase of allowing Blueprint types to be generated for Python, which must be accessed via unreal.get_blueprint_generated_types(...) as asset names are not guaranteed to be unique, so they're not added to the unreal module.

Once a type has been generated for Python, it will be updated if the underlying asset is changed. Should the asset be deleted then the Python type will be reset to clean state and become mostly unusable.

This change also ensures that the Unreal type pointers referenced by the Python meta-data are ARO'd correctly. This will cause a warning if you try and delete an asset with a type used by Python.

 MyEnum = unreal.get_blueprint_generated_types('/Game/MyEnum') # This can also accept multiple arguments or a list, and will return a tuple of types
 print(MyEnum.MY_ENTRY)

#jira UE-81862, UE-81859
#rb Lauren.Barnes

[CL 10227467 by Jamie Dale in Dev-Editor branch]
2019-11-14 16:52:43 -05:00
Chris Gagnon
d1973355bc Merge Dev-Tools-Stagng tp Dev-Editor
#rb none

[CL 9961726 by Chris Gagnon in Dev-Editor branch]
2019-11-01 17:39:56 -04:00
Jamie Dale
5904862070 Added PropertyAccessUtil to contain the common logic of getting and setting properties in a way that emits change notifications
The existing Python code has been ported to use this, and this can also be used by Blueprints (or other C++ setting properties) to allow property changes that emit change notifications.

#jira UE-77388
#rb Chris.Gagnon

[CL 9706346 by Jamie Dale in Dev-Editor branch]
2019-10-18 18:51:40 -04:00
Chris Gagnon
5b7e66b1fb Merging //UE4/Dev-Main to Dev-Editor (//UE4/Dev-Editor) to CL 9544902 for stream reparenting.
#rb none

[CL 9671142 by Chris Gagnon in Dev-Editor branch]
2019-10-17 19:44:57 -04:00
Jamie Dale
4c9963fda8 Register enum entries from Python in a deterministic order using their value
#fyi Adric.Worley
#rb none

[CL 9576555 by Jamie Dale in Dev-Editor branch]
2019-10-14 17:44:13 -04:00
Jamie Dale
ba3fd09c24 Remove invalid warning when reinstancing Python generated enum types
#fyi Adric.Worley
#rb none

[CL 9573164 by Jamie Dale in Dev-Editor branch]
2019-10-14 15:13:21 -04:00
Rolando Caloca
1a30325d6f Copying //UE4/Dev-RenderPlat-Staging@9551419 to //UE4/Main
#rb none
#rnx

[CL 9551447 by Rolando Caloca in Main branch]
2019-10-11 15:33:31 -04:00
Jamie Dale
764efecd41 Improved invalid parameter error when passing the incorrect struct type to Python
#rb none

[CL 9493857 by Jamie Dale in Main branch]
2019-10-09 16:59:44 -04:00
Jamie Dale
7ab6307cac Fixed typo when accessing property class type during Python glue validation
#fyi Robert.Manuszewski
#rb Robert.Manuszewski
#rnx

[CL 9489709 by Jamie Dale in Main branch]
2019-10-09 12:40:55 -04:00
Jason Bestimt
a530f72f7d Updating from //UE4/Dev-RenderPlat-Staging to Dev-VR (//UE4/Dev-VR) to turn on robomerge
#RB:none

[CL 9106247 by Jason Bestimt in Dev-VR branch]
2019-09-25 16:05:50 -04:00
ben marsh
e1deccdab4 Fix crash building a monolithic editor executable due to global constructors creating UObject instances before the UObject subsystem has been initialized.
#jira
[FYI] Jamie.Dale


#ROBOMERGE-SOURCE: CL 8988509 via CL 8988522
#ROBOMERGE-BOT: (v441-8974111)

[CL 8991871 by ben marsh in Main branch]
2019-09-23 16:43:24 -04:00
joe conley
dd22bf997f Copying //UE4/Dev-Anim to Dev-Main (//UE4/Dev-Main) [at] 8782600
#rb
#rnx

#ROBOMERGE-OWNER: ryan.vance
#ROBOMERGE-AUTHOR: marc.audy
#ROBOMERGE-SOURCE: CL 8783278 in //UE4/Main/...
#ROBOMERGE-BOT: DEVVR (Main -> Dev-VR) (v427-8887818)

[CL 8891540 by joe conley in Dev-VR branch]
2019-09-19 13:46:18 -04:00
Marc Audy
8df336162c Copying //UE4/Dev-Anim to Dev-Main (//UE4/Dev-Main) @ 8782600
#rb
#rnx

[CL 8783278 by Marc Audy in Main branch]
2019-09-17 19:12:19 -04:00
chris gagnon
5ee508d57f Copying //UE4/Dev-Editor to Dev-Main (//UE4/Dev-Main) Interim 4.24.
#rb none

#ROBOMERGE-OWNER: ryan.vance
#ROBOMERGE-AUTHOR: chris.gagnon
#ROBOMERGE-SOURCE: CL 8614014 in //UE4/Main/...
#ROBOMERGE-BOT: DEVVR (Main -> Dev-VR) (v409-8614070)

[CL 8634524 by chris gagnon in Dev-VR branch]
2019-09-11 08:23:28 -04:00
Chris Gagnon
2e87118a18 Copying //UE4/Dev-Editor to Dev-Main (//UE4/Dev-Main) Interim 4.24.
#rb none

[CL 8614014 by Chris Gagnon in Main branch]
2019-09-10 11:35:20 -04:00