Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Editor/Tools/LightmapTransferTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3907,7 +3907,15 @@ static Dictionary<string, string> NormalizeExportHierarchy(GameObject root)
var mesh = childMf.sharedMesh;
if (!mesh.isReadable) continue;

BakeTransformIntoMesh(mesh, t);
// A cloned FBX hierarchy can contain several nodes that instance
// the same Mesh. Baking into sharedMesh directly would apply each
// node's transform cumulatively to that one object. Give every
// transformed node its own copy before mutating the vertex data.
var bakedMesh = UnityEngine.Object.Instantiate(mesh);
bakedMesh.name = mesh.name;
childMf.sharedMesh = bakedMesh;

BakeTransformIntoMesh(bakedMesh, t);

// Reset transform to identity
t.localPosition = Vector3.zero;
Expand Down
Loading