Skip to content

Commit

Permalink
fix missing meshes (umap)
Browse files Browse the repository at this point in the history
  • Loading branch information
MinshuG committed Jan 5, 2023
1 parent eecf5f1 commit 41ebad4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions FModel/Views/Snooper/Renderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,18 @@ private void WorldMesh(UObject actor, Transform transform)
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;
Expand Down

0 comments on commit 41ebad4

Please sign in to comment.