Commit Graph

1711 Commits

Author SHA1 Message Date
robert manuszewski
d1443992e1 Deprecating ANY_PACKAGE.
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]
2022-06-01 03:46:59 -04:00
Leon Huang
19877e39c5 Fix for duplicate localization key warnings and missing localization defines/undefines in various files.
#rnx
#rb: Vincent.Gauthier
#jira: UE-151614
#preflight: 628fc4a98c23e52ef0fdfa7d

[CL 20384450 by Leon Huang in ue5-main branch]
2022-05-26 16:11:10 -04:00
George Rolfe
4e655b7759 K2Node_BaseAsyncTask uses param DisplayName if available
(consistent with K2Node_CallFunction)

#jira none
#rb ben.zeigler
#preflight 628da428fd34e09bec462626

[CL 20360185 by George Rolfe in ue5-main branch]
2022-05-25 00:07:45 -04:00
robert manuszewski
f8a812a32f Converting hardcoded short class/enum names to pathnames ahead of ANY_PACKAGE removal
#rb trivial
#jira UE-99463
#preflight 6288fd998828ea88c8aef3d0

#ROBOMERGE-OWNER: robert.manuszewski
#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 20314896 via CL 20314897 via CL 20314903 via CL 20314904
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v948-20297126)

[CL 20315214 by robert manuszewski in ue5-main branch]
2022-05-22 10:30:02 -04:00
ben hoffman
a5087e8000 Fix type promotion to correctly exclude UEdGraphSchema_K2::PC_SoftClass, not the PC_SoftObject.
#jira UE-146282
#rb phillip.kavan
#preflight 6279a232057d42a0e414f6ae

#ROBOMERGE-AUTHOR: ben.hoffman
#ROBOMERGE-SOURCE: CL 20128580 in //UE5/Release-5.0/... via CL 20129423
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20132121 by ben hoffman in ue5-main branch]
2022-05-10 19:40:14 -04:00
lauren barnes
00c86da7f5 Adding AppStyle.h includes
#rb trivial

#ROBOMERGE-OWNER: lauren.barnes
#ROBOMERGE-AUTHOR: lauren.barnes
#ROBOMERGE-SOURCE: CL 20072361 via CL 20072577 via CL 20072706
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20105734 by lauren barnes in ue5-main branch]
2022-05-09 13:31:23 -04:00
lauren barnes
f9715388ed Adding AppStyle.h includes
#rb trivial

#ROBOMERGE-AUTHOR: lauren.barnes
#ROBOMERGE-SOURCE: CL 20072084 via CL 20072320 via CL 20072434
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20105701 by lauren barnes in ue5-main branch]
2022-05-09 13:29:31 -04:00
Lauren Barnes
6248f8d412 Replacing legacy EditorStyle calls with AppStyle
#preflight 6272a74d2f6d177be3c6fdda
#rb Matt.Kuhlenschmidt

#ROBOMERGE-OWNER: Lauren.Barnes
#ROBOMERGE-AUTHOR: lauren.barnes
#ROBOMERGE-SOURCE: CL 20057269 via CL 20070159 via CL 20072035 via CL 20072203
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)
#ROBOMERGE-CONFLICT from-shelf

[CL 20105363 by Lauren Barnes in ue5-main branch]
2022-05-09 13:12:28 -04:00
Phillip Kavan
8e3e596f9b Exclude node spawner actions for non-imported component types from the Blueprint graph context menu when Blueprint namespace editor features are enabled.
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]
2022-05-06 11:49:20 -04:00
jamie dale
87868d7c1a Fixed UK2Node_GetClassDefaults failing to rebind OnBlueprintClassModified during load
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]
2022-05-05 18:43:06 -04:00
Matt Peters
7ad238a806 AssetRegistry includes (Engine/Source): change #include "AssetData.h" -> #include "AssetRegistry/AssetData.h", and similar for the other moved AssetRegistry headers.
#rb Zousar.Shaker
#rnx
#preflight 6270509a220f89f0ad573030

[CL 20016982 by Matt Peters in ue5-main branch]
2022-05-02 18:06:48 -04:00
dave jones2
ca0c617b71 UE-150403 - Math nodes of float type double will accept both single & double in the input pins
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]
2022-04-28 18:57:07 -04:00
Phillip Kavan
b97005bd2a Fix a regression that leads to an assert in the editor when trying to spawn a new AddComponent node for a non-native component class type that hasn't yet been loaded.
#rnx
#jira UE-149760
#rb Benjamin.Fox
#preflight 626abe7ba5009ff191b3d735

[CL 19967354 by Phillip Kavan in ue5-main branch]
2022-04-28 15:50:19 -04:00
ben hoffman
a7bbad4535 Make Soft object references not supported by Type Promotion because it doesnt work correctly. This will make it so that the old options show up in the context menu by default, which is the correct behavior.
#jira UE-146282
#rb phillip.kavan
#preflight 626857711638ac249e912831

#ROBOMERGE-AUTHOR: ben.hoffman
#ROBOMERGE-SOURCE: CL 19931082 in //UE5/Release-5.0/... via CL 19932342
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 19933337 by ben hoffman in ue5-main branch]
2022-04-26 20:53:22 -04:00
dave jones2
9f2dd29383 UE-133114 - FBasicTokenParser::GetToken doesn't support double literals
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]
2022-04-26 14:44:09 -04:00
dave jones2
939f991649 UE-146987 - Cleaned up the original fix for erroneous implicit casts in python script nodes.
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]
2022-04-19 12:18:56 -04:00
justin hare
3887ecc507 Fixes a BP compiler crash occurring with SetFieldsOnStruct nodes with missing struct type dependencies, in favor of a compiler error. This was causing an editor-load-time crash in the Safari sample, due to removal of some Network Prediction plugin classes.
#jira UE-148299
#rb dave.jones2
#preflight 625db45248670f31a625270a

[CL 19792110 by justin hare in ue5-main branch]
2022-04-18 15:22:09 -04:00
dave jones2
60bc4583a5 UE-147869 - Tooltips for floats are not the same in the My Blueprint window
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]
2022-04-14 11:38:11 -04:00
dave jones2
c45795f9fe UE-141180 - Loss of precision with String to Float Real conversion
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]
2022-04-12 14:41:25 -04:00
benjamin fox
11ec1e4030 Make Enum to String Node not display as a compact node, making it look different from Byte to String for clarity
#rb ben.hoffman
#preflight skip

[CL 19655174 by benjamin fox in ue5-main branch]
2022-04-06 16:34:09 -04:00
Thomas Sarkanen
f3dd157c95 Fixed defaults not being able to be set on interface pins
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]
2022-04-06 06:13:40 -04:00
Josie Yang
b34efacab9 Provide custom context menu search criteria for material editor
#jira UE-144802
#rb ben.hoffman, ben.ingram
#preflight 623dcdc04302b204a3680deb

[CL 19513296 by Josie Yang in ue5-main branch]
2022-03-25 11:18:02 -04:00
Phillip Kavan
f64e3e18d7 Some minor refactoring to assist with auto-importing external type object dependency namespaces into the Blueprint editor context in response to user actions.
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]
2022-03-24 19:50:46 -04:00
Phillip Kavan
8bffee0ba1 Auto-import the associated namespace after selecting a non-imported action in the Blueprint graph context menu.
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]
2022-03-23 16:51:27 -04:00
dave jones2
135eb09732 UE-146778 - CIS Content Error: Unhandled implicit casts found during compilation of function
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]
2022-03-23 14:24:22 -04:00