Commit Graph

371 Commits

Author SHA1 Message Date
kevin macaulayvacher
2576f229f2 Changes FAssetHeaderPatcherInner to leverage the CoreRedirect system for resolving FNames in a package header, and string paths when context about the string itself is well known (i.e. we know the string data is a stringified ObjectPath/PackagePath, or ObjectName are deducible). We still make use of string scanning replacement mechanism but those are now constrained to only patching strings content specifically (e.g. Tag data)
- Added FAssetHeaderPatcher::FContext for storing data on how to perform a patch (which redirects to follow, string -> string replacement map). Allows for an extensibility point for encapsulating special case patching so we don't need to  rely on string->string mappings exclusively
- Added `virtual FArchive& operator<<(FTopLevelAssetPath& Value)` to `FActorDescArchive` to allow for patching of FTopLevelAssetPath directly. Without this overload the FNames within a FTopLevelAssetPath would be patched one at a time losing all context about what the FNames are.
- Removed IAssetTools::GetAdditionalPatchCopyMappings, GetPatchCopyMappingsForRootRename, and PatchCopyPackageFile as these methods were internal and using the patcher directly should be preferred.
- Added some unit tests for the FAssetHeaderPatcherInner implementation works to codify the assumptions and expectations of the patcher implementation

Set use HeaderPatching as true by default for CopyProjectWithHeaderPatching. AdvancedCopy still disables header patching (to be enabled in a follow-up change)

#rnx
#rb Dave.Belanger
[FYI] Francis.Hurteau
#p4v-cherrypick 36706626, 36741243

[CL 36858806 by kevin macaulayvacher in 5.5 branch]
2024-10-04 09:42:40 -04:00
kevin macaulayvacher
1a8ac06fbb [Backout] - CL36700789
[FYI] kevin.macaulayvacher
Original CL Desc
-----------------------------------------------------------------
Changes FAssetHeaderPatcherInner to leverage the CoreRedirect system for resolving FNames in a package header, and string paths when context about the string itself is well known (i.e. we know the string data is a stringified ObjectPath/PackagePath, or ObjectName are deducible). We still make use of string scanning replacement mechanism but those are now constrained to only patching strings content specifically (e.g. Tag data)

- Added FAssetHeaderPatcher::FContext for storing data on how to perform a patch (which redirects to follow, string -> string replacement map). Allows for an extensibility point for encapsulating special case patching so we don't need to  rely on string->string mappings exclusively
- Added `virtual FArchive& operator<<(FTopLevelAssetPath& Value)` to `FActorDescArchive` to allow for patching of FTopLevelAssetPath directly. Without this overload the FNames within a FTopLevelAssetPath would be patched one at a time losing all context about what the FNames are.
- Removed IAssetTools::GetAdditionalPatchCopyMappings, GetPatchCopyMappingsForRootRename, and PatchCopyPackageFile as these methods were internal and using the patcher directly should be preferred.
- Added some unit tests for the FAssetHeaderPatcherInner implementation works to codify the assumptions and expectations of the patcher implementation

New patching changes are left disabled by default

#rnx

#rb Dave.Belanger, JeanFrancois.Dube

[CL 36764539 by kevin macaulayvacher in 5.5 branch]
2024-10-01 20:43:42 -04:00
kevin macaulayvacher
73861a1e58 Changes FAssetHeaderPatcherInner to leverage the CoreRedirect system for resolving FNames in a package header, and string paths when context about the string itself is well known (i.e. we know the string data is a stringified ObjectPath/PackagePath, or ObjectName are deducible). We still make use of string scanning replacement mechanism but those are now constrained to only patching strings content specifically (e.g. Tag data)
- Added FAssetHeaderPatcher::FContext for storing data on how to perform a patch (which redirects to follow, string -> string replacement map). Allows for an extensibility point for encapsulating special case patching so we don't need to  rely on string->string mappings exclusively
- Added `virtual FArchive& operator<<(FTopLevelAssetPath& Value)` to `FActorDescArchive` to allow for patching of FTopLevelAssetPath directly. Without this overload the FNames within a FTopLevelAssetPath would be patched one at a time losing all context about what the FNames are.
- Removed IAssetTools::GetAdditionalPatchCopyMappings, GetPatchCopyMappingsForRootRename, and PatchCopyPackageFile as these methods were internal and using the patcher directly should be preferred.
- Added some unit tests for the FAssetHeaderPatcherInner implementation works to codify the assumptions and expectations of the patcher implementation

New patching changes are left disabled by default

#rnx

#rb Dave.Belanger, JeanFrancois.Dube

[CL 36764489 by kevin macaulayvacher in 5.5 branch]
2024-10-01 20:42:58 -04:00
robert rouhani
c9f59db7b1 Include all subcategories specified by UAssetDefinition in the New Content menu, instead of only using the first subcategory
#rb logan.buchy
#rnx

[CL 36317860 by robert rouhani in 5.5 branch]
2024-09-16 17:35:26 -04:00
rex hill
cbc63ec3ac Editor - When creating assets call new delegate to customize when to set package flag NotExternallyReferenceable
#rnx
#rb Dave.Belanger

[CL 36245385 by rex hill in 5.5 branch]
2024-09-12 17:02:59 -04:00
eric boucher
ef71ea2b5b New localization option to move localized variants alongside source asset in the content browser and another one to detect if those localized variants are only in Revision Control:
- Project Settings / Editor / Assets / Internationalization / Rename Localized Variants Alongside Source Asset (defaults to: true)
 - Project Settings / Editor / Revision Control / Internationalization / Requires Revision Control to Rename Localizable Assets (defaults to: false) (works only with Perforce)

#jira UE-216348
#rb Jamie.Dale, wouter.burgers
[RN]

[CL 35804579 by eric boucher in ue5-main branch]
2024-08-26 14:02:18 -04:00
andrea botti
2ebe050d72 [ContentBrowser] Thumbnail Playback Indicator
#jira UE-216440
#rb aditya.ravichandran, ben.hoffman

[CL 35693075 by andrea botti in ue5-main branch]
2024-08-21 06:09:31 -04:00
alexis matte
690485dca1 Fix localisation error
#jira UE-222228
#rb jeanluc.corenthin
#rnx

[CL 35668883 by alexis matte in ue5-main branch]
2024-08-20 16:46:43 -04:00
alexis matte
29b1b1f8f7 Fix crash in UAssetToolsImpl::CreateAssetWithDialog where the UFactory::GetSupportedClass() is deferenced without check if its null.
#jira UE-220877
#rb JeanLuc.Corenthin
#rnx

[CL 35628488 by alexis matte in ue5-main branch]
2024-08-19 12:32:42 -04:00
eric knapik
326df70ce8 Undo CL: 35599474
Static initialization on startup

[FYI] andrea.botti

[CL 35610973 by eric knapik in ue5-main branch]
2024-08-16 18:59:53 -04:00
andrea botti
b9f350d86e [ContentBrowser] Thumbnail Playback Indicator
#rb aditya.ravichandran, ben.hoffman, Brian.Chrisman
#jira UE-216440

[CL 35599483 by andrea botti in ue5-main branch]
2024-08-16 13:24:27 -04:00
jeanfrancois dube
b76aa9d3c8 [World Partition] Remove assert when trying to use advanced copy on a partitioned world with streaming enabled, since it now works.
#rb vincent.beauchemin

[CL 35593322 by jeanfrancois dube in ue5-main branch]
2024-08-16 09:58:10 -04:00
dave belanger
869e58024d - Expose IAssetTools::GetAdditionalPatchCopyMappings and added a exclusion check for external actor/object assets
- Rename IAssetTools::GetMappingsForRootPackageRename to GetPatchCopyMappingsForRootRename for clarity
#rb Francis.Hurteau, kevin.macaulayvacher
#rnx

[CL 35562044 by dave belanger in ue5-main branch]
2024-08-15 09:59:29 -04:00
andrew phillips
a05a432db0 Gathering dependencies now includes ExternalObjects.
Correction for External(Objects|Actors) path destination path generation.

#rb Francis.Hurteau, kevin.macaulayvacher, Richard.Malo

[CL 35418159 by andrew phillips in ue5-main branch]
2024-08-09 06:02:57 -04:00
kevin macaulayvacher
b497049ddd Adds GatherableTextData support to AssetHeaderPatching
- Now look for the optional GatherableTextData section when deserializing, patch the contents and write back out the data, patching up the summary size as necessary since this section does not have a fixed size based on item counts (i.e. it doesn't use the name table, so a string changes affect the size)
- Added additional mapping for VerseAssetPaths which appear in GeneratedTextData (e.g. /localhost/Normal/PackagePath/PackagePath)

#jira UE-216649
#rb Francis.Hurteau
#rnx

[CL 34614882 by kevin macaulayvacher in ue5-main branch]
2024-06-24 14:51:41 -04:00
yoan stamant
938f456b05 Moved UserDefinedStruct to CoreUObject
#jira UE-216472
#rb Devin.Doucette

[CL 34495793 by yoan stamant in ue5-main branch]
2024-06-19 08:00:57 -04:00
gary yuan
f85b2347ba [Backout] - CL34482589
[FYI] Yoan.StAmant
Original CL Desc
-----------------------------------------------------------------
Moved UserDefinedStruct to CoreUObject
#jira UE-216472
#rb Devin.Doucette

[CL 34486763 by gary yuan in ue5-main branch]
2024-06-18 20:05:51 -04:00
yoan stamant
b9344fb62e Moved UserDefinedStruct to CoreUObject
#jira UE-216472
#rb Devin.Doucette

[CL 34482607 by yoan stamant in ue5-main branch]
2024-06-18 17:57:11 -04:00
kevin macaulayvacher
1745059f8d Adds support for multiple plugins in AssetHeaderPatcher.
We now separate the passed in remapping paths to be categorized by plugin when considering mappings for external actors/objects.

#rb Dave.Belanger, Francis.Hurteau
#rnx

[CL 34317882 by kevin macaulayvacher in ue5-main branch]
2024-06-12 14:56:27 -04:00
kevin macaulayvacher
a42492642f Fixes AssetHeaderPatcher from generating incorrect remappings for strings containing a '_[0-9]+' suffix.
Special handling is done to add mappings for src -> dst strings with and without a '_[0-9]+' suffix since this suffix comes from FNames and will be stripped from the NameTable. Since we want to patch the NameTable we need to ensure any mapping with such a suffix also has a mapping for when its suffix is stripped. The previous code attempted to do this however it was only providing a mapping where the Src string stripped off the suffix and incorrectly mapped to the Dst string that still had its suffix. This made any lookup into the NameTable appear as if a new entry should be added but could instead result in new entries being added to the table that are identical to pre-existing entries once the number suffix is stripped. You could also have multiple Src strings such as 'SrcName_1' and 'SrcName_2' be given a 'SrcName' -> 'DestName1', 'SrcName' -> 'DestName2'  mapping which is ambiguous.

The new code does the following:
- Avoid creating FNames from input strings to check if the string contains a '_[0-9]+' suffix and instead does a reverse scan of the string. This avoids FName allocations and unnecessary string copies.
- Strips number suffixes from both Src and Dst when they exist, mapping the stripped versions of both to one another
- Only provides a PackageName mapping when SrcPackage and DstPackage don't match otherwise we do unnecessary stripping, lookups and patching

#rb Francis.Hurteau
#rnx

[CL 34180940 by kevin macaulayvacher in ue5-main branch]
2024-06-06 19:11:49 -04:00
kevin macaulayvacher
471b87e1df Allow AssetHeaderPatching validation to pass for Talisman by removing the additional mapping for names with numbers appended. This will be properly addressed in FORT-752134
#rb Francis.Hurteau
#rnx
[FYI] andrew.phillips

[CL 34145238 by kevin macaulayvacher in ue5-main branch]
2024-06-05 20:16:36 -04:00
kevin macaulayvacher
276b4f0c45 Fixes an issue in Asset Header Patching where we would find the source PackageRootName and replace any string that matches it with the destination PackageRootName. This replacing would result in potentially ignoring the mapping the user provided but also potentially rename various asset paths that happen to contain the same substring as the source PackageRoot.
We now break the passed in Long-form Package paths into their 2/3 parts, PackageRoot, PackagePath (might be empty) and PackageName, and create mappings from source -> destination only when the exact portions of the path map. Special handling is needed for the __ExternalActors__ and __ExternalObjects__ directories since remapping a package may require the subdirectories under __ExternalActors__ to need remapping as well, in addition to the SrcPackageRoot -> DstPackageRoot change.

#rb Dave.Belanger, Francis.Hurteau
#rnx

[CL 34126213 by kevin macaulayvacher in ue5-main branch]
2024-06-05 11:20:27 -04:00
andrew phillips
d42f70e0d0 Adding Multi root remapping to header patcher for Duplicate plugin.
#ushell-cherrypick of 33722350 by andrew.phillips
#rb Francis.Hurteau

[CL 34031587 by andrew phillips in ue5-main branch]
2024-05-31 09:56:56 -04:00
julien stjean
10402eed8a Fixed a crash when canceling an asset migration. When moving back the packages to their original path there could be some packages left from the migration.
#jira UE-215128
#rb Alexis.Matte

[CL 33860163 by julien stjean in ue5-main branch]
2024-05-23 09:35:57 -04:00
alexis matte
52a47b3637 AssetTools: Add a IAssetTools::SanitizeName function. Interchange call the new sanitize code API when sanitizing a name, not when sanitizing a path.
#jira UE-215108
#rnx
#rb Dave.Belanger, JeanLuc.Corenthin

[CL 33791465 by alexis matte in ue5-main branch]
2024-05-21 08:37:48 -04:00