Files
UnrealEngineUWP/Engine/Source/Editor/BlueprintGraph
dave jones2 3bff6cb886 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 26055966 by dave jones2 in 5.3 branch]
2023-06-16 12:12:03 -04:00
..