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]
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]
(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]
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]
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]
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]
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]
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]
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]
[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]
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]
[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]
[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]
(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]
[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]
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]