Commit Graph

720 Commits

Author SHA1 Message Date
thomas sarkanen
c6b6d713b9 Fix function renames not applying to property access nodes and compilation crashes post-rename
Implement function BP rename handling on a per-node basis, similar to existing variable rename handing
Move to using FBlueprintEditorUtils::GetMostUpToDateClass for property access in-editor. This ensures that any local renames are picked up prior to recompilation.

#jira UE-204823
#rb jaime.cifuentes, Phillip.Kavan

#changelist validated
#virtualized

[CL 31251596 by thomas sarkanen in ue5-main branch]
2024-02-07 05:08:42 -05:00
dan oconnor
0b140f8ae6 Combine FUnloadedAssetData/FLoadedAssetData and various FPinTypeTreeInfo constructors, remove the intermediate 'type database', filter TypeTreeRoot in place, perform 'custom filtering' during filter step, rather than during 'children matching' search
#rb Phillip.Kavan
#jira UE-204415

#changelist validated
#virtualized

[CL 31223293 by dan oconnor in ue5-main branch]
2024-02-06 13:43:38 -05:00
thomas sarkanen
507ad255ba Anim notify and sync marker workflow changes
Skeletons are no longer dirtied when adding notifies and sync markers from animation timelines.
Skeletons can still hold sync markers and notifies, but they are not mandatory and they can all be held in animation assets if required.
'Find References' for notifies and sync markers now launches the find/replace dialog when selected from the animation timeline.
Removing notifies and sync markers from the skeleton now does only that. To remove from animations, use the find/replace tab.
Updated BP node spawning for anim notifies to use a custom spawner, correctly use the asset registry, apply filtering and context sensitivity and move some of the code out of BlueprintGraph.
Added icons to distinguish sync markers/notifies in the editing tab.
Updated notify editing tab filtering to allow users to filter items from 'this' skeleton, compatible skeletons or other assets.

Additionally fixed up icons for some Persona tabs that were incorrect.

#jira UE-204872
#rb jaime.cifuentes, Phillip.Kavan

[CL 31168417 by thomas sarkanen in ue5-main branch]
2024-02-05 05:30:20 -05:00
dan oconnor
86b833615c One last cleanup of the pin type selector, avoid repeated FText::Rebuild calls to sort the pin lists, clarify the intent of FPinTypeTreeInfo constructors
#rb ben.hoffman
#jira UE-204415

[CL 31105955 by dan oconnor in ue5-main branch]
2024-02-01 17:31:37 -05:00
dan oconnor
1b378626e7 More pin type menu optimzations, avoid wandering back and forth between SoftObjectPath and AssetData
#jira UE-204415
#rb ben.hoffman

[CL 31057002 by dan oconnor in ue5-main branch]
2024-01-31 13:55:55 -05:00
ben hoffman
95db10aa96 When checking for if a BP added variable is in use, we should also check if there are any Component Bound event nodes that reference it.
#jira UE-197140
#rb dan.oconnor

[CL 31025854 by ben hoffman in ue5-main branch]
2024-01-30 18:03:45 -05:00
dan oconnor
2f7acbc36a Cleanup pin type selector, improving performance in large projects.
#rb Phillip.Kavan
#jira UE-204415

[CL 30909986 by dan oconnor in ue5-main branch]
2024-01-25 19:48:54 -05:00
dave jones2
6f6ac30e15 Deprecated bIsFinalFunction.
"final" was an UnrealScript concept that never made it into Blueprints. Currently, it's synonymous with the CallParentFunction node. Instead of using this flag, we can simply check the node type directly.

We still might want to revisit this for Blueprints, but we likely won't use this bool.

#rb ben.hoffman, dan.oconnor

[CL 30770789 by dave jones2 in ue5-main branch]
2024-01-22 09:24:57 -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
steve robb
7da84c1d1b Replaced UE_NODISCARD with [[nodiscard]].
[CL 30593744 by steve robb in ue5-main branch]
2024-01-12 10:47:04 -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
ben humphreys
e9c9ac7a74 Added binding to create a new Custom Event Node. No binding by default. Similar to pressing C to create a new Comment Node.
#jira UE-200930
#rb Phillip.Kavan

[CL 30218170 by ben humphreys in ue5-main branch]
2023-12-08 15:12:30 -05:00
ben hoffman
9478f80ecf Fix tooltip being incorrect after an undo of converting promotable operator type nodes. The operation name was not a UPROPERTY, so it was not being tracked with Modify calls for transactions
#jira UE-193654
#rb trivial
#rnx

[CL 28005380 by ben hoffman in ue5-main branch]
2023-09-19 14:41:02 -04:00
ben hoffman
18eb67c78c Implement GetOptions for UPARAM and add it for ByProfile traces
#rb dave.jones2

#ushell-cherrypick of 27593453 by kristof.morva1

[CL 27597870 by ben hoffman in ue5-main branch]
2023-09-05 11:33:21 -04:00
ben zeigler
e3b7df8297 Change the blueprint action database to refresh type promotion instead of doing it from the module change callback.
This ensures the type promotion is refreshed right before it is needed and avoids redundant refreshes when multiple modules load at once.
#rb ben.hoffman

[CL 27177959 by ben zeigler in ue5-main branch]
2023-08-17 13:25:12 -04:00
ben hoffman
277fcfc08f Add an option to convert a comparison operator node to another comparison, like == to !=.
Add the symbol to the user facing operator name for comparison operators for a nicer menu

#rb dan.oconnor

[CL 27027544 by ben hoffman in ue5-main branch]
2023-08-11 10:30:15 -04:00
ben hoffman
69f5ebcc13 Fixed const-correctness of UK2Node_Event::FindEventSignatureFunction
#rb marc.audy

#ushell-cherrypick of 26366689 by kristof.morva1

[CL 26407923 by ben hoffman in ue5-main branch]
2023-07-17 11:13:19 -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
ben hoffman
4759599dff [Backout] - CL25790092
Add a small bug fix to it. When attempting to create an auto-cast node from an Interface -> Object type, the UEdGraphSchema_K2::FindSpecializedConversionNode will NewObject whatever node type is required as a template to copy. This Template node does not have a parent graph (rightfully so) which means that the call to GetSchema would return null. When this happened with a Dynamic Cast node, it was checking on the schema being available in the SetPurity function where it was not before.

We don't want to set the parent graph on the template node during conversion because that isn't accurate because its a dummy template node, not something that is actually on the graph. It would also be adding references to that parent graph unnecessarily.
#rb Phillip.Kavan

Original CL Desc
-----------------------------------------------------------------
Fix potential crash when `bFavorPureCastNodes` is enabled.

`K2Node_Message` attempted to create an impure cast node when expanded, but `SetPurity(false)` had no effect in this case because inside it `IsNodePure` returned `false` even if the default cast purity was `Pure`. It resulted in the creation of a pure node, causing a crash because the Message node attempted to work with its (non-existent) exec pins.

#rb Phillip.Kavan

#ushell-cherrypick of 25757919 by kristof.morva1

[CL 25792482 by ben hoffman in ue5-main branch]
2023-06-05 11:05:42 -04:00
ben hoffman
4171fe00ac [Backout] - CL25758302
#fyi Phillip.Kavan
Original CL Desc
-----------------------------------------------------------------
Fix potential crash when `bFavorPureCastNodes` is enabled.

`K2Node_Message` attempted to create an impure cast node when expanded, but `SetPurity(false)` had no effect in this case because inside it `IsNodePure` returned `false` even if the default cast purity was `Pure`. It resulted in the creation of a pure node, causing a crash because the Message node attempted to work with its (non-existent) exec pins.

#rb Phillip.Kavan
#preflight 6479d868e319748a83f72c54

#ushell-cherrypick of 25757919 by kristof.morva1

[CL 25790092 by ben hoffman in ue5-main branch]
2023-06-05 08:30:10 -04:00
ben hoffman
10c18ce23e Fix potential crash when bFavorPureCastNodes is enabled.
`K2Node_Message` attempted to create an impure cast node when expanded, but `SetPurity(false)` had no effect in this case because inside it `IsNodePure` returned `false` even if the default cast purity was `Pure`. It resulted in the creation of a pure node, causing a crash because the Message node attempted to work with its (non-existent) exec pins.

#rb Phillip.Kavan
#preflight 6479d868e319748a83f72c54

#ushell-cherrypick of 25757919 by kristof.morva1

[CL 25758302 by ben hoffman in ue5-main branch]
2023-06-02 08:24: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