255 Commits

Author SHA1 Message Date
zhikang shao
7404e83db3 Reverting blueprint editor shortcut Alt+Shift+F to search locally by mapping it to the singular Find References action. The singular Find References action, while not exposed to UI for nodes that have Find References By Name/Class Member support, can still be triggered with shortcut and will trigger a local By Name or By Class Member search based on what the previous behavior was for that node type. For function nodes it will search by function name, while for variable nodes it will do an exact search since Find References already did that for a while.
However: function searches will do a quoted search by native function name. The previous behavior was unquoted search by node title (usually function display name). As a result, the previous behavior for Find References would fail in functions with special characters in their name. Now that the name is surrounded in quotes, all function names are supported. The new Find References behavior now searches for correct function name for parent call nodes, interface implementations, event overrides, where the previous behavior failed due to searching for node title.
#rb Phillip.Kavan

[CL 30856744 by zhikang shao in 5.4 branch]
2024-01-24 14:33:15 -05:00
dave jones2
73d6c12907 Deprecated bIsBeadFunction.
This was a really old feature that never took off. It's not needed anymore.

#rb dan.oconnor

[CL 30718919 by dave jones2 in ue5-main branch]
2024-01-19 12:19:18 -05:00
graham matuszewski
7061b1ccc0 Allow for UObject Macro Libraries to use functions that require a world context.
If a UObject MacroLibrary goes to use a function that requires a world context then it will show the input pin for the world context just like it would if it were a blueprint function library.
The input pin for the WorldContext can be manually provided by the user by dragging the right reference and passing that into the Macro, but the Macro will also just auto grab the world from the caller if they have a valid world context. if they do not have a valid world context, then an error will be shown in the called at compile time.

#jira UE-203743 UE-22946
#rb dan.oconnor

[CL 30643242 by graham matuszewski in ue5-main branch]
2024-01-16 15:35:24 -05:00
zhikang shao
81750f0a27 Finding References By Name on event nodes (K2Node_Event) and function call nodes (K2Node_CallFunction) now consistently searches by native name, rather than friendly name in some cases. Additionally, K2Node_CreateDelegate appends metadata so it can be found when searching for the referenced function if it's a class member.
#rb Phillip.Kavan

[CL 30593990 by zhikang shao in ue5-main branch]
2024-01-12 10:56:49 -05:00
zhikang shao
5a4f3dadcf #jira UE-196209
Improves "Find References" in blueprints: now supports function search by [class, function] call-sites and definitions rather than a generic search for function name. Replaces the "Find References" context menu action with a sub-menu for variables and functions in BlueprintEditor, WidgetBlueprintEditor, SubobjectEditor and SubobjectEditor. That context sub-menu has 'By Name' and 'By Class Member' search options and local+global versions of both.

Made changes to Find-in-Blueprints metadata that is generated per blueprint asset to be able to do "specific function of a specific class" type queries; some search types were unsupported with previous metadata. Incremented the EFiBVersion so that the Find-in-Blueprints search window will ask to re-index all blueprints and resave. Added an opt-out editor setting "Allow Index All Blueprints" (default: true) to disable the button, which can be decided per project. Added an action in the Find-in-Blueprints modal when outdated metadata is detected to export the list of affected assets.
#rb Phillip.Kavan

[CL 30316851 by zhikang shao in ue5-main branch]
2023-12-14 06:34:39 -05:00
zhikang shao
15c016080d [Backout] - CL30289707
[FYI] zhikang.shao
Original CL Desc
-----------------------------------------------------------------
#jira UE-196209
Improves "Find References" in blueprints: now supports function search by [class, function] call-sites and definitions rather than a generic search for function name. Replaces the "Find References" context menu action with a sub-menu for variables and functions in BlueprintEditor, WidgetBlueprintEditor, SubobjectEditor and SubobjectEditor. That context sub-menu has 'By Name' and 'By Class Member' search options and local+global versions of both.

Made changes to Find-in-Blueprints metadata that is generated per blueprint asset to be able to do "specific function of a specific class" type queries; some search types were unsupported with previous metadata. Incremented the EFiBVersion so that the Find-in-Blueprints search window will ask to re-index all blueprints and resave. Added an opt-out editor setting "Allow Index All Blueprints" (default: true) to disable the button, which can be decided per project. Added an action in the Find-in-Blueprints modal when outdated metadata is detected to export the list of affected assets.
#rb Phillip.Kavan

[CL 30289794 by zhikang shao in ue5-main branch]
2023-12-13 07:33:50 -05:00
zhikang shao
68c300ecfa #jira UE-196209
Improves "Find References" in blueprints: now supports function search by [class, function] call-sites and definitions rather than a generic search for function name. Replaces the "Find References" context menu action with a sub-menu for variables and functions in BlueprintEditor, WidgetBlueprintEditor, SubobjectEditor and SubobjectEditor. That context sub-menu has 'By Name' and 'By Class Member' search options and local+global versions of both.

Made changes to Find-in-Blueprints metadata that is generated per blueprint asset to be able to do "specific function of a specific class" type queries; some search types were unsupported with previous metadata. Incremented the EFiBVersion so that the Find-in-Blueprints search window will ask to re-index all blueprints and resave. Added an opt-out editor setting "Allow Index All Blueprints" (default: true) to disable the button, which can be decided per project. Added an action in the Find-in-Blueprints modal when outdated metadata is detected to export the list of affected assets.
#rb Phillip.Kavan

[CL 30289718 by zhikang shao in ue5-main branch]
2023-12-13 07:25:05 -05:00
BenVlodgi
dc8638aa85 [Backout] - CL29362886
[FYI] zhikang.shao
Original CL Desc
-----------------------------------------------------------------
PR #9602 Property meta specifier DeterminesOutputType now works with Soft Object and Soft Class Paths
#jira UE-165025
#rb zhikang.shao

[CL 29424609 by BenVlodgi in ue5-main branch]
2023-11-03 17:49:37 -04:00
BenVlodgi
5f58adcf4f PR #9602 Property meta specifier DeterminesOutputType now works with Soft Object and Soft Class Paths
#jira UE-165025
#rb zhikang.shao

[CL 29362899 by BenVlodgi in ue5-main branch]
2023-11-02 09:40:23 -04:00
BenVlodgi
820acbb7d5 [Backout] - CL29362360
[FYI] zhikang.shao
Original CL Desc
-----------------------------------------------------------------
PR #9602 Property meta specifier DeterminesOutputType now works with Soft Object and Soft Class Paths
#jira UE-165025
#rb zhikang.shao

[CL 29362650 by BenVlodgi in ue5-main branch]
2023-11-02 09:32:35 -04:00
BenVlodgi
2f41e3afba PR #9602 Property meta specifier DeterminesOutputType now works with Soft Object and Soft Class Paths
#jira UE-165025
#rb zhikang.shao

[CL 29362381 by BenVlodgi in ue5-main branch]
2023-11-02 09:24:52 -04:00
dave jones2
e203cea604 UE-183502 - BP autoconversion adds extraneous conversion nodes (resubmit)
(Resubmit: added check for "multiple self" connections. Even though the types mismatch, we permit these connections.)

The previous attempt to add automatic conversion nodes (24029327) had a flawed design: checking pin connections during rewiring might have an incomplete view of the types of the linked pins.

For example, suppose we have two native, BlueprintCallable functions. One returns a float, and the other accepts a single float. In a Blueprint, we have the output of one linked to the input of the other.

Later, we update both functions to use ints. During rewiring of the function with the return value, it might see that its connection is a float (because that node hasn't been rewired yet). As a result, it'll insert a cast node. Subsequently, when we later rewire the function with the input, it'll see that it's connected to a float, because of the recently inserted cast node. This will add yet another cast node. Since both pin types are the same, there shouldn't be any cast nodes to begin with.

The only safe way to insert cast nodes is after node construction has finished. Instead of handling this during rewiring, we can defer the type checking to early validation. Overall, this simplifies the autoconversion since we just need to iterate over pairs of pins, check for type mismatches, and insert cast nodes where appropriate.

This change effectively reverts CLs 24174262, 24029327, 24218437, and 25444139, and moves the type checking logic to EarlyValidation.

#jira UE-183502
#rb phillip.kavan

[CL 25834276 by dave jones2 in ue5-main branch]
2023-06-06 21:17:28 -04:00
dan oconnor
ab70c4393b Automatically create ref terms for BP functions, this makes it easier to toggle a blueprint paramter to pass by reference
#preflight 6479399e947ff6973c60580f
#rb Phillip.Kavan, Dave.Jones
#jira UE-54695

[CL 25770430 by dan oconnor in ue5-main branch]
2023-06-02 15:10:08 -04:00
bob tellez
89ca3b4813 [Backout] - CL25727793
[FYI] dave.jones2
Original CL Desc
-----------------------------------------------------------------
UE-183502 - BP autoconversion adds extraneous conversion nodes

The previous attempt to add automatic conversion nodes (24029327) had a flawed design: checking pin connections during rewiring might have an incomplete view of the types of the linked pins.

For example, suppose we have two native, BlueprintCallable functions. One returns a float, and the other accepts a single float. In a Blueprint, we have the output of one linked to the input of the other.

Later, we update both functions to use ints. During rewiring of the function with the return value, it might see that its connection is a float (because that node hasn't been rewired yet). As a result, it'll insert a cast node. Subsequently, when we later rewire the function with the input, it'll see that it's connected to a float, because of the recently inserted cast node. This will add yet another cast node. Since both pin types are the same, there shouldn't be any cast nodes to begin with.

The only safe way to insert cast nodes is after node construction has finished. Instead of handling this during rewiring, we can defer the type checking to early validation. Overall, this simplifies the autoconversion since we just need to iterate over pairs of pins, check for type mismatches, and insert cast nodes where appropriate.

This change effectively reverts CLs 24174262, 24029327, 24218437, and 25444139, and moves the type checking logic to EarlyValidation.

#jira UE-183502
#preflight 647102108145a219b1209905
#rb phillip.kavan

[CL 25748352 by bob tellez in ue5-main branch]
2023-06-01 19:38:24 -04:00
dave jones2
58bc468b87 UE-183502 - BP autoconversion adds extraneous conversion nodes
The previous attempt to add automatic conversion nodes (24029327) had a flawed design: checking pin connections during rewiring might have an incomplete view of the types of the linked pins.

For example, suppose we have two native, BlueprintCallable functions. One returns a float, and the other accepts a single float. In a Blueprint, we have the output of one linked to the input of the other.

Later, we update both functions to use ints. During rewiring of the function with the return value, it might see that its connection is a float (because that node hasn't been rewired yet). As a result, it'll insert a cast node. Subsequently, when we later rewire the function with the input, it'll see that it's connected to a float, because of the recently inserted cast node. This will add yet another cast node. Since both pin types are the same, there shouldn't be any cast nodes to begin with.

The only safe way to insert cast nodes is after node construction has finished. Instead of handling this during rewiring, we can defer the type checking to early validation. Overall, this simplifies the autoconversion since we just need to iterate over pairs of pins, check for type mismatches, and insert cast nodes where appropriate.

This change effectively reverts CLs 24174262, 24029327, 24218437, and 25444139, and moves the type checking logic to EarlyValidation.

#jira UE-183502
#preflight 647102108145a219b1209905
#rb phillip.kavan

[CL 25727812 by dave jones2 in ue5-main branch]
2023-06-01 11:29:35 -04:00
kirill zorin
de8db5ff76 Converting ARO-facing raw pointers to TObjectPtr ahead of raw pointer ARO API deprecation.
#rb zousar.shaker
#rb markus.breyer
#rb robert.manuszewski

#preflight 646391406b1406b54ab15460

[CL 25489627 by kirill zorin in ue5-main branch]
2023-05-16 10:52:49 -04:00
dave jones2
a507e74364 UE-97716 - Private and Protected functions do not display in the context menu in child BPs (resubmit)
We need the classes used by the target function and the graph to be consistent. Specifically, we could run into scenarios where the TargetFunction would be the skeleton class and *not* the generated class. This would cause subsequent IsChildOf usage in CanFunctionBeUsedInGraph to fail, since they're technically two different classes.

In this case, if the target function comes from a BP, we can explicitly use the skeleton classes from both to remove any ambiguity.

#jira UE-97716
#preflight 64234b57974dfaa53c0e2a89
#rb phillip.kavan

[CL 24826011 by dave jones2 in ue5-main branch]
2023-03-28 16:31:43 -04:00
dave jones2
1cb8f70086 [Backout] - CL24692954
#fyi dave.jones2
Original CL Desc
-----------------------------------------------------------------
UE-97716 - Private and Protected functions do not display in the context menu in child BPs

We need the classes used by the target function and the graph to be consistent. Specifically, we could run into scenarios where the TargetFunction would be the skeleton class and *not* the generated class. This would cause subsequent IsChildOf usage in CanFunctionBeUsedInGraph to fail, since they're technically two different classes.

In this case, we can explicitly use the skeleton classes from both to remove any ambiguity.

#jira UE-97716
#preflight 64149a73ca2afe3ee6a48565
#rb phillip.kavan

[CL 24719137 by dave jones2 in ue5-main branch]
2023-03-20 13:13:49 -04:00
dave jones2
8934712126 UE-97716 - Private and Protected functions do not display in the context menu in child BPs
We need the classes used by the target function and the graph to be consistent. Specifically, we could run into scenarios where the TargetFunction would be the skeleton class and *not* the generated class. This would cause subsequent IsChildOf usage in CanFunctionBeUsedInGraph to fail, since they're technically two different classes.

In this case, we can explicitly use the skeleton classes from both to remove any ambiguity.

#jira UE-97716
#preflight 64149a73ca2afe3ee6a48565
#rb phillip.kavan

[CL 24692954 by dave jones2 in ue5-main branch]
2023-03-17 14:19:42 -04:00
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