UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Geometry::TToDynamicMesh< SrcMeshType > Class Template Reference

#include <ToDynamicMesh.h>

+ Inheritance diagram for UE::Geometry::TToDynamicMesh< SrcMeshType >:

Public Types

typedef TToDynamicMeshBase< SrcMeshTypeMyBase
 
using SrcTriIDType = typename MyBase::SrcTriIDType
 
using SrcVertIDType = typename MyBase::SrcVertIDType
 
using SrcUVIDType = typename SrcMeshType::UVIDType
 
using SrcNormalIDType = typename SrcMeshType::NormalIDType
 
using SrcColorIDType = typename SrcMeshType::ColorIDType
 
using SrcWedgeIDType = typename SrcMeshType::WedgeIDType
 
- Public Types inherited from UE::Geometry::TToDynamicMeshBase< SrcMeshType >
using SrcVertIDType = typename SrcMeshType::VertIDType
 
using SrcTriIDType = typename SrcMeshType::TriIDType
 

Public Member Functions

 TToDynamicMesh ()
 
void ConvertWOAttributes (FDynamicMesh3 &MeshOut, const SrcMeshType &MeshIn, TFunctionRef< int32(const SrcTriIDType &SrcTrID)> GroupIDFunction)
 
void Convert (FDynamicMesh3 &MeshOut, const SrcMeshType &MeshIn, TFunctionRef< int32(const SrcTriIDType &SrcTrID)> GroupIDFunction, TFunctionRef< int32(const SrcTriIDType &SrcTrID)> MaterialIDFunction, bool bCopyTangents)
 
- Public Member Functions inherited from UE::Geometry::TToDynamicMeshBase< SrcMeshType >
 TToDynamicMeshBase ()
 
void Convert (FDynamicMesh3 &MeshOut, const SrcMeshType &MeshIn, TFunctionRef< int32(const SrcTriIDType &SrcTrID)> GroupIDFunction)
 

Protected Member Functions

void PopulateOverlays (FDynamicMesh3 &MeshOut, const SrcMeshType &MeshIn, TFunctionRef< int32(const SrcTriIDType &SrcTrID)> MaterialIDFunction, bool bCopyTangents)
 
template<typename AttrType >
void PopulateOverlayFromWedgeAttr (typename TOverlayTraits< AttrType >::OverlayType *Overlay, TFunctionRef< AttrType(const SrcWedgeIDType &WedgeID)> WedgeAttrs, TFunctionRef< void(const SrcTriIDType &SrcTriID, SrcWedgeIDType &WID0, SrcWedgeIDType &WID1, SrcWedgeIDType &WID2)> TriToWedges, bool bWeldIdenticalAttrs=true)
 
template<typename AttrType , typename SrcAttrIDType >
void PopulateOverlayFromSharedAttr (typename TOverlayTraits< AttrType >::OverlayType *Overlay, const TArray< SrcAttrIDType > &SrcAttrIDs, TFunctionRef< AttrType(const SrcAttrIDType &AttrID)> SharedAttrValues, TFunctionRef< bool(const SrcTriIDType &SrcTriID, SrcAttrIDType &AttrID0, SrcAttrIDType &AttrID1, SrcAttrIDType &AttrID2)> AttrTriIndices)
 
template<typename AttrType , typename SrcAttrIDType >
void PopulateOverlay (typename TOverlayTraits< AttrType >::OverlayType *Overlay, const TArray< SrcAttrIDType > &SrcAttrIDs, TFunctionRef< AttrType(const SrcAttrIDType &AttrID)> SharedAttrValues, TFunctionRef< bool(const SrcTriIDType &SrcTriID, SrcAttrIDType &AttrID0, SrcAttrIDType &AttrID1, SrcAttrIDType &AttrID2)> AttrTriIndices, TFunctionRef< AttrType(const SrcWedgeIDType &WegdeID)> WedgeAttrs, TFunctionRef< void(const SrcTriIDType &SrcTriID, SrcWedgeIDType &WID0, SrcWedgeIDType &WID1, SrcWedgeIDType &WID2)> TriToWedges)
 

Additional Inherited Members

- Public Attributes inherited from UE::Geometry::TToDynamicMeshBase< SrcMeshType >
TArray< SrcVertIDTypeToSrcVertIDMap
 
TArray< SrcTriIDTypeToSrcTriIDMap
 
FDateTime Time_AfterVertices
 
FDateTime Time_AfterTriangles
 

Detailed Description

template<typename SrcMeshType>
class UE::Geometry::TToDynamicMesh< SrcMeshType >

Class used to convert a mesh with attributes (e.g. normals, uvs etc) to a FDynamicMesh3

The Source Mesh has to implement this interface

struct FSrcMeshInterface { // ID types: must be castable to int32 typedef SrcVertIDType VertIDType; typedef SrcTriIDType TriIDType; typedef SrcUVIDType UVIDType; typedef SrcNormalIDType NormalIDType; typedef SrcColorIDType ColorIDType typedef SrcWedgeIDType WedgeIDType;

// accounting. int32 NumTris() const; int32 NumVerts() const; int32 NumUVLayers() const;

// –"Vertex Buffer" info const Iterable_VertIDType& GetVertIDs() const; const FVector3d GetPosition(const VertIDType VtxID) const;

// –"Index Buffer" info const Iterable_TriIDType& GetTriIDs() const // return false if this TriID is not contained in mesh. bool GetTri(const TriIDType TriID, VertIDType& VID0, VertIDType& VID1, VertIDType& VID2) const;

bool HasNormals() const; bool HasTangents() cosnt; bool HasBiTangents() const;

// Each triangle corner is a wedge void GetWedgeID(const TriIDType& TriID, WedgeIDType& WID0, WedgeIDType& WID1, WedgeIDType& WID2) const;

// attribute access per-wedge // NB: ToDynamicMesh will attempt to weld identical attributes that are associated with the same vertex FVector2f GetWedgeUV(int32 UVLayerIndex, WedgeIDType WID) const; FVector3f GetWedgeNormal(WedgeIDType WID) const; FVector3f GetWedgeTangent(WedgeIDType WID) const; FVector3f GetWedgeBiTangent(WedgeIDType WID) const; FVector4f GetWedgeColor(WedgeIDType WID) const;

// attribute access that exploits shared attributes. // each group of shared attributes presents itself as a mesh with its own attribute vertex buffer. // NB: If the mesh has no shared Attr attributes, then Get{Attr}IDs() should return an empty array. // NB: Get{Attr}Tri() functions should return false if the triangle is not set in the attribute mesh.

const TArray<UVIDType>& GetUVIDs(int32 LayerID) const; FVector2f GetUV(int32 LayerID, UVIDType UVID) const; bool GetUVTri(int32 LayerID, const TriIDType& TID, UVIDType& ID0, UVIDType& ID1, UVIDType& ID2) const;

const TArray<NormalIDType>& GetNormalIDs() const; FVector3f GetNormal(NormalIDType ID) const; bool GetNormalTri(const TriIDType& TID, NormalIDType& NID0, NormalIDType& NID1, NormalIDType& NID2) const;

const TArray<NormalIDType>& GetTangentIDs() const; FVector3f GetTangent(NormalIDType ID) const; bool GetTangentTri(const TriIDType& TID, NormalIDType& NID0, NormalIDType& NID1, NormalIDType& NID2) const;

const TArray<NormalIDType>& GetBiTangentIDs() const;

FVector3f GetBiTangent(NormalIDType ID) const; bool GetBiTangentTri(const TriIDType& TID, NormalIDType& NID0, NormalIDType& NID1, NormalIDType& NID2) const;

const TArray<ColorIDType>& GetColorIDs() const; FVector4f GetColor(ColorIDType ID) const; bool GetColorTri(const TriIDType& TID, ColorIDType& NID0, ColorIDType& NID1, ColorIDType& NID2) const;

// weight maps information int32 NumWeightMapLayers() const; float GetVertexWeight(int32 WeightMapIndex, int32 SrcVertID) const; FName GetWeightMapName(int32 WeightMapIndex) const;

// skin weight attributes information int32 NumSkinWeightAttributes() const; UE::AnimationCore::FBoneWeights GetVertexSkinWeight(int32 SkinWeightAttributeIndex, VertIDType VtxID) const; FName GetSkinWeightAttributeName(int32 SkinWeightAttributeIndex) const;

// bone attributes information int32 GetNumBones() const; FName GetBoneName(int32 BoneIdx) const; int32 GetBoneParentIndex(int32 BoneIdx) const; FTransform GetBonePose(int32 BoneIdx) const; FVector4f GetBoneColor(int32 BoneIdx) const; };

Member Typedef Documentation

◆ MyBase

◆ SrcColorIDType

template<typename SrcMeshType >
using UE::Geometry::TToDynamicMesh< SrcMeshType >::SrcColorIDType = typename SrcMeshType::ColorIDType

◆ SrcNormalIDType

template<typename SrcMeshType >
using UE::Geometry::TToDynamicMesh< SrcMeshType >::SrcNormalIDType = typename SrcMeshType::NormalIDType

◆ SrcTriIDType

◆ SrcUVIDType

template<typename SrcMeshType >
using UE::Geometry::TToDynamicMesh< SrcMeshType >::SrcUVIDType = typename SrcMeshType::UVIDType

◆ SrcVertIDType

◆ SrcWedgeIDType

template<typename SrcMeshType >
using UE::Geometry::TToDynamicMesh< SrcMeshType >::SrcWedgeIDType = typename SrcMeshType::WedgeIDType

Constructor & Destructor Documentation

◆ TToDynamicMesh()

template<typename SrcMeshType >
UE::Geometry::TToDynamicMesh< SrcMeshType >::TToDynamicMesh ( )
inline

Member Function Documentation

◆ Convert()

template<typename SrcMeshType >
void UE::Geometry::TToDynamicMesh< SrcMeshType >::Convert ( FDynamicMesh3 MeshOut,
const SrcMeshType MeshIn,
TFunctionRef< int32(const SrcTriIDType &SrcTrID)>  GroupIDFunction,
TFunctionRef< int32(const SrcTriIDType &SrcTrID)>  MaterialIDFunction,
bool  bCopyTangents 
)
inline

◆ ConvertWOAttributes()

template<typename SrcMeshType >
void UE::Geometry::TToDynamicMesh< SrcMeshType >::ConvertWOAttributes ( FDynamicMesh3 MeshOut,
const SrcMeshType MeshIn,
TFunctionRef< int32(const SrcTriIDType &SrcTrID)>  GroupIDFunction 
)
inline

◆ PopulateOverlay()

template<typename SrcMeshType >
template<typename AttrType , typename SrcAttrIDType >
void UE::Geometry::TToDynamicMesh< SrcMeshType >::PopulateOverlay ( typename TOverlayTraits< AttrType >::OverlayType *  Overlay,
const TArray< SrcAttrIDType > &  SrcAttrIDs,
TFunctionRef< AttrType(const SrcAttrIDType &AttrID)>  SharedAttrValues,
TFunctionRef< bool(const SrcTriIDType &SrcTriID, SrcAttrIDType &AttrID0, SrcAttrIDType &AttrID1, SrcAttrIDType &AttrID2)>  AttrTriIndices,
TFunctionRef< AttrType(const SrcWedgeIDType &WegdeID)>  WedgeAttrs,
TFunctionRef< void(const SrcTriIDType &SrcTriID, SrcWedgeIDType &WID0, SrcWedgeIDType &WID1, SrcWedgeIDType &WID2)>  TriToWedges 
)
inlineprotected

◆ PopulateOverlayFromSharedAttr()

template<typename SrcMeshType >
template<typename AttrType , typename SrcAttrIDType >
void UE::Geometry::TToDynamicMesh< SrcMeshType >::PopulateOverlayFromSharedAttr ( typename TOverlayTraits< AttrType >::OverlayType *  Overlay,
const TArray< SrcAttrIDType > &  SrcAttrIDs,
TFunctionRef< AttrType(const SrcAttrIDType &AttrID)>  SharedAttrValues,
TFunctionRef< bool(const SrcTriIDType &SrcTriID, SrcAttrIDType &AttrID0, SrcAttrIDType &AttrID1, SrcAttrIDType &AttrID2)>  AttrTriIndices 
)
inlineprotected

– We have to do some clean-up on the shared Attrs because the MeshIn format might support wild stuff.. –///

◆ PopulateOverlayFromWedgeAttr()

template<typename SrcMeshType >
template<typename AttrType >
void UE::Geometry::TToDynamicMesh< SrcMeshType >::PopulateOverlayFromWedgeAttr ( typename TOverlayTraits< AttrType >::OverlayType *  Overlay,
TFunctionRef< AttrType(const SrcWedgeIDType &WedgeID)>  WedgeAttrs,
TFunctionRef< void(const SrcTriIDType &SrcTriID, SrcWedgeIDType &WID0, SrcWedgeIDType &WID1, SrcWedgeIDType &WID2)>  TriToWedges,
bool  bWeldIdenticalAttrs = true 
)
inlineprotected

◆ PopulateOverlays()

template<typename SrcMeshType >
void UE::Geometry::TToDynamicMesh< SrcMeshType >::PopulateOverlays ( FDynamicMesh3 MeshOut,
const SrcMeshType MeshIn,
TFunctionRef< int32(const SrcTriIDType &SrcTrID)>  MaterialIDFunction,
bool  bCopyTangents 
)
inlineprotected

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