171 Commits

Author SHA1 Message Date
jodon karlik
1164c206ac [Backout] - CL35773939
Partial back-out of this CL (MessageNodes still allow hookups to redirected static functions so as not to break potentially submitted content).

[FYI] jodon.karlik
Original CL Desc
-----------------------------------------------------------------
K2Nodes now allow a CoreRedirect from the "self" pin if (and only if) the new function changes the visibility of the "self" pin.  This allows you to redirect member functions to non-member static functions (which will hide the self pin).  For example:

If the original call was a member function Foo.Bar(123) you could redirect that to a static function Bar(Foo, 123).

Syntax in BaseEngine.ini [[CoreRedirects] looks something like:
; Redirect the Member Function to a Static Function
+FunctionRedirects=(OldName="/Script/PluginName.Foo.Bar", NewName="FooBlueprintLibrary.Bar")
; Redirect the Self Pin to a Parameter Pin named "InFoo"
+PropertyRedirects=(OldName="FooBlueprintLibrary.Bar.Self", NewName="InFoo")

#rb ben.zeigler

[CL 35787966 by jodon karlik in ue5-main branch]
2024-08-23 22:04:23 -04:00
jodon karlik
748191cbe9 K2Nodes now allow a CoreRedirect from the "self" pin if (and only if) the new function changes the visibility of the "self" pin. This allows you to redirect member functions to non-member static functions (which will hide the self pin). For example:
If the original call was a member function Foo.Bar(123) you could redirect that to a static function Bar(Foo, 123).

Syntax in BaseEngine.ini [[CoreRedirects] looks something like:
; Redirect the Member Function to a Static Function
+FunctionRedirects=(OldName="/Script/PluginName.Foo.Bar", NewName="FooBlueprintLibrary.Bar")
; Redirect the Self Pin to a Parameter Pin named "InFoo"
+PropertyRedirects=(OldName="FooBlueprintLibrary.Bar.Self", NewName="InFoo")

#rb ben.zeigler

[CL 35774031 by jodon karlik in ue5-main branch]
2024-08-23 12:28:32 -04:00
roey borsteinas
c3988acd03 Changed instances of FText::FromString in editor graph nodes to use AsCultureInvariant. This is required in case the nodes are cooked out (can occur in the case of optional editor data). These strings do not need localization and will trigger warnings in the cook if they aren't marked invariant.
#rb Jamie.Dale

[CL 33656019 by roey borsteinas in ue5-main branch]
2024-05-15 09:11:45 -04:00
steve robb
f8d47335a4 Replaced RemoveAt(N, 1, EAllowShrinking::*) with RemoveAt(N, EAllowShrinking::*).
[CL 31626444 by steve robb in ue5-main branch]
2024-02-19 16:51:58 -05:00
steve robb
6d5b974842 Fixed up a lot of bool-taking container resize functions to take EAllowShrinking instead.
[CL 30735396 by steve robb in ue5-main branch]
2024-01-19 19:41:56 -05:00
dave jones2
f636c71244 Removed check in ValidateLinkedPinTypes
Some users are hitting a check where no compiler relevant pin cannot be found during validation. It's unclear if this is an expected scenario. For now, we'll relax this to a soft-fail, and add logging to help track down the issue. If this turns out to be a valid scenario, we can remove the log in a future change.

#rb dan.oconnor

[CL 29602075 by dave jones2 in ue5-main branch]
2023-11-09 13:06:27 -05:00
geordiemhall
57ee928f20 PR #9389: Allow using "spawn node" keyboard shortcuts while dragging from a pin
#jira UE-159588

[CL 26780272 by geordiemhall in ue5-main branch]
2023-08-02 14:08:05 -04:00
dave jones2
817808ee4c UE-188291 - Blueprint autoconversions can't handle default values
Blueprint autoconversions normally work by checking pairs of linked pins and inserting cast nodes. However, default literal values on nodes aren't linked, so they must be treated differently.

Since default values aren't linked, we need to check the old and new pin types during rewiring. We can't do this during validation stage since we've forgotten the old pin type by that point. Additionally, we should prevent any sort of data loss when handling the default values. The safest way to do so is:

1. Create a literal node from the old type.
2. Create a conversion node between the old and new type.
3. Link the nodes to the pin that has the default value.

The drawback to this technique is that it inserts nodes, but it's safer than directly modifying the default value on the new pin (eg: "1.1" could end up as "1"). We still provide a note that nodes were inserted, which gives the developer the choice of how to handle the conversion change.

#jira UE-188291
#rb phillip.kavan

[CL 26034634 by dave jones2 in ue5-main branch]
2023-06-15 23:29:55 -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
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
marc audy
543b4850eb Go back to matching by name if there aren't conversion functions available to fix broken content cases where a name fix up does solve the issue (connected to wildcards, types change in tandem on multiple functions, pin object type changes to be more restrictive but connection is still valid).
[FYI] Dave.Jones
#rnx

[CL 25444139 by marc audy in ue5-main branch]
2023-05-12 02:36:13 -04:00
dan oconnor
94e1d08453 Better fix for crash when removing pins from a node with orphaned pins
#jira UE-180781
#rb Jordan.Hoffmann
#preflgiht 6418ce8c3f3d31c94abab654

[CL 24726987 by dan oconnor in ue5-main branch]
2023-03-20 20:22:25 -04:00
dan oconnor
d3cf046ac7 Lay groundwork for avoiding SGraphPanel refreshes after making a change to a single node by adding a NotifyNodeChanged routine to UEdGraph, currently implemented to just invoke NotifyGraphChanged with no additional context
#rb Justin.Hare, Andrew.Davidson
#preflight 640a9da7d778f88975ed4702
#jira UE-158391

[CL 24601445 by dan oconnor in ue5-main branch]
2023-03-10 20:03:26 -05:00
Phillip Kavan
02aff26b7f Fix to include specialized auto-convert cases in addition to auto-cast when matching pin types with potential redirects during node reconstruction.
Notes:
- UEdGraphSchema_K2::CreateAutomaticConversionNodeAndConnections() handles both, but we were only allowing auto-cast scenarios to pass in the revised UK2Node::DoPinsMatchForReconstruction().
- This is needed for linked pins with matching names which were previously being allowed through, but now require types to match as well (or at least have a matching auto-conversion or auto-cast operation).
- UK2Node::DoPinsMatchForReconstruction() is now at parity with UEdGraphSchema_K2::CanCreateConnection() in terms of when the latter returns CONNECT_RESPONSE_MAKE_WITH_CONVERSION_NODE.

#rnx
#jira UE-172222
#rb Dave.Jones2
#preflight 63e6e33de92f139c517a0f4e

[CL 24174262 by Phillip Kavan in ue5-main branch]
2023-02-13 09:52:46 -05:00
dave jones2
d9397ab592 UE-172222 - Improve redirect support for Blueprints. (resubmit)
A reflected Blueprint type can now be changed without breaking existing content, so long as an autocast function exists for the two types.

Previously, pin reconstruction would give up if two pin types didn't match exactly, which resulted in orphaned pins and compilation errors. Now, it'll first try to find an autocast function for the two types, and insert a cast node into the graph if one is found.

Additionally, notes will be added whenever a new cast node was added, which serves as a notice that users might want to update their API to use the new type change.

#jira UE-172222
#preflight 63d85cf57a39a1802189bdda
#rb phillip.kavan

[CL 24029327 by dave jones2 in ue5-main branch]
2023-02-06 09:08:45 -05:00
dave jones2
7b2e42b662 [Backout] - CL23629872 (Assorted BP compilation issues)
#fyi dave.jones2
Original CL Desc
-----------------------------------------------------------------
UE-172222 - Improve redirect support for Blueprints.

A reflected Blueprint type can now be changed without breaking existing content, so long as an autocast function exists for the two types.

Previously, pin reconstruction would give up if two pin types didn't match exactly, which resulted in orphaned pins and compilation errors. Now, it'll first try to find an autocast function for the two types, and insert a cast node into the graph if one is found.

Additionally, notes will be added whenever a new cast node was added, which serves as a notice that users might want to update their API to use the new type change.

#jira UE-172222
#preflight 63b72580af3ebedd9988ae4c
#rb benjamin.fox,dan.oconnor

[CL 23657454 by dave jones2 in ue5-main branch]
2023-01-11 18:54:32 -05:00
dave jones2
1f3ca97244 UE-172222 - Improve redirect support for Blueprints.
A reflected Blueprint type can now be changed without breaking existing content, so long as an autocast function exists for the two types.

Previously, pin reconstruction would give up if two pin types didn't match exactly, which resulted in orphaned pins and compilation errors. Now, it'll first try to find an autocast function for the two types, and insert a cast node into the graph if one is found.

Additionally, notes will be added whenever a new cast node was added, which serves as a notice that users might want to update their API to use the new type change.

#jira UE-172222
#preflight 63b72580af3ebedd9988ae4c
#rb benjamin.fox,dan.oconnor

[CL 23629872 by dave jones2 in ue5-main branch]
2023-01-10 13:35:44 -05:00
dave jones2
9bab3a527e Misc Blueprint changes:
* Added overloads for FindSpecializedConversionNode and SearchForAutocastFunction that don't use output parameters. There are several instances in the engine where dummy variables are used to get around this.
* Updated the Message_ functions to use template parameter packing. The arguments are forwarded to the underlying FCompilerResultsLog, if one exists. This allows us to use tokenized messages.
* Changed several functions in FCompilerResultsLog to use the coding standard's naming convention. Specifically, arguments need to start with an uppercase letter.

#jira none
#preflight 639778dc2960b732208492ae
#rb phillip.kavan

[CL 23482483 by dave jones2 in ue5-main branch]
2022-12-12 15:50:51 -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
phillip kavan
befdf280c6 Exclude override flag members from the optional input pin set on MakeStruct nodes.
Overview:
- An "override flag" is an inline toggle-style Boolean edit condition. These are implicitly set to true at runtime within the output struct value if any member that's bound to it is exposed as a visible input pin on a MakeStruct node.
- For context, the Property Editor implicitly sets an override flag to true at edit time when a member that's bound to it is enabled for editing. These members are not otherwise labeled/exposed for direct editing.
- An override flag is meant to signal to a system that the user wishes to use the bound member's value in place of the current value (whatever that may be) when the full struct value is applied. Examples: FPostProcessSettings, FMovieSceneSequencePlaybackSettings, etc.

Previous UX:
- All boolean edit conditions were being treated as override flags on a MakeStruct node.
- Any inline toggle edit condition that did not begin with "bOverride_" or whose suffix otherwise did not match another value member could be exposed as an input on a MakeStruct node.
- Override flags exposed as inputs would always be set to TRUE at runtime regardless of input if it was declared at the top of the struct and if a member value bound to it was also exposed as an input pin.

After this change:
- Only inline toggle edit conditions and legacy struct members that follow the "bOverride_" naming convention will be treated as an override flag on a MakeStruct node.
- Inline toggle edit conditions can no longer be exposed directly as an input on a MakeStruct node. The intent was to bring the MakeStruct node UX closer to parity with the Property Editor UX.

Additional notes:
- Members that follow the legacy "bOverride_" naming convention were already being excluded from the optional input pin set on MakeStruct nodes if another member property name also matched its suffix. These have historically been excluded from ALL optional pin sets that utilize any FOptionalPinManager subtype (regardless of node type), so there was no change here.
- Existing MakeStruct nodes that may have already exposed inline toggle edit condition members as input pins will now orphan those pins on load if connected or if set to a non-default value (true). The "correct" way to set an override flag is by choosing to expose a member that's bound to the override condition as an input.
- Existing BreakStruct nodes are unchanged currently. Meaning, inline edit conditions that don't follow the legacy "bOverride_" convention can still be optionally exposed as an output pin. This UX was preserved as existing Blueprint logic could conceivably rely on the value of an override flag.
- Only one implicit assignment is now emitted for each override flag binding. Previously, we were emitting one assignment statement per bound property, so it could result in redundant assignments to the same flag if more than one property was bound to it.

#jira UE-147873
#rb Ben.Zeigler, Sebastian.Nordgren
#preflight 632c7353c7791417aa87f3bf

[CL 22164359 by phillip kavan in ue5-main branch]
2022-09-23 20:20:58 -04:00
dave jones2
86060ea765 Added a matching GetThenPin to supplement GetExecPin.
Cleaned up some comments, too.

#jira none
#preflight 631794882b7fe03eb6479066
#rb benjamin.fox

[CL 21829163 by dave jones2 in ue5-main branch]
2022-09-06 17:05:09 -04:00
Phillip Kavan
a6a5b9f4e5 Revise the legacy pin default value mismatch warning check on node reconstruction to handle string diffs that convert to identical values.
#jira UE-157988
#rb Dave.Jones2
#preflight 62d5dec8dc4397d384e468aa

[CL 21161183 by Phillip Kavan in ue5-main branch]
2022-07-19 09:08:09 -04:00
marc audy
6553e6cd0a Remove as much C++ deprecation as possible up to 4.17 (along with a few scattered removals from beyond)
#preflight 61eefc77ba69a4fdb220bf23

#ROBOMERGE-AUTHOR: marc.audy
#ROBOMERGE-SOURCE: CL 18712765 in //UE5/Release-5.0/... via CL 18712784 via CL 18713147
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18713191 by marc audy in ue5-main branch]
2022-01-24 15:07:48 -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