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; };