代码改变世界

ue4 替换软引用

2023-02-28 07:24  kk20161206  阅读(53)  评论(0编辑  收藏  举报

TMap<FSoftObjectPath, FSoftObjectPath> ActorRedirectorMap;

UTexture* baseTEx, diffuse, normalTex;

baseTex = mat->GetTextureParamValue("baseTex", baseTex);

normalTex= mat->GetTextureParamValue("normalTex", normalTex)

FSoftObjectPath PreviousActorSoftPath(baseTex);

ActorRedirectorMap.Emplace(PreviousActorSoftPath, diffuse);

FSoftObjectPath PreviousActorSoftPath1(normalTex);

ActorRedirectorMap.Emplace(PreviousActorSoftPath1, diffuse);

 

IAssetTools& AssetTools = FModuleManager::LoadModuleChecked<FAssetToolsModule>("AssetTools").Get();
AssetTools.RenameReferencingSoftObjectPaths( PackagesToCheck.Array(), ActorRedirectorMap );