Commit Graph

427 Commits

Author SHA1 Message Date
nate strohmyer
de8cfbc19d Fix to allow users to coerce a BlueprintImplementableEvent with no return value to treat the override as a function rather than an event
#jira UE-153344
#rb phillip.kavan
#preflight 62a8e2800c386ccae4861791
#3078

[CL 20658293 by nate strohmyer in ue5-main branch]
2022-06-14 17:22:51 -04:00
dave jones2
bcadd23489 UE-151338 - Implement refactored implicit conversion for math types.
Removed container and struct conversions from the script VM. This introduced complexity that the VM doesn't need, nor did it scale for the various struct types that we want to implicitly convert in Blueprints. Instead, the script VM is *only* aware of float<->double conversion. Container and struct conversions have now been moved to BlueprintTypeConversions. Currently, only the existing FVector3f<->FVector3d conversion has been added, but the remaining LWC types will be added in a subsequent change.

During Blueprint compilation of container and struct conversions, we now inject a function call into the bytecode that performs the conversion, which is better suited to the task instead of burdening the VM with the work. One drawback to this technique is that containers are slightly more inefficient when it comes to conversions. They won't know their type(s) ahead of time, which requires dynamically looking up a conversion function at runtime. We can possibly optimize this further, but the generaly recommendation is to avoid implicit conversions of container types when possible.

Additionally, a couple of convenience functions were added to the KismetCastingUtils to help remove a fair amount of boilerplate code that was used for implicit casting in various node types. ScriptCastingUtils.h was also removed since the VM no longer needs to concern itself with complex conversions.

#jira UE-151338
#preflight 629a507fb42820769428c133
#rb phillip.kavan

[CL 20560449 by dave jones2 in ue5-main branch]
2022-06-08 13:50:57 -04:00
jordan hoffmann
0e53056bc6 Clang now optimizes away this==nullptr. Calls to IsChildOf from a null UObject pointer will cause undefined behavior. This is a retroactive attempt to pad potentially dangerous calls to IsChildOf with a null check in the following directories:
- Plugins/BlueprintContext
- Editor/GlueprintGraph
- Editor/GraphEditor
- Editor/Kismet
- Editor/KismetCompiler
- Editor/UnrealEd/Private/Kismet2

note: if you're seeing this CL in the perforce history because you're trying to figure out why there's a null check that doesn't make sense, This is why. The goal of this CL is to preserve the behavior before IsChildOf changed rather than analyze whether that behavior makes sense. Use your best judgement

#rb marc.audy
#preflight 6299023a6438e3c731307a69

[CL 20474984 by jordan hoffmann in ue5-main branch]
2022-06-02 16:09:18 -04:00
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
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
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
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
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
dave jones2
5b9494ac73 UE-145026 - BP Precision issues occur in CM_Character_Jumping (CharacterMovement  EngineTests) when comparing FP literals with serialized floats
We need to ensure that literal default values are interpreted as float strings instead of doubles. We've observed that some older Blueprint content might be using exact comparisons with floats. While this is generally frowned upon, some game logic may depend on this behavior. These issues can be difficult to debug if we covertly interpret literal float data as doubles.

As for the fix, anytime we serialize old pin data that represented a single precision float, we set a flag on the type that ensures we parse its default value string as a single precision float. This flag is also serialized, and isn't changed until the user actually changes the current value to something different.

#jira UE-145026
#preflight 622a416b03062eac59dae469
#rb phillip.kavan
#lockdown

#ROBOMERGE-AUTHOR: dave.jones2
#ROBOMERGE-SOURCE: CL 19339612 in //UE5/Release-5.0/... via CL 19348994
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)

[CL 19349461 by dave jones2 in ue5-main branch]
2022-03-11 00:35:01 -05:00
dave jones2
d159c90e80 UE-144351 - Blueprint real numbers causing Dev-EngineMerge blocker
The KismetMathLibrary changes made in CL 19159126 revealed a problem with type promotions: it's too strict when it comes to finding matching functions. This is currently preventing a  BP class from compiling, which is blocking Dev-EngineMerge.

We need to modify ArePinTypesEquivalent to be less strict about real number comparisons, which permits using single precision float pins with double precision math functions.

#jira UE-144351
#preflight 621ec6c331454c90cce33859
#rb Marc.Audy
#lockdown


#ROBOMERGE-AUTHOR: dave.jones2
#ROBOMERGE-SOURCE: CL 19224349 via CL 19226280 via CL 19226464 via CL 19226631 via CL 19226810
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19230290 by dave jones2 in ue5-main branch]
2022-03-02 16:53:08 -05:00
dave jones2
913ad8df93 UE-143681 - Constructed object in BP is ignoring override value for exposed float property
Two issues were discovered:

1. UKismetSystemLibrary::SetFloatPropertyByName is no longer used since it's been replaced by SetDoublePropertyByName. As a result, SetDoublePropertyByName would fail if the property was actually a float, which can happen if it's a native class. In this case, we should check for a FFloatProperty as a fallback.
2. Deprecation of float<->string converion functions in CL 19083449 introduced a regression: we can no longer use autocasts when the type is a single-precision float. In this case, we should search for autocast functions that take a double instead.

#jira UE-143681
#preflight 62181516783beeaf8ae8db8b
#rb andy.davidson
#lockdown julien.marchand

#ROBOMERGE-AUTHOR: dave.jones2
#ROBOMERGE-SOURCE: CL 19157869 in //UE5/Release-5.0/... via CL 19159851
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19161495 by dave jones2 in ue5-main branch]
2022-02-25 19:47:52 -05:00
michael noland
8267e386da Blueprints: Added a cvar to control the how Reals are presented to users in the Blueprint editor, changing the default to Float
#jira UE-143287
#preflight 621135dce75c3475c7c8c993
#rb Marc.Audy

#ROBOMERGE-AUTHOR: michael.noland
#ROBOMERGE-SOURCE: CL 19082558 in //UE5/Release-5.0/... via CL 19097129
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19140882 by michael noland in ue5-main branch]
2022-02-24 23:33:34 -05:00
Phillip Kavan
1d9df9cd9a Allow unloaded type assets to be included in the member type selector in the user-defined structure editor.
#jira UE-132060
#rb Benjamin.Fox
#preflight 6215640cbd3bdd90869bcc41

[CL 19096200 by Phillip Kavan in ue5-main branch]
2022-02-23 13:46:16 -05:00
Tim Smith
cd07867bf6 1) Adding new collection of UE types into C#
2) Enhancements to StringView and a few other helper classes
3) New UE style ignore case comparison
4) Moved shared UHT definitions into a common C# file.

#rb jonathan.adamczewski
#rnx
#preflight 620e3cdc8b6428e701a24666

[CL 19033446 by Tim Smith in ue5-main branch]
2022-02-17 07:40:56 -05:00
jack cai
94ab4283b8 Control Rig: Added BlueprintInternalUseOnlyHierarchical tag that can be inherited by derived structs. Addded this tag to base rig unit to hide all raw rig unit structs from BP
previous change at CL 18866227 was backed out because it broke the bot1 cooks: https://horde.devtools.epicgames.com/log/61ffcf94676584e71ea0ab7e?lineindex=104697

Basically GetBoolMetaDataHierarchical returns the wrong thing and the return pin can no longer be broken up and so the blueprint won't compile.

#jira UE-141083
#rb helge.mathee sara.schvartzman ben.hoffman
#preflight https://horde.devtools.epicgames.com/job/62018bbd62420bfd0493e404

#ROBOMERGE-AUTHOR: jack.cai
#ROBOMERGE-SOURCE: CL 18907822 via CL 18907834 via CL 18907851 via CL 18918946 via CL 18919865
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v916-18915374)

[CL 18919918 by jack cai in ue5-main branch]
2022-02-09 12:15:30 -05:00
aurel cordonnier
ec4537cf48 [Backout] - CL18866227
#fyi jack.cai
Original CL Desc
-----------------------------------------------------------------
Control Rig: Added BlueprintInternalUseOnly="true" to the basel rig unit struct so that all derived rig unit structs don't appear in the pin type drop down menu and create confusion

#jira UE-141083
#rb helge.mathee sara.schvartzman ben.hoffman
#preflight https://horde.devtools.epicgames.com/job/61fc0ed3af01d3caef14ccb1

[CL 18882380 by aurel cordonnier in ue5-main branch]
2022-02-06 16:54:22 -05:00
jack cai
37b6eb0784 Control Rig: Added BlueprintInternalUseOnly="true" to the basel rig unit struct so that all derived rig unit structs don't appear in the pin type drop down menu and create confusion
#jira UE-141083
#rb helge.mathee sara.schvartzman ben.hoffman
#preflight https://horde.devtools.epicgames.com/job/61fc0ed3af01d3caef14ccb1

[CL 18866227 by jack cai in ue5-main branch]
2022-02-04 13:00:49 -05:00
dave jones2
ed1b4ed6a5 UE-140327 - Remove ENABLE_BLUEPRINT_REAL_NUMBERS usage
The original ENABLE_BLUEPRINT_REAL_NUMBERS macro was strictly meant for AB testing in the Dev-LWC. Currently, disabling it won't work, and would likely lead to broken behavior. Its presence might incorrectly indicate to licensees that this is an option that can be toggled safely.

#rb marc.audy
#jira UE-140327
#preflight 61fc6449dc0b3ecbecb6f381
#lockdown julien.marchand

#ROBOMERGE-AUTHOR: dave.jones2
#ROBOMERGE-SOURCE: CL 18864654 in //UE5/Release-5.0/... via CL 18864683 via CL 18864993
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18865002 by dave jones2 in ue5-main branch]
2022-02-04 11:54:52 -05:00
jurre debaare
92fa622bf6 Variable watch within state machines is broken
- Ensure that any folded AnimNode property gets remapped correctly for pin-to-property map in FBlueprintDebugData
- Ensure  pin value watching for folded properties retrieves the correct value
- Const-ifying some code paths around blueprint pin watching
#jira UE-139995
#preflight 61fa624ddb42673a60239ce1
#rb Thomas.Sarkanen
#lockdown Cristina.Riveron

#ROBOMERGE-AUTHOR: jurre.debaare
#ROBOMERGE-SOURCE: CL 18824229 in //UE5/Release-5.0/... via CL 18825883 via CL 18826298
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18826349 by jurre debaare in ue5-main branch]
2022-02-02 09:54:14 -05:00
dave jones2
c8574d3b74 Merging //UE5/Dev-LargeWorldCoordinates [at] 18802167 to //UE5/Release-5.0
Blueprint real number support.

This change deprecates the use the of "float" and "double" types in Blueprints in favor of a new "real". By default, "real" is back by a double precision floating point number. However, it can be single precision if the number is a native float property or function parameter. This distinction won't be visible to the Blueprint user: in both instances, they'll be represented by "real" pin types. During deserialization, we'll automatically convert Blueprint pin types to use real/doubles, unless they're used to represent native code (including delegate signatures).

One consequence of this change is that we need to perform implicit casts between single and double precision real numbers. During Blueprint compilation, the compiler will detect points in the graph for when either a widening or narrowing conversion needs to occur. Subsequently, the script bytecode will contain a new cast instruction that performs the conversion. This also works on container types, but each entry in the container will have to be converted. This can introduce unwanted overhead for large containers that are frequently passed between Blueprint and native code.

The scope of this change affects Blueprints used by Gameplay, Animation, Control Rig, and UMG.

#rb marc.audy (serialization changes)
#jira UE-116484
#preflight 61f8bdd5a2514ba12ff7bdfc

#ROBOMERGE-AUTHOR: dave.jones2
#ROBOMERGE-SOURCE: CL 18809077 in //UE5/Release-5.0/... via CL 18809455 via CL 18822548
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545)

[CL 18823569 by dave jones2 in ue5-main branch]
2022-02-02 05:50:50 -05:00
benjamin fox
57011b5f32 Disable Pin Value Inspection Tooltips for Pose Pins in AnimBPs
#jira UE-136038
#rb ben.hoffman
#preflight 61d4b8bad17842e547ab783d

#ROBOMERGE-AUTHOR: benjamin.fox
#ROBOMERGE-SOURCE: CL 18512890 in //UE5/Release-5.0/... via CL 18512942
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18512978 by benjamin fox in ue5-release-engine-test branch]
2022-01-04 16:30:54 -05:00
ben hoffman
88467d9636 Add metadata to hide the asset picker on Object pins
#jira none
#rb todo
#rnx
#preflight 61b7e6ea1a4451f7ba2231df

#ROBOMERGE-AUTHOR: ben.hoffman
#ROBOMERGE-SOURCE: CL 18450774 in //UE5/Release-5.0/... via CL 18450790
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v898-18417669)

[CL 18450792 by ben hoffman in ue5-release-engine-test branch]
2021-12-13 19:51:56 -05:00