From c30cb1052ece42448b18dcec8c45ef3f2c31b627 Mon Sep 17 00:00:00 2001 From: Jeffreytsai1004 Date: Fri, 18 Apr 2025 11:07:14 +0800 Subject: [PATCH] Update BooleanCutTool.cpp --- Source/FLESH/Private/BooleanCutTool.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Source/FLESH/Private/BooleanCutTool.cpp b/Source/FLESH/Private/BooleanCutTool.cpp index 39bec40..db8116a 100644 --- a/Source/FLESH/Private/BooleanCutTool.cpp +++ b/Source/FLESH/Private/BooleanCutTool.cpp @@ -125,7 +125,26 @@ TArray UBooleanCutTool::CutProceduralMesh(UProcedural TArray VertexColors; TArray Tangents; - TargetMesh->GetSectionMeshData(0, Vertices, Triangles, Normals, UVs, VertexColors, Tangents); + // 在 UE5.5.4 中,GetSectionMeshData 方法已不存在,改为使用 GetProcMeshSection 方法 + FProcMeshSection* MeshSection = TargetMesh->GetProcMeshSection(0); + if (MeshSection) + { + // 从 MeshSection 中提取数据 + for (const FProcMeshVertex& Vertex : MeshSection->ProcVertexBuffer) + { + Vertices.Add(Vertex.Position); + Normals.Add(Vertex.Normal); + UVs.Add(Vertex.UV0); + VertexColors.Add(Vertex.Color); + Tangents.Add(Vertex.Tangent); + } + + // 转换索引 + for (uint32 Index : MeshSection->ProcIndexBuffer) + { + Triangles.Add(static_cast(Index)); + } + } // Calculate intersection points between cut plane and mesh TArray IntersectionPoints = CalculateIntersectionPoints(Vertices, Triangles, CutPlane);