UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FMeshDescriptionToDynamicMesh Class Reference

#include <MeshDescriptionToDynamicMesh.h>

Public Types

enum class  EPrimaryGroupMode { SetToZero , SetToPolygonID , SetToPolygonGroupID , SetToPolyGroup }
 

Public Member Functions

void SetPolygonGroupToMaterialIndexMap (const TArray< int32 > &PolygonGroupToMaterialIndexMapIn)
 
MESHCONVERSION_API void Convert (const FMeshDescription *MeshIn, FDynamicMesh3 &MeshOut, bool bCopyTangents=false)
 
MESHCONVERSION_API void CopyTangents (const FMeshDescription *SourceMesh, const FDynamicMesh3 *TargetMesh, UE::Geometry::TMeshTangents< float > *TangentsOut)
 
MESHCONVERSION_API void CopyTangents (const FMeshDescription *SourceMesh, const FDynamicMesh3 *TargetMesh, UE::Geometry::TMeshTangents< double > *TangentsOut)
 

Public Attributes

bool bPrintDebugMessages = false
 
bool bEnableOutputGroups = true
 
bool bCalculateMaps = true
 
bool bDisableAttributes = false
 
bool bTransformVertexColorsLinearToSRGB = true
 
bool bUseCompactedPolygonGroupIDValues = false
 
TArray< FTriangleIDTriIDMap
 
TArray< FVertexIDVertIDMap
 
bool bVIDsFromNonManifoldMeshDescriptionAttr = false
 
EPrimaryGroupMode GroupMode = EPrimaryGroupMode::SetToPolyGroup
 

Protected Member Functions

MESHCONVERSION_API void ApplyVertexColorTransform (FVector4f &Color) const
 

Detailed Description

Convert FMeshDescription to FDynamicMesh3

Member Enumeration Documentation

◆ EPrimaryGroupMode

Various modes can be used to create output triangle groups

Enumerator
SetToZero 
SetToPolygonID 
SetToPolygonGroupID 
SetToPolyGroup 

Member Function Documentation

◆ ApplyVertexColorTransform()

void FMeshDescriptionToDynamicMesh::ApplyVertexColorTransform ( FVector4f Color) const
protected

Applies an optional Linear-to-sRGB color transform on the input. The color transform is controlled by bTransformVtxColorsLinearToSRGB.

This is the counterpart to DynamicMeshToMeshDescription::ApplyVertexColorTransform to undo an applied sRGB-to-Linear transformation when the MeshDescription was built.

Parameters
Colorcolor to transform

◆ Convert()

void FMeshDescriptionToDynamicMesh::Convert ( const FMeshDescription MeshIn,
FDynamicMesh3 MeshOut,
bool  bCopyTangents = false 
)

Default conversion of MeshDescription to DynamicMesh

Parameters
bCopyTangents- if bDisableAttributes is false, this requests the tangent plane vectors (tangent and bitangent) be stored as overlays in the MeshOut DynamicAttributeSet, provided they exist on the MeshIn

– We have to do some clean-up on the shared UVs that come from MeshDecription –///

◆ CopyTangents() [1/2]

void FMeshDescriptionToDynamicMesh::CopyTangents ( const FMeshDescription SourceMesh,
const FDynamicMesh3 TargetMesh,
UE::Geometry::TMeshTangents< double > *  TangentsOut 
)

Copy tangents from MeshDescription to a FMeshTangents instance.

Warning
Convert() must have been used to create the TargetMesh before calling this function

◆ CopyTangents() [2/2]

void FMeshDescriptionToDynamicMesh::CopyTangents ( const FMeshDescription SourceMesh,
const FDynamicMesh3 TargetMesh,
UE::Geometry::TMeshTangents< float > *  TangentsOut 
)

Copy tangents from MeshDescription to a FMeshTangents instance.

Warning
Convert() must have been used to create the TargetMesh before calling this function

◆ SetPolygonGroupToMaterialIndexMap()

void FMeshDescriptionToDynamicMesh::SetPolygonGroupToMaterialIndexMap ( const TArray< int32 > &  PolygonGroupToMaterialIndexMapIn)
inline

Set an optional mapping from mesh description polygon group to dynamic mesh material indices; if unset, an identity map is assumed

Note: If bUseCompactedPolygonGroupIDValues is true, this remapping applies after the compact step – so this mapping is a Section Index -> Material Index map for Static Mesh assets.

Member Data Documentation

◆ bCalculateMaps

bool FMeshDescriptionToDynamicMesh::bCalculateMaps = true

Should we calculate conversion index maps

◆ bDisableAttributes

bool FMeshDescriptionToDynamicMesh::bDisableAttributes = false

Ignore all mesh attributes (e.g. UV/Normal layers, color layer, material groups)

◆ bEnableOutputGroups

bool FMeshDescriptionToDynamicMesh::bEnableOutputGroups = true

Should we initialize triangle groups on output mesh

◆ bPrintDebugMessages

bool FMeshDescriptionToDynamicMesh::bPrintDebugMessages = false

If true, will print some possibly-helpful debugging spew to output log

◆ bTransformVertexColorsLinearToSRGB

bool FMeshDescriptionToDynamicMesh::bTransformVertexColorsLinearToSRGB = true

Should Vertex Colors of MeshDescription be transformed from Linear to SRGB

◆ bUseCompactedPolygonGroupIDValues

bool FMeshDescriptionToDynamicMesh::bUseCompactedPolygonGroupIDValues = false

Set this flag to transform Polygon Group IDs to their compacted indices, before using them as material indices – in other words, 'holes' in the Mesh Description's PolygonGroups array are removed by shifting the subsequent IDs down

Note: For Static Mesh LODs, this transforms Polygon Group IDs to Section Indices. This flag should typically be set to 'true' when converting Static Mesh assets.

◆ bVIDsFromNonManifoldMeshDescriptionAttr

bool FMeshDescriptionToDynamicMesh::bVIDsFromNonManifoldMeshDescriptionAttr = false

If the source MeshDescription is non-manifold, store mesh vertex id as a vertex attribute on the result mesh This data can be accessed using FNonManifoldMappingSupport ( see NonManifoldMappingSupport.h)

Note: the vertex attribute will not be created if the source mesh is manifold (as this data would be redundant) or if bDisableAttributes is true.

◆ GroupMode

EPrimaryGroupMode FMeshDescriptionToDynamicMesh::GroupMode = EPrimaryGroupMode::SetToPolyGroup

Which mode to use to create groups on output mesh. Ignored if bEnableOutputGroups = false.

◆ TriIDMap

TArray<FTriangleID> FMeshDescriptionToDynamicMesh::TriIDMap

map from DynamicMesh triangle ID to MeshDescription FTriangleID

◆ VertIDMap

TArray<FVertexID> FMeshDescriptionToDynamicMesh::VertIDMap

map from DynamicMesh vertex Id to MeshDecription FVertexID. NB: due to vertex splitting, multiple DynamicMesh vertex ids may map to the same MeshDescription FVertexID. ( a vertex split is a result of reconciling non-manifold MeshDescription vertex )


The documentation for this class was generated from the following files: