Commit Graph

18 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
mikko mononen
6111ab76c4 PropertyBag: allow to load bags with missing types.
- Allow to load property bags with missing struct, enum, and object types
- Mark missing types with specific types so that we can report error in the UI
- Report missing types in the UI

#jira none
#preflight 6285f4abbf7dfd7f057d3bcd

[CL 20277109 by mikko mononen in ue5-main branch]
2022-05-19 03:48:22 -04:00
lauren barnes
5055406ba5 Fixing EditorStyle->AppStyle merge errors
#rb trivial

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

[CL 20105762 by lauren barnes in ue5-main branch]
2022-05-09 13:32:48 -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
mikko mononen
739a976ab0 PropertyBag: Moved internal methods into lambdas to avoid exposing types in header
#jira UE-150401
#rb Mieszko.Zielinski
#preflight 626a45ed0464895bc5f91a0e

[CL 19954490 by mikko mononen in ue5-main branch]
2022-04-28 03:48:27 -04:00
christopher waters
c848b53f89 Fixing various NonUnity compile errors.
#jira none
#rb none
#preflight 626990c02735a2c0ea8cc96b

[CL 19946125 by christopher waters in ue5-main branch]
2022-04-27 16:20:41 -04:00
jamie dale
6071834747 Fixed FInstancedStruct edits not propagating to instances when editing a CDO
Only the ImportText flow of changing a property actually calls PropagatePropertyChange, so we need to use SetPerObjectValues (which calls ImportText internally) rather than directly copy the struct state.

#jira
#rb Rex.Hill, Mikko.Mononen

#ROBOMERGE-AUTHOR: jamie.dale
#ROBOMERGE-SOURCE: CL 19918614 via CL 19920983 via CL 19921157
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 19923192 by jamie dale in ue5-main branch]
2022-04-26 12:54:29 -04:00
mikko mononen
8824b8d398 Property Bag: Fixed layout and other improvements
- Changed GetOrCreateFromDescs() to always ensure on errors
- Added method to migrate to another property bag instance
- Added metatag "FixedLayout" which allows to only edit values, not layout
- Changed the details customization to be allowed to embed in other customizations

#jira UE-147507
#review
#preflight 6267da5a272f4a558dbcedf6

[CL 19918231 by mikko mononen in ue5-main branch]
2022-04-26 07:56:14 -04:00
marc audy
006002155d Fix non-unity no-pch issues
#preflight 626180076119a1a496ab2bdf
#rnx

[CL 19852196 by marc audy in ue5-main branch]
2022-04-21 13:34:58 -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
mikko mononen
898275734f Property Bag: UPropertyBag and FInstancedPropertyBag
- Property bags allows to create customs structs via code or UI and store them in an property bag instance
- Bags are identified by their layout, a UScriptStruct is created for each unique layout
- The instances serialize the layout, not the type, to simplify handling with old data
- Property values can be migrated between different bags

#jira UE-147507
#review
#preflight 625e96dbdb15ac92db919089

[CL 19806374 by mikko mononen in ue5-main branch]
2022-04-19 07:13:19 -04:00
josh may
a389b01905 [Backout] - CL19681262
[FYI] Nick.Darnell
Original CL Desc
-----------------------------------------------------------------
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.

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

#p4v-cherrypick 18826515

#ROBOMERGE-AUTHOR: jamie.dale
#ROBOMERGE-SOURCE: CL 18826037 via CL 18826067 via CL 18826480 via CL 19776180 via CL 19776547 via CL 19776613
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v939-19570697)

[CL 19803101 by josh may in ue5-main branch]
2022-04-19 00:02:52 -04:00
nick darnell
72b9897d09 InstancedStruct - When cloning the instanced struct for editing, make sure to initialize the editable struct to match the source data.
[REVIEW] [at]Mikko.Mononen, [at]Jamie.Dale

#ROBOMERGE-AUTHOR: nick.darnell
#ROBOMERGE-SOURCE: CL 19683816 via CL 19683922 via CL 19684017
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v938-19570697)

[CL 19684362 by nick darnell in ue5-main branch]
2022-04-07 23:02:49 -04:00
jamie dale
d45257c2ba 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.

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

#ROBOMERGE-AUTHOR: jamie.dale
#ROBOMERGE-SOURCE: CL 18826037 in //UE5/Release-5.0/... via CL 18826067 via CL 18826480
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18826515 by jamie dale in ue5-main branch]
2022-02-02 10:02:39 -05:00
jamie dale
fa94dbbf19 Improved FInstancedStruct property editing stability
FInstancedStruct now edits a copy of the data (like FStructVariant did) to avoid issues where the detail panel would try and access invalid data. This copy is migrated back to the source whenever a property on the struct is edited, and the source is synced to the copy either every 0.1s or immediately on undo/redo or when the source is edited via its property handle.

The custom revert logic has been removed now that FInstancedStruct implements Identical correctly (as a deep-compare for a value type), and the customization now reads the meta-data from the correct property (to handle containers of FInstancedStruct) as well as handling the "HideViewOptions", "ShowTreeView", and CPF_NoClear meta-data that the standard struct picker supports.

#jira
#preflight 61eeeca1ef289ffc6df11ba7
#rb Mikko.Mononen

#ROBOMERGE-AUTHOR: jamie.dale
#ROBOMERGE-SOURCE: CL 18739655 via CL 18743464 via CL 18743615 via CL 18743717 via CL 18745443 via CL 18746261
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18746495 by jamie dale in ue5-main branch]
2022-01-26 17:30:43 -05:00
yoan stamant
8666a30872 [FInstancedStruct] filter out details view when metadata "Hidden" is used
#rb mikko.mononen
#preflight 61e05222250b9537f776ab02

#ROBOMERGE-AUTHOR: yoan.stamant
#ROBOMERGE-SOURCE: CL 18598619 in //UE5/Release-5.0/... via CL 18598638 via CL 18598650
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669)

[CL 18598660 by yoan stamant in ue5-main branch]
2022-01-13 12:17:28 -05:00
mikko mononen
fa60f81a8b Instanced Struct and StateTree: Fixed reset to default buttons (was previously crashing)
#jira none
#review
#robomerge 5.0

[CL 17941517 by mikko mononen in ue5-main branch]
2021-10-27 05:49:26 -04:00
Mieszko Zielinski
2266451827 Moved StructUtils plugin out of NotForLicensees and marked it as experimental.
#rb Mikko.Mononen
#preflight 607e6c0ed4e6700001476800

[CL 16058905 by Mieszko Zielinski in ue5-main branch]
2021-04-20 02:43:47 -04:00