5.8 USplineRemeshModifier selects no triangles (coordinate-space mismatch)

Summary

Engine: UE 5.8 (source tag verified against d:\uegit, up to date with 5.8) Module: MeshPartitionEditor (MeshTerrainMode / MeshPartition — Experimental) Severity: Modifier silently does nothing; no error/warning.
USplineRemeshModifier produces no remesh/tessellation whenever the MeshPartition’s input mesh local space differs from world space — e.g. when the MeshPartition actor is not at the world origin (a common case when aligning an imported terrain). The ROI triangle selection reads submesh-local vertex positions and treats them as world positions, so the spline distance test runs in the wrong space and selects zero triangles. The non-spline URemeshModifier (box) works correctly under identical conditions.

What Type of Bug are you experiencing?

World Creation Tools

Steps to Reproduce

  1. Create a Mega Mesh (MeshTerrainMode) terrain. Place the MeshPartition actor at a nonzero offset (we use Z = -133570 to align an imported heightmap to existing content).
  2. Add a USplineRemeshModifier (e.g. a Blueprint actor with a USplineComponent); bind SplineRef to that spline; set AffectedMegaMesh to the MeshPartition.
  3. Lay the spline on the terrain surface; set SplineRadius large enough to enclose terrain verts; CurrentOperation = Tessellate, bUseTargetEdgeLength = true, target edge length e.g. 100.

Expected Result

triangles within SplineRadius of the spline are tessellated.

Observed Result

no change. (Radius visualization draws correctly on the road, confirming the spline reference and transform resolve — only the selection fails.)

Affects Versions

5.8

Platform(s)

Windows

Additional Notes

Root cause
Engine/Plugins/Experimental/MeshPartition/Source/MeshPartitionEditor/Private/Modifiers/MeshPartitionSplineRemeshModifier.cpp

  • FMegaMeshSplineTessellateOp::ApplyModifications (and the Remesh variant) call:

SplineROI.GetTrianglesInSplineROI(SubMesh, InsideTriangles); // ← no InTransform

TessellateROI(SubMesh, InTransform, InsideTriangles); // ← uses InTransform

  • FSplineROI::GetTrianglesInSplineROI (open-spline branch) does:

const FVector3d MeshVertexPosition = Mesh.GetVertex(VertexID);
const FVector3d SplineSpaceVertexPosition =
SplineTransform.InverseTransformPosition(MeshVertexPosition); // treats local as world
SplineCurves.Position.FindNearest(SplineSpaceVertexPosition, DistanceSq);
if (DistanceSq < SplineRadiusSq) { … }

  • Per MeshPartitionMeshView.h (FMeshView), the view/submesh data is “in the local space of the input mesh”, not world. The InTransform handed to ApplyModifications is the local→world transform — used correctly by the base box op and by TessellateROI/RemeshROI here, but omitted from the selection.
  • Therefore when input-mesh-local ≠ world (MeshPartition offset from origin), every vertex’s computed distance is off by the local→world offset (in our case ~133570 in Z), so DistanceSq >> SplineRadiusSq and no triangles are ever selected.

(The class also carries // TODO: Replace similar code in MegaMeshSplineModifierLocals::FBackgroundOp with this, suggesting recent/rough code.)

Suggested fix

Apply InTransform to the vertex before converting to spline space, matching the base op and TessellateROI. Pass InTransform into GetTrianglesInSplineROI and use:

const FVector3d WorldVertex = InTransform.TransformPosition(Mesh.GetVertex(VertexID));
const FVector3d SplineSpaceVertexPosition = SplineTransform.InverseTransformPosition(WorldVertex);
(applies to both the closed-spline IsWithinDistanceSquared branch and the open-spline FindNearest branch).

Workaround
Use the box URemeshModifier (handles the transform correctly). Confine refinement to road corridors by sizing/placing boxes per road segment.