This change consists of multiple changes:
Core:
- Deprecation of ANY_PACKAGE macro. Added ANY_PACKAGE_DEPRECATED macro which can still be used for backwards compatibility purposes (only used in CoreUObject)
- Deprecation of StaticFindObjectFast* functions that take bAnyPackage parameter
- Added UStruct::GetStructPathName function that returns FTopLevelAssetPath representing the path name (package + object FName, super quick compared to UObject::GetPathName) + wrapper UClass::GetClassPathName to make it look better when used with UClasses
- Added (Static)FindFirstObject* functions that find a first object given its Name (no Outer). These functions are used in places I consider valid to do global UObject (UClass) lookups like parsing command line parameters / checking for unique object names
- Added static UClass::TryFindType function which serves a similar purpose as FindFirstObject however it's going to throw a warning (with a callstack / maybe ensure in the future?) if short class name is provided. This function is used in places that used to use short class names but now should have been converted to use path names to catch any potential regressions and or edge cases I missed.
- Added static UClass::TryConvertShortNameToPathName utility function
- Added static UClass::TryFixShortClassNameExportPath utility function
- Object text export paths will now also include class path (Texture2D'/Game/Textures/Grass.Grass' -> /Script/Engine.Texture2D'/Game/Textures/Grass.Grass')
- All places that manually generated object export paths for objects will now use FObjectPropertyBase::GetExportPath
- Added a new startup test that checks for short type names in UClass/FProperty MetaData values
AssetRegistry:
- Deprecated any member variables (FAssetData / FARFilter) or functions that use FNames to represent class names and replaced them with FTopLevelAssetPath
- Added new member variables and new function overloads that use FTopLevelAssetPath to represent class names
- This also applies to a few other modules' APIs to match AssetRegistry changes
Everything else:
- Updated code that used ANY_PACKAGE (depending on the use case) to use FindObject(nullptr, PathToObject), UClass::TryFindType (used when path name is expected, warns if it's a short name) or FindFirstObject (usually for finding types based on user input but there's been a few legitimate use cases not related to user input)
- Updated code that used AssetRegistry API to use FTopLevelAssetPaths and USomeClass::StaticClass()->GetClassPathName() instead of GetFName()
- Updated meta data and hardcoded FindObject(ANY_PACKAGE, "EEnumNameOrClassName") calls to use path names
#jira UE-99463
#rb many.people
[FYI] Marcus.Wassmer
#preflight 629248ec2256738f75de9b32
#codereviewnumbers 20320742, 20320791, 20320799, 20320756, 20320809, 20320830, 20320840, 20320846, 20320851, 20320863, 20320780, 20320765, 20320876, 20320786
#ROBOMERGE-OWNER: robert.manuszewski
#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 20430220 via CL 20433854 via CL 20435474 via CL 20435484
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246)
[CL 20448496 by robert manuszewski in ue5-main branch]
Change summary:
- Extended FBlueprintActionContext to include a weak ptr to the current IBlueprintEditor context.
- Added ENUM_CLASS_FLAGS() for the FBlueprintActionFilter::EFlags enumeration (for use as bitflags).
- Deprecated the current FBlueprintActionFilter constructor, replaced with a more explicitly-typed EFlags param.
- FBlueprintActionFilter now internally stores its filter flags. Also added FBlueprintActionFilter::HasAnyFlags/HasAllFlags().
- Minor refactor to a few action filter delegates to query the filter flags locally rather than add bool flags to delegate payloads.
- The FBlueprintActionFilter constructor now unsets the non-imported filter flag if Blueprint namespace editor settings are disabled.
- BlueprintActionFilterImpl::IsNonImportedObject() now utilizes the filter context rather than iterate the Blueprints array to find open asset editors.
- Added an override for UBlueprintComponentNodeSpawner::IsTemplateNodeFilteredOut(). This is now used to filter out any loaded or unloaded BP component types from the context menu.
- Cleaned up display inconsistencies in the menu UI spec between loaded vs. unloaded "Add Component" node spawner actions in the context menu.
- Added an FSoftObjectPath variant of IBlueprintEditor::IsNonImportedObject() (to support unloaded non-native component type entries which store the class object path). Implemented as FBlueprintEditor::IsNonImportedObject(FSoftObjectPath).
- Added an override for UK2Node_DynamicCast::IsActionFilteredOut() to exclude cast operator actions for non-native component types if they are not imported into the current editor context.
- Modified SBlueprintActionMenu, SBlueprintFavoritesPalette and SBlueprintLibraryPalette to include the current editor context in applicable action filter context(s).
#jira UE-149760
#rb Ben.Hoffman
#preflight 62753dd9e31cfc52d5bd0539
[CL 20077282 by Phillip Kavan in ue5-main branch]
BlueprintSubscribedTo was a serialized UPROPERTY, so on load CreateOutputPins thought the current BP still matched what had already been bound and would skip rebinding the events. This resulted in nothing being bound during load, as the event bindings are transient, so also marking BlueprintSubscribedTo as transient fixes the issue.
#jira
#rb Phillip.Kavan
#rnx
#ROBOMERGE-AUTHOR: jamie.dale
#ROBOMERGE-SOURCE: CL 20062693 via CL 20062704 via CL 20062807 via CL 20062833
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)
[CL 20066331 by jamie dale in ue5-main branch]
When linking a single precision pin to a double, we need to treat the pins as the same type, which ensures that a "break" message is used. However, FTypePromotion discovered that a cast exists between the two types, so it returns a "make with promotion" message instead.
The easiest fix here is to simply move the type promotion check to when the types don't match, since equal types imply that no promotion would be necessary to begin with. A more long term fix would be to remove float/double cast functions from KismetMathLibrary, as they're no longer necessary with implicit casting.
#rb ben.hoffman
#preflight 626aba17b17dd9121b3e37f5
#jira UE-150403
#ROBOMERGE-AUTHOR: dave.jones2
#ROBOMERGE-SOURCE: CL 19966951 in //UE5/Release-5.0/... via CL 19967813
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)
[CL 19971946 by dave jones2 in ue5-main branch]
The token parser assumed that numerical literals could only be floats. We simply need to change the parser to use doubles instead.
#rb andrew.davidson
#preflight 6266f68f5037f70ba0f72be2
#jira UE-133114
[CL 19925793 by dave jones2 in ue5-main branch]
Since UK2Node_ExecutePythonScript uses wildcards for its pins, it's dependent on its linked inputs. During node reconstruction, we were updating the python node's pins based on incorrect data. For example, one of the input nodes needed to change its pin type from real/double to real/float during reconstruction. However, this reconstruction occurred after the linked python node was reconstructed. As a result, the python node assumed that its linked input node was using a real/double type.
We can fix this by simply changing the priority of UK2Node_ExecutePythonScript to Low_UsesDependentWildcard. Additionally, this change reverts 19482561.
#rb jamie.dale
#preflight 625882d8010ebc5d4e8a5cc7
#jira UE-146987
[CL 19810564 by dave jones2 in ue5-main branch]
For floats, the display should now include either a "(single-precision)" or "(double-precision)" next to the float type. Unfortunately, this required a bit of finagling.
When we query for the tooltip, we also need to specify that we want to include subcategory information, which requires changing the signature of GetTypeDescription (et al) and GetCategoryText to include that information. Additionally, pluralizing the type gets a little weird. For containers, you might get something such as "Current type: Array of Float (single-precision)s". Instead of trying to fix the out of place "s", the wording has been changed to "Current: Array of Float (single-precision) types".
#rb justin.hare
#preflight 6257501bf7476d662c9094c6
#jira UE-147869
[CL 19757826 by dave jones2 in ue5-main branch]
We neglected to redirect Conv_FloatToText nodes to Conv_DoubleToText, which was causing loss of precision when formatting text. However, this revealed another issue with the format text node.
Since the format text node uses wildcards, it needs a sorting priority of Low_UsesDependentWildcard. Otherwise, linked inputs won't be updated before we sync the node's pins. For example, we might be linked to a Conv_FloatToText node that hasn't yet been converted to a Conv_DoubleToText node. As a result, the format text node will use a single precision float input for the connected conversion node instead of a double.
Another issue is that the format text node is marked as causing a structural Blueprint change. The current sorting function prioritizes that over its refresh priority. Fortunately, we don't need to concern ourselves with structural modification if we're compiling on load, which is when we really need the refresh priority to work as expected.
Finally, K2Node_EnumEquality node needs to have its knot dependencies updated prior to reconstruction. Otherwise, it might fail to find a valid UEnum, and disconnect its inputs. Since knot nodes already have this logic built in, we can just force a type propagation on any linked knots.
#jira UE-141180
#preflight 6255c2ed153828d27337753f
#rb Phillip.Kavan
[CL 19726070 by dave jones2 in ue5-main branch]
This allows assets that implement an interface to be set as pin defaults
#jira none
#rb Phillip.Kavan
#preflight 624d63004c5db57ae60511d3
[CL 19644779 by Thomas Sarkanen in ue5-main branch]
Change summary:
- Moved base definition of UK2Node::HasExternalDependencies() up one level to UEdGraphNode (to avoid blind casts in a context where we may not necessarily have a UK2Node subtype).
- Updated subtype headers that override HasExternalDependencies() to relocate the declaration into the class declaration's 'UEdGraphNode overrides' section (for clarity).
- Reverted previous UBlueprintNodeSpawner::ImportTarget solution in favor of using node dependencies; this allows auto-import actions to scale more easily to all existing node subtypes and avoids data duplication.
- Modified SBlueprintActionMenu::OnActionSelected() to utilize the new method for determining which namespace(s) to auto-import after executing a node spawner action in response to a context menu item selection (UE-146803).
- Reverted FBlueprintNamespaceUtilities::GetPropertyValueNamespaces() back to its original 5.0 signature so that it uses a TSet<FString> for the output rather than a TArray<FString>; this fits in better with input to other APIs.
- Renamed FBlueprintEditor::FImportNamespaceParameters to FImportNamespaceExParameters (for clarity).
- Changed the 'FBlueprintEditor::FImportNamespaceParameters::AdditionalNamespaces' member to a TSet<FString> containing *all* namespaces to import rather than limiting to only additional ones.
- Reverted FBlueprintEditor::ImportNamespace() back to its original 5.0 signature and added/implemented FBlueprintEditor::ImportNamespaceEx() as the "extended" version that allows for batched imports and future customizations.
- Revised existing FBlueprintEditor::ImportNamespace() call sites to utilize and/or conform to the extended ImportNamespaceEx() API where appropriate.
#jira UE-146803
#rb Benjamin.Fox
#preflight 623cf3a433709ff50128e8d4
[CL 19505118 by Phillip Kavan in ue5-main branch]
Change summary:
- Added UBlueprintNodeSpawner::ImportTarget to store/serialize an object reference to allow for resolving action namespace scope on selection.
- Modified UBlueprintFieldNodeSpawner::SetField() to determine and store the import target object reference for a field-based node spawner type.
- Modified FBlueprintNodeSpawnerFactory::MakeMacroNodeSpawner() to determine and store the import target object for a macro instance node spawner.
- Modified SBlueprintActionMenu::OnActionSelected() to auto-import the associated namespace after selecting an action item containing a valid node spawner.
#jira UE-146803
#rb Benjamin.Fox
#preflight 623b56df9304d833f40d422a
[CL 19485593 by Phillip Kavan in ue5-main branch]
The BP compiler erroneously reports that python nodes might be missing implicit casts. However, UK2Node_ExecutePythonScript nodes handle argument slightly differently than conventional function nodes. The pins don't actually correspond to actual arguments on ExecutePythonScript. Instead, they more or less serve as references to their linked inputs, which ExecutePythonScript will pop from the stack and perform a direct conversion to a Python type. As a result, there's nothing to cast, and we can safely remove the entries from the ImplicitCastMap on the current content.
#rb jamie.dale
#jira UE-146778
#preflight 623b4fbeca34ffd7bf7db3e8
[CL 19482561 by dave jones2 in ue5-main branch]