Skip to content

Commit

Permalink
fix crash when no normals found
Browse files Browse the repository at this point in the history
  • Loading branch information
irajsb committed Feb 25, 2023
1 parent fc0eea8 commit 145fdd8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Source/UE_Assimp/Private/AIMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,15 @@ UStaticMesh* UAIMesh::GetStaticMesh()

auto Instance = MeshDescBuilder.AppendInstance(VertexID);
VertexInstances[Index] = Instance;

if(Mesh->HasNormals())
{
MeshDescBuilder.SetInstanceNormal(Instance,ToVector(Mesh->mNormals[Index]));
}else
{
UE_LOG(LogAssimp,Warning,TEXT("Normals not found consider generating them with assimp"))
}

if (Mesh->HasTextureCoords(0))
{
MeshDescBuilder.SetInstanceUV(
Expand Down

0 comments on commit 145fdd8

Please sign in to comment.