fix missing meshes (umap)

This commit is contained in:
Minshu Gurjar 2023-01-05 18:19:42 +05:30
parent eecf5f16ce
commit 41ebad422d
No known key found for this signature in database
GPG Key ID: 4759CA2350A7AE61

View File

@ -262,9 +262,18 @@ public class Renderer : IDisposable
staticMeshComponent.Load() is not { } staticMeshComp) return;
if (!staticMeshComp.TryGetValue(out FPackageIndex staticMesh, "StaticMesh") && actor.Class is UBlueprintGeneratedClass)
{
foreach (var actorExp in actor.Class.Owner.GetExports())
if (actorExp.TryGetValue(out staticMesh, "StaticMesh"))
break;
var super = actor.Class.SuperStruct.Load<UBlueprintGeneratedClass>();
if (staticMesh == null && super != null) { // look in parent struct if not found
foreach (var actorExp in super.Owner.GetExports()) {
if (actorExp.TryGetValue(out staticMesh, "StaticMesh"))
break;
}
}
}
if (staticMesh?.Load() is not UStaticMesh m || m.Materials.Length < 1)
return;