FAssetData对象的创建

#480
 FAssetData ShadowCaptureActorAssetData(
 		TEXT("/SURAPlugin/ARShadow/ShadowGenerator/BluePrints/ShadowCapture"),
 		TEXT("/SURAPlugin/ARShadow/ShadowGenerator/BluePrints"),
 		TEXT("ShadowCapture"),
 		TEXT("Blueprint")
 ); // asset路径在编辑器里通过Reference Viewer可以获得
调用的是如下构造函数:
FAssetData(InPackageName, InPackagePath, InAssetName, InAssetClass)
UE5.1版的新API形式:
 // Run test on a single TestPlan asset
 FName PackageName = FName(FPaths::GetBaseFilename(Path, false));
 FName PackagePath = FName(FPaths::GetPath(Path));
 FName AssetName = FName(FPaths::GetBaseFilename(Path, true));
 FTopLevelAssetPath ClassName = UInterchangeImportTestPlan::StaticClass()->GetClassPathName();
 FInterchangeImportTestData& TP = TestPlans.AddDefaulted_GetRef();
 TP.AssetData = FAssetData(PackageName, PackagePath, AssetName, ClassName);

UObject类型获取其Asset Path

FTopLevelAssetPath ClassName =  UObject::StaticClass()->GetClassPathName();


//
// 注意这里UObject类型的AssetPath都是【/Script/Package.Class】的固定格式
// 之所以是这个固定格式,是因为其.generated.h里有DECLARE_CLASS宏调用,其注册的该UObject的PackagePath就是【/Script/Package】的格式
// 例如:/Script/Engine.Blueprint表示Engine模块的UBlueprint
// 
UClass* USuraControlPanelCommonBPLibrary::LoadCppClass( const FString& AssetPath )
{
	return ::StaticLoadClass(UObject::StaticClass(), nullptr, *AssetPath);
}

UObject Paths

Every Asset and Actor that the Unreal Editor has loaded in memory has a path that uniquely identifies it.
In general, these object paths follow the format:
 /path/PackageName.ObjectName:SubObjectName.SubObject
Programmers who work with the Engine in C++ may recognize this format as the same one accepted by functions like FindObject() and StaticFindObject().
For example, to deconstruct an Actor path shown in the request examples above:
/Game/ThirdPersonBP/Maps/The path to the Asset in the Content Browser.
ThirdPersonExampleMap.ThirdPersonExampleMap:The name of the package and the object it contains (for many Assets, these will be the same).
PersistentLevel.CubeMesh_5.StaticMeshComponent0The path through a hierarchy of sub-objects to the object you want to affect.
如上表所示,Path部分很好理解,在Content Browser里可以直接看到。而PackageName通常就是资产文件名,资产里包含若干Object,它们各有ObjectName,即资产文件其实是个Package