ClassPaths are stored in FBlueprintTags::GeneratedClassPath, FBlueprintTags::ParentClassPath, FBlueprintTags::NativeParentClassPath, and are read by many locations in editor code. But these locations do not all handle CoreRedirects, and use the old names of the classes when there has been a PackageRedirect or a ClassRedirect, breaking the functionality of whatever operation is using it.
Add utility functions for reading these tags from the AssetRegistry and change all existing locations to use it.
Examples:
ComponentTypeRegistry.cpp line 628
// GetAssetsByClass call is a kludge to get the full asset paths for the blueprints we care about // Bob T. thinks that the Asset Registry could just keep asset paths TArray<FAssetData> Assets; AssetRegistry.GetAssetsByClass(UBlueprint::StaticClass()->GetClassPathName(), Assets, true); for (FAssetData& BPAsset : Assets) { FTopLevelAssetPath ClassPath(FEditorClassUtils::GetClassPathNameFromAssetTag(BPAsset)); if (!ClassPath.IsNull()) {
GameplayCueManager.cpp line 888
FGameplayTag GameplayCueTag = Manager.RequestGameplayTag(FoundGameplayTag, false); if (GameplayCueTag.IsValid()) { // Add a new NotifyData entry to our flat list for this one FSoftObjectPath StringRef; StringRef.SetPath(FPackageName::ExportTextPathToObjectPath(GeneratedClassTag)); OutCuesToAdd.Add(FGameplayCueReferencePair(GameplayCueTag, StringRef));
FPrimaryAssetId FAssetData::GetPrimaryAssetId() const { FName PrimaryAssetType = GetTagValueRef<FName>(FPrimaryAssetId::PrimaryAssetTypeTag); FName PrimaryAssetName = GetTagValueRef<FName>(FPrimaryAssetId::PrimaryAssetNameTag); //Edit Begin - Use Redirected Asset Name from FPrimaryAssetId::PrimaryAssetNameTag PrimaryAssetName = FCoreRedirects::GetRedirectedName(ECoreRedirectFlags::Type_Package, FCoreRedirectObjectName(NAME_None, NAME_None, PrimaryAssetName)).PackageName; //Edit End - Use Redirected Asset Name from FPrimaryAssetId::PrimaryAssetNameTag if (!PrimaryAssetType.IsNone() && !PrimaryAssetName.IsNone()) { return FPrimaryAssetId(PrimaryAssetType, PrimaryAssetName); } return FPrimaryAssetId(); }
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-202303 in the post.
0 |
Component | UE - Foundation - Core - Cooker |
---|---|
Affects Versions | 5.3 |
Target Fix | 5.6 |
Main Commit | 30320595 |
---|
Created | Dec 11, 2023 |
---|---|
Updated | Oct 18, 2024 |