Commit Graph

1178 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
sebastian nordgren
7436ea67f4 Duplicating array entries containing a null UObject*/TObjectPtr no longer crashes.
We were blindly assuming that CurrentObject was non-null and crashing on CurrentObject->GetOuter(), even though DuplicateObject() itself was safe to call with null.

#review-20365567 @lauren.barnes
#jira UE-151124
#preflight 628e4dccf622d972b58a1e26

[CL 20429746 by sebastian nordgren in ue5-main branch]
2022-05-30 07:06:45 -04:00
robert manuszewski
edd3a01111 Fixing SPropertyEditorAsset not supporting class path names when filtering assets
#rb Jay.Nakai
#preflight 628f56db9d313ae1c7e5200d

#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 20377930 via CL 20377933 via CL 20377934 via CL 20377935
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246)

[CL 20382195 by robert manuszewski in ue5-main branch]
2022-05-26 14:27:27 -04:00
sebastian nordgren
78c273fea4 TitleProperty values are now retrieved recursively. This was a regression from UE4 that caused issues in cases that should have worked, eg. an array of instanced objects, because the category node would cause the search to end.
FPropertyNode::FindChildNode is now actually breadth-first, rather than only being breadth-first for a single level. This was causing an issue whereby title properties were being incorrectly retrieved from the first child rather than the topmost child.

Reported from UDN: https://epicgames.lightning.force.com/lightning/r/Case/5004z00001eFeYlAAK/view

#review @nick.darnell, @mikko.mononen
#preflight 628bb2d4183c1e13462d50cd

[CL 20364792 by sebastian nordgren in ue5-main branch]
2022-05-25 10:56:17 -04:00
scott nelson
8bc36199e2 Fix Null access crash in MaterialList
#rb Alexis.Matte
[FYI] Rex.Hill

#ROBOMERGE-AUTHOR: scott.nelson
#ROBOMERGE-SOURCE: CL 20355903 via CL 20355929 via CL 20356007 via CL 20356029
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v948-20297126)

[CL 20357497 by scott nelson in ue5-main branch]
2022-05-24 18:37:51 -04:00
scott nelson
e617dd3cf0 Fix Private Materials unable to be referenced within same Plugin via asset picker
#rb Rex.Hill
#preflight 628c7900d8258814a9f1508a

#ROBOMERGE-AUTHOR: scott.nelson
#ROBOMERGE-SOURCE: CL 20348402 via CL 20348414 via CL 20348589 via CL 20348662
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v948-20297126)

[CL 20352071 by scott nelson in ue5-main branch]
2022-05-24 14:06:40 -04:00
sebastian nordgren
6067be8cd7 We now cache the paths to the objects that we modify in FPropertyNode::NotifyPostEditChange() before we call CanEditChange(Chain)Property.
This causes all the modified objects to have their PostEditChangeProperty() handlers called even if the construction script of a blueprint class is triggered by the first invocation.

Most notably, this fixes the case where multiple components of an actor are multi-selected and edited at the same time, but only one of them will receive a PostEditChangeProperty() call.

Reported from UDN: https://epicgames.lightning.force.com/lightning/r/Case/5004z00001eEzehAAC/view

#review-20292399 @lauren.barnes, @marc.audy
#preflight 628ca47af237058787b96692

[CL 20345739 by sebastian nordgren in ue5-main branch]
2022-05-24 05:39:10 -04:00
HertzDonut
90f1d6a993 UStructs can now provide a CanEditChange override by setting the TStructOpsTypeTraitsBase2::WithCanEditChange trait.
PR #8877: Contributed by HertzDonut

#rb sebastian.nordgren
#preflight 628b6da1183c1e134617e4c3

[CL 20323458 by HertzDonut in ue5-main branch]
2022-05-23 07:33:11 -04:00
vlad golovan
18eaee09f1 Improvements to PropertyGenerationAllowListPaths feature to hide and remove validation on properties nodes not shown. Improves editor tick time.
[REVIEW] [at]marshall.beachy, [at]jay.Nakai, [at]sebastian.nordgren
#rb sebastian.nordgren

#ROBOMERGE-AUTHOR: vlad.golovan
#ROBOMERGE-SOURCE: CL 20182570 via CL 20182589 via CL 20182597
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20184274 by vlad golovan in ue5-main branch]
2022-05-13 13:44:48 -04:00
jamie dale
3a7c7728f1 Allow the temporary used by PropagatePropertyChange to behave as if it had been loaded
Some property types may rely on PPF_SerializedAsImportText to allocate extra state that's required for accurate comparison against another instance

#jira
#rb Rex.Hill
#rnx

#ROBOMERGE-OWNER: jamie.dale
#ROBOMERGE-AUTHOR: jamie.dale
#ROBOMERGE-SOURCE: CL 20180858 via CL 20180979 via CL 20181019 via CL 20181058 via CL 20181073
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20182513 by jamie dale in ue5-main branch]
2022-05-13 12:07:00 -04:00
sebastian nordgren
c1a5b2f838 SPropertyMenuComponentPicker::CanPaste() no longer causes log spam if a string containing a space is in the clipboard.
#jira UE-151446
#review-20127401 @patrick.boutot
#preflight 627b90c91e749933437c4957

[CL 20136084 by sebastian nordgren in ue5-main branch]
2022-05-11 06:44:18 -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
jack cai
0f1f740e66 SStructureDetailView: Fixed: setting custom name wasn't working
#jira none
#rb sebastian.nordgren
#preflight skip

[CL 20068222 by jack cai in ue5-main branch]
2022-05-05 22:05:04 -04:00
scott nelson
8fd06649ae [Backout] - CL20014556
[FYI] scott.nelson
Original CL Desc
-----------------------------------------------------------------
Pass PropertyHandle through MaterialList PropertyEntryBox so that AssetReferenceFilter can access the property source
#rb Dave.Belanger
#preflight 626c698b9e6bef17921880b6

#ROBOMERGE-AUTHOR: scott.nelson
#ROBOMERGE-SOURCE: CL 20015741 via CL 20015772 via CL 20015783 via CL 20015806
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20017273 by scott nelson in ue5-main branch]
2022-05-02 18:28:22 -04:00
scott nelson
cf85686c2d Pass PropertyHandle through MaterialList PropertyEntryBox so that AssetReferenceFilter can access the property source
#rb Dave.Belanger
#preflight 626c698b9e6bef17921880b6

#ROBOMERGE-AUTHOR: scott.nelson
#ROBOMERGE-SOURCE: CL 20014556 via CL 20014584 via CL 20014763 via CL 20014996
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20017231 by scott nelson in ue5-main branch]
2022-05-02 18:26:59 -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
sebastian nordgren
03d85c24d3 Siimple nodes were also being duplicated into the Advanced dropdown as a result of my previous fix.
#jira UE-147924
#review-20008195 @lauren.barnes
#preflight 626ff178ad00dced62c5db5c

[CL 20009417 by sebastian nordgren in ue5-main branch]
2022-05-02 11:46:19 -04:00
sebastian nordgren
743d147b49 Restored grouping for situations where the same struct or component exists multiple times in the same details view, eg. when two components derive from the same base.
#jira UE-147924
#review-20007328 @lauren.barnes
#preflight 626fce82220f89f0ad3e1952

[CL 20007876 by sebastian nordgren in ue5-main branch]
2022-05-02 09:48:37 -04:00
sebastian nordgren
777ae5e1c7 FPropertyRowGenerator::RequestRefresh() now triggers a refresh on the next Tick().
#jira UE-127360
#review-19916833 @frank.fella
#preflight 626908ad4c09420241047cdf

[CL 19936450 by sebastian nordgren in ue5-main branch]
2022-04-27 05:26:10 -04:00
sebastian nordgren
8eafe4f70e Editor configs now correctly diff against the CDO when serializing.
Previously, I had assumed that FProperty::InitializeValue() would initialize a simple member (eg. a float) to the correct value, but this appears not to be the case, rather values are zero-initialized and the CDO stores the correct default values. In the case of structs, InitializeStruct() does in fact initialize correctly.

However, this means that we can't use GetMutableDefault() to get an instance of the UObject, since then we're changing what we're diffing against and serialize no values. Changed the usages of this pattern to use singletons instead.

#jira UE-141150
#review-19900014 @lauren.barnes, @aditya.ravichandran
#preflight 6267fa44a021c91a50f26a65

[CL 19919719 by sebastian nordgren in ue5-main branch]
2022-04-26 10:20:56 -04:00
sebastian nordgren
014a2dfdd7 Ensure now takes into account the third way that SPropertyEditorCombo can be validly used by passing in three delegates in the args struct.
#review-19865398 @lauren.barnes
#jira UE-149879
#preflight 6262c366d558dfdec38ffeef

[CL 19900009 by sebastian nordgren in ue5-main branch]
2022-04-25 06:40:09 -04:00
sebastian nordgren
0933fac735 Added default value of true to IsParentEnabled in FDetailPropertyRow::GetEnabledState().
This is a pretty rare case that only occurs if you bypass OnItemNodeInitialized() by creating and adding a property row outside of a CustomizeDetails() call in a property customization. However, the use case is pretty innocuous and this seems more correct anyway, so there's not really any harm to changing the behaviour.

Reported in UDN case 00426747.

#review-19806378 @lauren.barnes
#preflight 6261522f080c66006373c9e5

[CL 19848082 by sebastian nordgren in ue5-main branch]
2022-04-21 09:11:05 -04:00
sebastian nordgren
9251e7450a SPropertyEditorCombo now correctly checks the editability of the IPropertyHandle passed to it in ComboArgs.PropertyHandle.
Added ensure to check that either the PropertyEditor or PropertyHandle passed is valid.

Reported through UDN.

#review @lauren.barnes
#preflight 624d78d08d1db441a91f35e8

[CL 19847726 by sebastian nordgren in ue5-main branch]
2022-04-21 08:45:50 -04:00
sebastian nordgren
e9f37a7a0b Added the owning struct name to EditCondition error messages to make it easier to find which property is breaking.
#review-19646989 @lauren.barnes
#preflight 624d9f5f7d2eea4e18f1e9fa

[CL 19847710 by sebastian nordgren in ue5-main branch]
2022-04-21 08:45:12 -04:00
jamie dale
f842a61eef Allow AddChildStructure to be used by sparse data properties
The child struct properties can't inherit the sparse data flag, as FStructurePropertyNode is already directly editing a block of struct memory.

This also includes a workaround for a crash when propagating changes from a FStructurePropertyNode nested within an object, as the sparse data flag used to workaround it but that is no longer set.

#jira UE-140961
#preflight 61fa9368ad2ae6c3b75c1d66
#rb Mikko.Mononen

#ROBOMERGE-AUTHOR: jamie.dale
#ROBOMERGE-SOURCE: CL 19816629 via CL 19819868 via CL 19820375
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v939-19570697)

[CL 19821914 by jamie dale in ue5-main branch]
2022-04-19 19:28:11 -04:00