265 Commits

Author SHA1 Message Date
ben zeigler
fc4832b020 Add the ability to set DeprecatedFunction="Note" (and DeprecatedVariable) metadata in C++ to lower the severity of a blueprint deprecation message.
Add a utility function and DeprecatedVariable static name to support this.
Use this to replace an old hack that ignored warnings for BeginSpawningActorFromBlueprint.
#jira UE-160577
#rb dan.oconnor

[CL 36448949 by ben zeigler in 5.5 branch]
2024-09-19 15:54:42 -04:00
dave jones2
64ae24ec12 Removed extraneous GetSelfPin implementations.
Since GetThenPin was added to UK2Node in 5.x, derived classes don't need to provide their own implementations. These were largely identical to the one in UK2Node. Additionally, overriding non-virtual functions can be error prone if there's an expectation of polymorphic behavior.

#rb dan.oconnor, jodon.karlik
#rnx
[FYI] George.Rolfe

[CL 35782464 by dave jones2 in ue5-main branch]
2024-08-23 16:46:50 -04:00
dave jones2
fec5a44899 Added project setting to control toggling of impure Blueprint functions to pure ones (disabled by default).
(Follow up change to CL 35309066)

If enabled, a function that isn't marked as pure can be converted to a pure node in a graph. While this provides flexibility for controlling graph layouts, pure nodes can introduce hidden performance costs. If an impure function is expensive, its conversion to a pure can introduce multiple calls for each connected output. Since Blueprint graphs don't do a great job of visualizing executions of pure nodes, we're defaulting this feature to off. Teams are free to decide if they wish to use it.

Additionally, this will issue a compiler warning if a illegal pure override is discovered in a node. This can occur if a user locally enables the project setting and checks in converted nodes.

#rb ben.hoffman

[CL 35315964 by dave jones2 in ue5-main branch]
2024-08-05 16:09:57 -04:00
dave jones2
c4107f5283 UE-196156 - Add exec toggle for pure nodes
Blueprint pure nodes were initially intended to be similar to "functional pure". In other words, they're deterministic and produce no side effects (eg: doesn't mutate state). However, pure nodes have violated both conditions for a while now.

Instead, pure nodes are simply function nodes with output values and no visible exec pins. While this can be convenient, they come with a downside: the pure node is evaluated for each connected output. This can lead to unexpected performance issues if the node is expensive to evaluate. In the case of non-deterministic nodes, this can lead to unexpected behavior. In both cases, the user often needs to cull multiple outputs of a pure node and cache the result manually.

The solution here is to add support for toggling purity at the call site. When a function node is placed, right-clicking on it and selecting either "Hide Exec pins" or "Show Exec Pins" will toggle purity. Additionally, the meaning of BlueprintPure and the "Pure" check box changes slightly: it now means that the function node _defaults_ to a pure state when placed in a graph. However, it can be toggled to show its exec pins.

In future changes, we'll also reevaluate which common library functions should continue to default as pure.

#jira UE-196156
#rb dan.oconnor, jodon.karlik, ben.zeigler

[CL 35309072 by dave jones2 in ue5-main branch]
2024-08-05 11:58:15 -04:00
jodon karlik
383187026f Removing the usage of "Friendly Names" from the Functions and (Event Graphs/Overrides Menu). This reverts a previous change which introduced consistency to the Friendly Names feature in those windows. The reasoning is that there is a long-term goal of removing Friendly Names entirely from the Editor. It interferes with the users being able to properly name their Functions/Events and have that name consistent through the interface. I have kept the Friendly Names when *calling* a function in Blueprints as well as the Blueprints Action list. The reasoning behind that is the nodes are very hard to decipher when zoomed out on the graph unless there are spaces between the names.
#jira UE-220228
#rb ben.hoffman
[FYI] will.strohmeyer

[CL 35120419 by jodon karlik in ue5-main branch]
2024-07-26 17:29:30 -04:00
dan oconnor
6bfe64f634 More fixes for 'smart' macro wildcard inference, specifically around TMap value parameters, which historically have been left in an unknown 'wildcard' state until compilation
#rb ben.hoffman
#jira UE-219696
#rnx

[CL 35065087 by dan oconnor in ue5-main branch]
2024-07-24 16:36:58 -04:00
george rolfe
f319ed5c85 [UnrealEd] Moved several UFunction editor utilities from BlueprintGraph UK2Node_CallFunction to ObjectTools
#rb dave.jones2
#rnx

[CL 34729180 by george rolfe in ue5-main branch]
2024-06-27 20:20:20 -04:00
dave jones2
0a84d2ea87 UE-217917 - GetActor Transform nodes have hidden target pins if added to actor without link
CL 32476605 incorrectly removed a !bIsConstFunc check, which caused all pure functions to lose their target pin. This change adds that back.

#jira UE-217917
#rb dan.oconnor

[CL 34386096 by dave jones2 in ue5-main branch]
2024-06-14 17:54:02 -04:00
roey borsteinas
5e1fb14dbf Fixed another instance of a blueprint graph pin taking it's name from FText::FromString, causing cook time warnings due to missing localization.
#rb Francis.Hurteau

[CL 33685592 by roey borsteinas in ue5-main branch]
2024-05-16 09:37:10 -04:00
dave jones2
4ff37b78a3 Deprecated redundant fields in UK2Node_CallFunction.
Both bIsConstFunc and bIsInterfaceCall are unnecessary since we can simply query the underlying UFunction/UClass (via FunctionReference) to determine if we're dealing with a const function or an interface class.

Additional changes:
* A check for CLASS_Interface was added to UK2Node_Message. While the chances of hitting this are very low, it wouldn't make sense to reference a non-interface class when expanding this node. It should really error out in that case.
* CreatePinsForFunctionCall had an unusual check for hiding the self pin if the pure function was non-const. This appears to be really old and no longer relevant.

#rb ben.zeigler, dan.oconnor

[CL 32476620 by dave jones2 in ue5-main branch]
2024-03-25 13:56:13 -04:00
zhikang shao
239e804676 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 30854644 by zhikang shao in ue5-main branch]
2024-01-24 13:55:51 -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