![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#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) |
Protected Member Functions | |
| MESHCONVERSION_API void | ApplyVertexColorTransform (FVector4f &Color) const |
Convert FMeshDescription to FDynamicMesh3
|
strong |
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.
| Color | color to transform |
| void FMeshDescriptionToDynamicMesh::Convert | ( | const FMeshDescription * | MeshIn, |
| FDynamicMesh3 & | MeshOut, | ||
| bool | bCopyTangents = false |
||
| ) |
Default conversion of MeshDescription to DynamicMesh
| 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 –///
| void FMeshDescriptionToDynamicMesh::CopyTangents | ( | const FMeshDescription * | SourceMesh, |
| const FDynamicMesh3 * | TargetMesh, | ||
| UE::Geometry::TMeshTangents< double > * | TangentsOut | ||
| ) |
Copy tangents from MeshDescription to a FMeshTangents instance.
| void FMeshDescriptionToDynamicMesh::CopyTangents | ( | const FMeshDescription * | SourceMesh, |
| const FDynamicMesh3 * | TargetMesh, | ||
| UE::Geometry::TMeshTangents< float > * | TangentsOut | ||
| ) |
Copy tangents from MeshDescription to a FMeshTangents instance.
|
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.
Ignore all mesh attributes (e.g. UV/Normal layers, color layer, material groups)
Should we initialize triangle groups on output mesh
If true, will print some possibly-helpful debugging spew to output log
Should Vertex Colors of MeshDescription be transformed from Linear to SRGB
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.
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.
| EPrimaryGroupMode FMeshDescriptionToDynamicMesh::GroupMode = EPrimaryGroupMode::SetToPolyGroup |
Which mode to use to create groups on output mesh. Ignored if bEnableOutputGroups = false.
| TArray<FTriangleID> FMeshDescriptionToDynamicMesh::TriIDMap |
map from DynamicMesh triangle ID to MeshDescription FTriangleID