From 8ad1705e7546605203a468be9b41011a072b8b69 Mon Sep 17 00:00:00 2001 From: SashaRX Date: Thu, 6 Aug 2026 13:45:41 +0200 Subject: [PATCH] Avoid cumulative transform baking on shared meshes --- Editor/Tools/LightmapTransferTool.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Editor/Tools/LightmapTransferTool.cs b/Editor/Tools/LightmapTransferTool.cs index 4e680229..c838784b 100644 --- a/Editor/Tools/LightmapTransferTool.cs +++ b/Editor/Tools/LightmapTransferTool.cs @@ -3907,7 +3907,15 @@ static Dictionary 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;