Commit Graph

236 Commits

Author SHA1 Message Date
phillip kavan
f74451e319 Generated Blueprint skeleton class functions will no longer parent themselves to interface class functions in the fast path, while also ensuring backwards-compatibility for existing call sites to implemented interface functions.
Notes:
- See 24252017 for additional context/review notes. The original change was backed out due to not handling mismatched object->object pin contexts on existing function call nodes (rare), so this version adds that part. An A/B screenshot is attached to the latest swarm review.

#rnx
#jira UE-157527
#rb Dave.Jones2
#preflight 63e75b9e043416e7ad4699b3

[CL 24315905 by phillip kavan in ue5-main branch]
2023-02-20 11:42:54 -05:00
Phillip Kavan
b95ab41921 Allow self pins that redirect from interface->object type to pass without explicitly inserting an auto-conversion node during reconstruction of function call nodes.
Notes:
- This change is part of an upcoming regression fix (UE-157527) that will merge in from another stream that doesn't yet include type redirect support (UE-172222).

#rnx
#jira UE-157527, UE-172222
#rb Dave.Jones2
#preflight 63eb3afdf36e1a5ece5311a8

[CL 24218437 by Phillip Kavan in ue5-main branch]
2023-02-14 14:42:38 -05:00
Phillip Kavan
f047dfebd4 Restore changes lost in a merge from the intermediate release stream.
#rnx
#jira none
#rb Dave.Jones2
#preflight 63e3d882e042058d69945f60

[CL 24075990 by Phillip Kavan in ue5-main branch]
2023-02-08 12:58:07 -05:00
bob tellez
096493d9a4 [Backout] - CL24063026
[FYI] Phillip.Kavan
Original CL Desc
-----------------------------------------------------------------
Generated Blueprint skeleton class functions will no longer parent themselves to interface class functions in the fast path, while also ensuring backwards-compatibility for existing call sites to implemented interface functions.

Epidemiology:
- There was a regression introduced with the change to BPCM in 4.17 which started causing all newly-placed function call nodes to use the interface class as the Target pin type, rather than the 'self' type.
- However, the compiled function context was still inferred as the 'self' type, which resulted in emitting to bytecode only EX_Context w/o the required EX_InterfaceContext.
- This meant at runtime the VM would read an FScriptInterface value (16 bytes) into a UObject* ptr value (8 bytes) allocated on the stack (execContext), which caused a stack overrun (recently surfaced by ASAN).
- That regression is now fixed in the BPCM, however..
- Since we also allow object->interface connections to pass w/o casting when the object type implements the interface, this appeared to work the same as before the regression from a user perspective. However, it created an inconsistency for Target pin types that led to some odd UX; for example, if you choose to no longer implement the interface, now you might have a local function call site w/ an interface-typed Target pin that you can no longer connect self to/broken connection.
- Fixing the BPCM issue also meant that Target pins reverted back to 'self' object type on existing nodes, which caused a backcompat issue from being linked to interface pins (as that requires an interface->object conversion and will fail validation).
- Fixing that *seemed* relatively straightforward; I added a bit of code to modify the node expansion to spawn an intermediate cast node. However..
- Discovered that dynamic cast nodes had an issue where ones we dropped as an autocast via TryCreateConnection() would not be pure (i.e. no exec pins) even though it was explicitly being set in the autocast logic.
- This meant that any intermediate autocast nodes for interface->self end up being dropped as impure, with no connection to the exec pins, so they would end up being pruned at compile time. (this problem was due to another regression that traced back a long long ways..it was introduced in UE 4.6).
- Fixing that required a change to the way in which Dynamic Cast nodes manage the internal pure/impure state (since it can be toggled by the user, and it also has a default setting for new nodes).
- After fixing that, existing connections now continue to work (including previously-connected interface array outputs), while dragging new connections from interface->self will now add an explicit autocast node.
- An additional fix was made to prevent users from connecting an array of interfaces output to a function call node's Target pin for new connections (existing connections will continue to function per above).
--> Since call nodes support a ForEach-style expansion, the array connection was being allowed to pass, but then it would try to add an autocast node as if it were a scalar type, which doesn't support the expansion, so it could not be connected (broken UX).

#jira UE-157527
#rb Dave.Jones2, Dan.OConnor, Ben.Zeigler, Marc.Audy
#preflight 63dd78f4cc75b137677aaa32

[CL 24067070 by bob tellez in ue5-main branch]
2023-02-08 00:27:06 -05:00
phillip kavan
3981030897 Generated Blueprint skeleton class functions will no longer parent themselves to interface class functions in the fast path, while also ensuring backwards-compatibility for existing call sites to implemented interface functions.
Epidemiology:
- There was a regression introduced with the change to BPCM in 4.17 which started causing all newly-placed function call nodes to use the interface class as the Target pin type, rather than the 'self' type.
- However, the compiled function context was still inferred as the 'self' type, which resulted in emitting to bytecode only EX_Context w/o the required EX_InterfaceContext.
- This meant at runtime the VM would read an FScriptInterface value (16 bytes) into a UObject* ptr value (8 bytes) allocated on the stack (execContext), which caused a stack overrun (recently surfaced by ASAN).
- That regression is now fixed in the BPCM, however..
- Since we also allow object->interface connections to pass w/o casting when the object type implements the interface, this appeared to work the same as before the regression from a user perspective. However, it created an inconsistency for Target pin types that led to some odd UX; for example, if you choose to no longer implement the interface, now you might have a local function call site w/ an interface-typed Target pin that you can no longer connect self to/broken connection.
- Fixing the BPCM issue also meant that Target pins reverted back to 'self' object type on existing nodes, which caused a backcompat issue from being linked to interface pins (as that requires an interface->object conversion and will fail validation).
- Fixing that *seemed* relatively straightforward; I added a bit of code to modify the node expansion to spawn an intermediate cast node. However..
- Discovered that dynamic cast nodes had an issue where ones we dropped as an autocast via TryCreateConnection() would not be pure (i.e. no exec pins) even though it was explicitly being set in the autocast logic.
- This meant that any intermediate autocast nodes for interface->self end up being dropped as impure, with no connection to the exec pins, so they would end up being pruned at compile time. (this problem was due to another regression that traced back a long long ways..it was introduced in UE 4.6).
- Fixing that required a change to the way in which Dynamic Cast nodes manage the internal pure/impure state (since it can be toggled by the user, and it also has a default setting for new nodes).
- After fixing that, existing connections now continue to work (including previously-connected interface array outputs), while dragging new connections from interface->self will now add an explicit autocast node.
- An additional fix was made to prevent users from connecting an array of interfaces output to a function call node's Target pin for new connections (existing connections will continue to function per above).
--> Since call nodes support a ForEach-style expansion, the array connection was being allowed to pass, but then it would try to add an autocast node as if it were a scalar type, which doesn't support the expansion, so it could not be connected (broken UX).

#jira UE-157527
#rb Dave.Jones2, Dan.OConnor, Ben.Zeigler, Marc.Audy
#preflight 63dd78f4cc75b137677aaa32

[CL 24067044 by phillip kavan in ue5-main branch]
2023-02-08 00:26:29 -05:00
dave jones2
b7c2f7da6b UE-174107 - ExpandEnumAsExecs always uses first Exec if an argument name matches Enum value (resubmit)
ExpandEnumAsExecs was using an ambiguous pin lookup. These types of function nodes add additional exec pins that are named after the enumerators. If the target pin specified by ExpandEnumAsExecs happens to have the same name as an enumerator value, then we'll end up with the wrong pin if the basic FindPin function is used.

Instead, we prefer using FindPinByPredicate to specify the exact pin that we're interested in. This ensures that the expansion step creates a SwitchEnum node with a valid UEnum object.

#jira UE-174107
#preflight 63d9b16e65738ba9510f7d1e
#rb phillip.kavan

[CL 23983965 by dave jones2 in ue5-main branch]
2023-02-02 18:37:32 -05:00
dave jones2
09cf3e3cdc Fixed missing subobject category values for object pins.
In certain cases, non-self object pins have been serialized with null subobject category values. The root cause is due to how UEdGraphSchema_K2::GetPropertyCategoryInfo assigns UClass values. In rare cases, the UClass will be the skeleton class, which is transient, and leads to the null subobject category.

The fix simply modifies GetPropertyCategoryInfo to grab the authoritative class instead. Currently, this issue has only shown up in CallFunction nodes. If older content has this issue, then we'll assign the function's parent class as the subobject.

In a future change, type checking of pins will be a little stricter, so we need to ensure that objects are in a valid state for rewiring to work correctly.

#jira none
#preflight 63d406785428dc67b150f933
#rb dan.oconnor, phillip.kavan

[CL 23907462 by dave jones2 in ue5-main branch]
2023-01-30 10:22:36 -05:00
dave jones2
8c03f1eba6 Apparently, ExpandEnumAsExecs and ExpandBoolAsExecs have some overlap, and this change was a bit too restrictive for the latter case. This ended up causing a pin lookup to fail in Lyra.
[Backout] - CL23820159
#fyi dave.jones2
Original CL Desc
-----------------------------------------------------------------
UE-174107 - ExpandEnumAsExecs always uses first Exec if an argument name matches Enum value

ExpandEnumAsExecs was using an ambiguous pin lookup. These types of function nodes add additional exec pins that are named after the enumerators. If the target pin specified by ExpandEnumAsExecs happens to have the same name as an enumerator value, then we'll end up with the wrong pin if the basic FindPin function is used.

Instead, we prefer using FindPinByPredicate to specify the exact pin that we're interested in. This ensures that the expansion step creates a SwitchEnum node with a valid UEnum object.

#jira UE-174107
#preflight 63cb0789fa290562c1c8b6b2
#rb phillip.kavan

[CL 23859234 by dave jones2 in ue5-main branch]
2023-01-25 18:05:06 -05:00
dave jones2
4e220f07a4 UE-174107 - ExpandEnumAsExecs always uses first Exec if an argument name matches Enum value
ExpandEnumAsExecs was using an ambiguous pin lookup. These types of function nodes add additional exec pins that are named after the enumerators. If the target pin specified by ExpandEnumAsExecs happens to have the same name as an enumerator value, then we'll end up with the wrong pin if the basic FindPin function is used.

Instead, we prefer using FindPinByPredicate to specify the exact pin that we're interested in. This ensures that the expansion step creates a SwitchEnum node with a valid UEnum object.

#jira UE-174107
#preflight 63cb0789fa290562c1c8b6b2
#rb phillip.kavan

[CL 23820159 by dave jones2 in ue5-main branch]
2023-01-23 15:11:21 -05:00
nate strohmyer
5be9b3e803 Fixing horde warning for latent BP tooltips
#Jira none
#rb none
#preflight skip
#rnx

[CL 23774494 by nate strohmyer in ue5-main branch]
2023-01-19 11:23:41 -05:00
nate strohmyer
6741c13774 Making latent BPs more descriptive in Tooltips
Adding Latent BP info to aync task nodes

#Jira UE-172965, UE-172960
#rb dan.oconnor
#preflight 63bda40ec45a2c81e013dd70

[CL 23759334 by nate strohmyer in ue5-main branch]
2023-01-18 12:53:59 -05:00
dan oconnor
ed1ffa4216 Add UPARAM(Required) markup for marking function parameters as required (must be linked to some other node in a Blueprint) - example usage:
UFUNCTION(BlueprintCallable)
static void TestRequiredIntParameter(UPARAM(Required) int32 Value);

Useful for marking pointer params as required so they are not null by default, but also applicable to complex types with custom make nodes

#jira
#rb Jordan.Hoffmann
#preflight 63b89fff763c6c10645b94c4

[CL 23604737 by dan oconnor in ue5-main branch]
2023-01-06 17:49:02 -05:00
dan oconnor
7257cdb204 Fix loctext key collision
#rb trivial
#rnx
#jira
#preflight

[CL 23259022 by dan oconnor in ue5-main branch]
2022-11-24 09:54:20 -05:00
dan oconnor
33f2e4e3d0 Improve tooltip on function call nodes when a function cannot be resolved
#jira
#rb Jordan.Hoffmann
#preflight 6376e008f514e1ded97c3a97

[CL 23203556 by dan oconnor in ue5-main branch]
2022-11-18 15:31:52 -05:00
henrik karlsson
4a5e13525d Fixed non-unity non-pch compile errors
#preflight skipped
#rb none

[CL 22788359 by henrik karlsson in ue5-main branch]
2022-10-26 16:22:34 -04:00
benjamin fox
afdf0e750d Fix conflicting LOCTEXT keys
#jira UE-161692
#rb trivial
#preflight skip

[CL 21509489 by benjamin fox in ue5-main branch]
2022-08-23 11:48:15 -04:00
benjamin fox
0d7969323a Improve UX of Suppressed Deprecation Messages
#jira UE-160751
#jira UE-160753
#rb trivial
#preflight skip

[CL 21496738 by benjamin fox in ue5-main branch]
2022-08-22 18:45:26 -04:00
benjamin fox
9560c093d9 Allow users to supress BP compiler deprecation warnings for specific properties or functions via project settings
#jira UE-160577
#preflight 62f2b7df3f500fb6dcfa7513
#preflight 62f2bceaf75a2a539c44a908
#rb marc.audy
#fyi kriss.gossart

[CL 21321899 by benjamin fox in ue5-main branch]
2022-08-10 13:41:00 -04:00
jordan hoffmann
0e53056bc6 Clang now optimizes away this==nullptr. Calls to IsChildOf from a null UObject pointer will cause undefined behavior. This is a retroactive attempt to pad potentially dangerous calls to IsChildOf with a null check in the following directories:
- Plugins/BlueprintContext
- Editor/GlueprintGraph
- Editor/GraphEditor
- Editor/Kismet
- Editor/KismetCompiler
- Editor/UnrealEd/Private/Kismet2

note: if you're seeing this CL in the perforce history because you're trying to figure out why there's a null check that doesn't make sense, This is why. The goal of this CL is to preserve the behavior before IsChildOf changed rather than analyze whether that behavior makes sense. Use your best judgement

#rb marc.audy
#preflight 6299023a6438e3c731307a69

[CL 20474984 by jordan hoffmann in ue5-main branch]
2022-06-02 16:09:18 -04:00
Marc Audy
05b673d3df Avoid crash because this == null no longer works on Linux
#jira UE-154807
#rb Ben.Hoffman
#rnx
#preflight trivial

[CL 20456730 by Marc Audy in ue5-main branch]
2022-06-01 15:04:18 -04:00
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
dave belanger
4b72e06fd5 Disable code navigation when C++ is not allowed in the editor
#rb Rex.Hill
#preflight 6202c1f2e85c7a08bbf3987b

#ROBOMERGE-OWNER: dave.belanger
#ROBOMERGE-AUTHOR: dave.belanger
#ROBOMERGE-SOURCE: CL 18918552 via CL 18918618 via CL 18918624 via CL 18918631 via CL 18922663 via CL 18923570
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v916-18915374)

[CL 18923679 by dave belanger in ue5-main branch]
2022-02-09 15:28:22 -05:00
Marc Audy
0c3be2b6ad Merge Release-Engine-Staging to Test @ CL# 18240298
[CL 18241953 by Marc Audy in ue5-release-engine-test branch]
2021-11-18 14:37:34 -05:00
ben zeigler
990532199d #jira UE-69931 Fix blueprint context menu to not penalize one-word function names like Delay by excluding them from the keywords
Adjust weights a bit to prioritize starts of words more

#ROBOMERGE-SOURCE: CL 17376142 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)

[CL 17376157 by ben zeigler in ue5-release-engine-test branch]
2021-08-31 15:50:18 -04:00
jordan hoffmann
347cbc497e Feature: Move breakpoint storage out of the uasset file
Description: Make it so breakpoints are saved in the EditorPerProjectUserSettings ini rather than blueprint uasset files so that they can be excluded from version control and be unique to the user

#jira UE-119540
#rb Ben.Zeigler

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

[CL 16959625 by jordan hoffmann in ue5-release-engine-test branch]
2021-07-26 15:05:16 -04:00