Skip to content

Commit

Permalink
Generate secondary UV set for lightmapping by default when baking bon…
Browse files Browse the repository at this point in the history
…es on Skinned Meshes
  • Loading branch information
wilk-polarny committed Oct 22, 2022
1 parent 803719b commit 6037b8e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions SimplestMeshBaker/Editor/BonesBaker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ private static int Bake(GameObject gameObject)
}
//and remove it
Undo.DestroyObjectImmediate(skinnedMeshRenderer);

// Generate UV2 for Lightmapping
Unwrapping.GenerateSecondaryUVSet(newMesh);

//add and setup meshFilter and meshRenderer
MeshFilter meshFilter = Undo.AddComponent<MeshFilter>(gameObject);
meshFilter.mesh = newMesh;
Expand Down

0 comments on commit 6037b8e

Please sign in to comment.