// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "DNAReader.h" #include "DNAUtils.h" #include "FMemoryResource.h" template class FDNAReader : public IDNAReader { public: FDNAReader(TWrappedReader* Source); ~FDNAReader() = default; FDNAReader(const FDNAReader&) = delete; FDNAReader& operator=(const FDNAReader&) = delete; FDNAReader(FDNAReader&&) = default; FDNAReader& operator=(FDNAReader&&) = default; // Header uint16 GetFileFormatGeneration() const override; uint16 GetFileFormatVersion() const override; // Descriptor FString GetName() const override; EArchetype GetArchetype() const override; EGender GetGender() const override; uint16 GetAge() const override; uint32 GetMetaDataCount() const override; FString GetMetaDataKey(uint32 Index) const override; FString GetMetaDataValue(const FString& Key) const override; ETranslationUnit GetTranslationUnit() const override; ERotationUnit GetRotationUnit() const override; FCoordinateSystem GetCoordinateSystem() const override; uint16 GetLODCount() const override; uint16 GetDBMaxLOD() const override; FString GetDBComplexity() const override; FString GetDBName() const override; // Definition uint16 GetGUIControlCount() const override; FString GetGUIControlName(uint16 Index) const override; uint16 GetRawControlCount() const override; FString GetRawControlName(uint16 Index) const override; uint16 GetJointCount() const override; FString GetJointName(uint16 Index) const override; uint16 GetJointIndexListCount() const override; TArrayView GetJointIndicesForLOD(uint16 LOD) const override; uint16 GetJointParentIndex(uint16 Index) const override; uint16 GetBlendShapeChannelCount() const override; FString GetBlendShapeChannelName(uint16 Index) const override; uint16 GetBlendShapeChannelIndexListCount() const override; TArrayView GetBlendShapeChannelIndicesForLOD(uint16 LOD) const override; uint16 GetAnimatedMapCount() const override; FString GetAnimatedMapName(uint16 Index) const override; uint16 GetAnimatedMapIndexListCount() const override; TArrayView GetAnimatedMapIndicesForLOD(uint16 LOD) const override; uint16 GetMeshCount() const override; FString GetMeshName(uint16 Index) const override; uint16 GetMeshIndexListCount() const override; TArrayView GetMeshIndicesForLOD(uint16 LOD) const override; uint16 GetMeshBlendShapeChannelMappingCount() const override; FMeshBlendShapeChannelMapping GetMeshBlendShapeChannelMapping(uint16 Index) const override; TArrayView GetMeshBlendShapeChannelMappingIndicesForLOD(uint16 LOD) const override; FVector GetNeutralJointTranslation(uint16 Index) const override; FVector GetNeutralJointRotation(uint16 Index) const override; // Behavior TArrayView GetGUIToRawInputIndices() const override; TArrayView GetGUIToRawOutputIndices() const override; TArrayView GetGUIToRawFromValues() const override; TArrayView GetGUIToRawToValues() const override; TArrayView GetGUIToRawSlopeValues() const override; TArrayView GetGUIToRawCutValues() const override; uint16 GetPSDCount() const override; TArrayView GetPSDRowIndices() const override; TArrayView GetPSDColumnIndices() const override; TArrayView GetPSDValues() const override; uint16 GetJointRowCount() const override; uint16 GetJointColumnCount() const override; TArrayView GetJointVariableAttributeIndices(uint16 LOD) const override; uint16 GetJointGroupCount() const override; TArrayView GetJointGroupLODs(uint16 JointGroupIndex) const override; TArrayView GetJointGroupInputIndices(uint16 JointGroupIndex) const override; TArrayView GetJointGroupOutputIndices(uint16 JointGroupIndex) const override; TArrayView GetJointGroupValues(uint16 JointGroupIndex) const override; TArrayView GetJointGroupJointIndices(uint16 JointGroupIndex) const override; TArrayView GetBlendShapeChannelLODs() const override; TArrayView GetBlendShapeChannelOutputIndices() const override; TArrayView GetBlendShapeChannelInputIndices() const override; TArrayView GetAnimatedMapLODs() const override; TArrayView GetAnimatedMapInputIndices() const override; TArrayView GetAnimatedMapOutputIndices() const override; TArrayView GetAnimatedMapFromValues() const override; TArrayView GetAnimatedMapToValues() const override; TArrayView GetAnimatedMapSlopeValues() const override; TArrayView GetAnimatedMapCutValues() const override; // Geometry uint32 GetVertexPositionCount(uint16 MeshIndex) const override; FVector GetVertexPosition(uint16 MeshIndex, uint32 VertexIndex) const override; TArrayView GetVertexPositionXs(uint16 MeshIndex) const override; TArrayView GetVertexPositionYs(uint16 MeshIndex) const override; TArrayView GetVertexPositionZs(uint16 MeshIndex) const override; uint32 GetVertexTextureCoordinateCount(uint16 MeshIndex) const override; FTextureCoordinate GetVertexTextureCoordinate(uint16 MeshIndex, uint32 TextureCoordinateIndex) const override; uint32 GetVertexNormalCount(uint16 MeshIndex) const override; FVector GetVertexNormal(uint16 MeshIndex, uint32 NormalIndex) const override; uint32 GetFaceCount(uint16 MeshIndex) const override; TArrayView GetFaceVertexLayoutIndices(uint16 MeshIndex, uint32 FaceIndex) const override; uint32 GetVertexLayoutCount(uint16 MeshIndex) const override; FVertexLayout GetVertexLayout(uint16 MeshIndex, uint32 LayoutIndex) const override; uint16 GetMaximumInfluencePerVertex(uint16 MeshIndex) const override; uint32 GetSkinWeightsCount(uint16 MeshIndex) const override; TArrayView GetSkinWeightsValues(uint16 MeshIndex, uint32 VertexIndex) const override; TArrayView GetSkinWeightsJointIndices(uint16 MeshIndex, uint32 VertexIndex) const override; uint16 GetBlendShapeTargetCount(uint16 MeshIndex) const override; uint16 GetBlendShapeChannelIndex(uint16 MeshIndex, uint16 BlendShapeTargetIndex) const override; uint32 GetBlendShapeTargetDeltaCount(uint16 MeshIndex, uint16 BlendShapeTargetIndex) const override; FVector GetBlendShapeTargetDelta(uint16 MeshIndex, uint16 BlendShapeTargetIndex, uint32 DeltaIndex) const override; TArrayView GetBlendShapeTargetDeltaXs(uint16 MeshIndex, uint16 BlendShapeTargetIndex) const override; TArrayView GetBlendShapeTargetDeltaYs(uint16 MeshIndex, uint16 BlendShapeTargetIndex) const override; TArrayView GetBlendShapeTargetDeltaZs(uint16 MeshIndex, uint16 BlendShapeTargetIndex) const override; TArrayView GetBlendShapeTargetVertexIndices(uint16 MeshIndex, uint16 BlendShapeTargetIndex) const override; // Machine Learned Behavior uint16 GetMLControlCount() const override; FString GetMLControlName(uint16 Index) const override; uint16 GetNeuralNetworkCount() const override; uint16 GetNeuralNetworkIndexListCount() const override; TArrayView GetNeuralNetworkIndicesForLOD(uint16 LOD) const override; uint16 GetMeshRegionCount(uint16 MeshIndex) const override; FString GetMeshRegionName(uint16 MeshIndex, uint16 RegionIndex) const override; TArrayView GetNeuralNetworkIndicesForMeshRegion(uint16 MeshIndex, uint16 RegionIndex) const override; TArrayView GetNeuralNetworkInputIndices(uint16 NetIndex) const override; TArrayView GetNeuralNetworkOutputIndices(uint16 NetIndex) const override; uint16 GetNeuralNetworkLayerCount(uint16 NetIndex) const override; EActivationFunction GetNeuralNetworkLayerActivationFunction(uint16 NetIndex, uint16 LayerIndex) const override; TArrayView GetNeuralNetworkLayerActivationFunctionParameters(uint16 NetIndex, uint16 LayerIndex) const override; TArrayView GetNeuralNetworkLayerBiases(uint16 NetIndex, uint16 LayerIndex) const override; TArrayView GetNeuralNetworkLayerWeights(uint16 NetIndex, uint16 LayerIndex) const override; // JointBehaviorMetadataReader ETranslationRepresentation GetJointTranslationRepresentation(uint16 JointIndex) const override; ERotationRepresentation GetJointRotationRepresentation(uint16 JointIndex) const override; EScaleRepresentation GetJointScaleRepresentation(uint16 JointIndex) const override; // RBFBehavior uint16 GetRBFPoseCount() const override; FString GetRBFPoseName(uint16 PoseIndex) const override; TArrayView GetRBFPoseJointOutputIndices(uint16 PoseIndex) const override; TArrayView GetRBFPoseBlendShapeChannelOutputIndices(uint16 PoseIndex) const override; TArrayView GetRBFPoseAnimatedMapOutputIndices(uint16 PoseIndex) const override; TArrayView GetRBFPoseJointOutputValues(uint16 PoseIndex) const override; float GetRBFPoseScale(uint16 PoseIndex) const override; uint16 GetRBFPoseControlCount() const override; FString GetRBFPoseControlName(uint16 PoseControlIndex) const override; TArrayView GetRBFPoseInputControlIndices(uint16 PoseIndex) const override; TArrayView GetRBFPoseOutputControlIndices(uint16 PoseIndex) const override; TArrayView GetRBFPoseOutputControlWeights(uint16 PoseIndex) const override; uint16 GetRBFSolverCount() const override; uint16 GetRBFSolverIndexListCount() const override; TArrayView GetRBFSolverIndicesForLOD(uint16 LOD) const override; FString GetRBFSolverName(uint16 SolverIndex) const override; TArrayView GetRBFSolverRawControlIndices(uint16 SolverIndex) const override; TArrayView GetRBFSolverPoseIndices(uint16 SolverIndex) const override; TArrayView GetRBFSolverRawControlValues(uint16 SolverIndex) const override; ERBFSolverType GetRBFSolverType(uint16 SolverIndex) const override; float GetRBFSolverRadius(uint16 SolverIndex) const override; EAutomaticRadius GetRBFSolverAutomaticRadius(uint16 SolverIndex) const override; float GetRBFSolverWeightThreshold(uint16 SolverIndex) const override; ERBFDistanceMethod GetRBFSolverDistanceMethod(uint16 SolverIndex) const override; ERBFNormalizeMethod GetRBFSolverNormalizeMethod(uint16 SolverIndex) const override; ERBFFunctionType GetRBFSolverFunctionType(uint16 SolverIndex) const override; ETwistAxis GetRBFSolverTwistAxis(uint16 SolverIndex) const override; // TwistSwingBehavior uint16 GetTwistCount() const override; ETwistAxis GetTwistSetupTwistAxis(uint16 TwistIndex) const override; TArrayView GetTwistInputControlIndices(uint16 TwistIndex) const override; TArrayView GetTwistOutputJointIndices(uint16 TwistIndex) const override; TArrayView GetTwistBlendWeights(uint16 TwistIndex) const override; uint16 GetSwingCount() const override; ETwistAxis GetSwingSetupTwistAxis(uint16 SwingIndex) const override; TArrayView GetSwingInputControlIndices(uint16 SwingIndex) const override; TArrayView GetSwingOutputJointIndices(uint16 SwingIndex) const override; TArrayView GetSwingBlendWeights(uint16 SwingIndex) const override; void Unload(EDNADataLayer Layer) override; private: dna::Reader* Unwrap() const override; private: TSharedPtr MemoryResource; struct FWrappedReaderDeleter { void operator()(TWrappedReader* Pointer); }; TUniquePtr ReaderPtr; }; template FDNAReader::FDNAReader(TWrappedReader* Source) : MemoryResource{FMemoryResource::SharedInstance()}, ReaderPtr{Source} { } template dna::Reader* FDNAReader::Unwrap() const { return ReaderPtr.Get(); } template void FDNAReader::Unload(EDNADataLayer Layer) { ReaderPtr->unload(CalculateDNADataLayerBitmask(Layer)); } template void FDNAReader::FWrappedReaderDeleter::operator()(TWrappedReader* Pointer) { if (Pointer != nullptr) { TWrappedReader::destroy(Pointer); } } template uint16 FDNAReader::GetFileFormatGeneration() const { return ReaderPtr->getFileFormatGeneration(); } template uint16 FDNAReader::GetFileFormatVersion() const { return ReaderPtr->getFileFormatVersion(); } template FString FDNAReader::GetName() const { return FString(ANSI_TO_TCHAR(ReaderPtr->getName().data())); } template EArchetype FDNAReader::GetArchetype() const { return static_cast(ReaderPtr->getArchetype()); } template EGender FDNAReader::GetGender() const { return static_cast(ReaderPtr->getGender()); } template uint16 FDNAReader::GetAge() const { return ReaderPtr->getAge(); } template uint32 FDNAReader::GetMetaDataCount() const { return ReaderPtr->getMetaDataCount(); } template FString FDNAReader::GetMetaDataKey(uint32 Index) const { return FString(ANSI_TO_TCHAR(ReaderPtr->getMetaDataKey(Index).data())); } template FString FDNAReader::GetMetaDataValue(const FString& Key) const { return FString(ANSI_TO_TCHAR(ReaderPtr->getMetaDataValue(TCHAR_TO_ANSI(*Key)).data())); } template ETranslationUnit FDNAReader::GetTranslationUnit() const { return static_cast(ReaderPtr->getTranslationUnit()); } template ERotationUnit FDNAReader::GetRotationUnit() const { return static_cast(ReaderPtr->getRotationUnit()); } template FCoordinateSystem FDNAReader::GetCoordinateSystem() const { const auto System = ReaderPtr->getCoordinateSystem(); return FCoordinateSystem { static_cast(System.xAxis), static_cast(System.yAxis), static_cast(System.zAxis) }; } template uint16 FDNAReader::GetLODCount() const { return ReaderPtr->getLODCount(); } template uint16 FDNAReader::GetDBMaxLOD() const { return ReaderPtr->getDBMaxLOD(); } template FString FDNAReader::GetDBComplexity() const { return FString(ANSI_TO_TCHAR(ReaderPtr->getDBComplexity().data())); } template FString FDNAReader::GetDBName() const { return FString(ANSI_TO_TCHAR(ReaderPtr->getDBName().data())); } template uint16 FDNAReader::GetGUIControlCount() const { return ReaderPtr->getGUIControlCount(); } template FString FDNAReader::GetGUIControlName(uint16 Index) const { return FString(ANSI_TO_TCHAR(ReaderPtr->getGUIControlName(Index).data())); } template uint16 FDNAReader::GetRawControlCount() const { return ReaderPtr->getRawControlCount(); } template FString FDNAReader::GetRawControlName(uint16 Index) const { return FString(ANSI_TO_TCHAR(ReaderPtr->getRawControlName(Index).data())); } template uint16 FDNAReader::GetJointCount() const { return ReaderPtr->getJointCount(); } template FString FDNAReader::GetJointName(uint16 Index) const { return FString(ANSI_TO_TCHAR(ReaderPtr->getJointName(Index).data())); } template uint16 FDNAReader::GetJointIndexListCount() const { return ReaderPtr->getJointIndexListCount(); } template TArrayView FDNAReader::GetJointIndicesForLOD(uint16 LOD) const { const auto Indices = ReaderPtr->getJointIndicesForLOD(LOD); return TArrayView(Indices.data(), static_cast(Indices.size())); } template uint16 FDNAReader::GetJointParentIndex(uint16 Index) const { return ReaderPtr->getJointParentIndex(Index); } template uint16 FDNAReader::GetBlendShapeChannelCount() const { return ReaderPtr->getBlendShapeChannelCount(); } template FString FDNAReader::GetBlendShapeChannelName(uint16 Index) const { return FString(ANSI_TO_TCHAR(ReaderPtr->getBlendShapeChannelName(Index).data())); } template uint16 FDNAReader::GetBlendShapeChannelIndexListCount() const { return ReaderPtr->getBlendShapeChannelIndexListCount(); } template TArrayView FDNAReader::GetBlendShapeChannelIndicesForLOD(uint16 LOD) const { const auto Indices = ReaderPtr->getBlendShapeChannelIndicesForLOD(LOD); return TArrayView(Indices.data(), static_cast(Indices.size())); } template uint16 FDNAReader::GetAnimatedMapCount() const { return ReaderPtr->getAnimatedMapCount(); } template FString FDNAReader::GetAnimatedMapName(uint16 Index) const { return FString(ANSI_TO_TCHAR(ReaderPtr->getAnimatedMapName(Index).data())); } template uint16 FDNAReader::GetAnimatedMapIndexListCount() const { return ReaderPtr->getAnimatedMapIndexListCount(); } template TArrayView FDNAReader::GetAnimatedMapIndicesForLOD(uint16 LOD) const { const auto Indices = ReaderPtr->getAnimatedMapIndicesForLOD(LOD); return TArrayView(Indices.data(), static_cast(Indices.size())); } template uint16 FDNAReader::GetMeshCount() const { return ReaderPtr->getMeshCount(); } template FString FDNAReader::GetMeshName(uint16 Index) const { return FString(ANSI_TO_TCHAR(ReaderPtr->getMeshName(Index).data())); } template uint16 FDNAReader::GetMeshIndexListCount() const { return ReaderPtr->getMeshIndexListCount(); } template TArrayView FDNAReader::GetMeshIndicesForLOD(uint16 LOD) const { const auto Indices = ReaderPtr->getMeshIndicesForLOD(LOD); return TArrayView(Indices.data(), static_cast(Indices.size())); } template uint16 FDNAReader::GetMeshBlendShapeChannelMappingCount() const { return ReaderPtr->getMeshBlendShapeChannelMappingCount(); } template FMeshBlendShapeChannelMapping FDNAReader::GetMeshBlendShapeChannelMapping(uint16 Index) const { const auto Mapping = ReaderPtr->getMeshBlendShapeChannelMapping(Index); return FMeshBlendShapeChannelMapping{Mapping.meshIndex, Mapping.blendShapeChannelIndex}; } template TArrayView FDNAReader::GetMeshBlendShapeChannelMappingIndicesForLOD(uint16 LOD) const { const auto Indices = ReaderPtr->getMeshBlendShapeChannelMappingIndicesForLOD(LOD); return TArrayView(Indices.data(), static_cast(Indices.size())); } template FVector FDNAReader::GetNeutralJointTranslation(uint16 Index) const { const auto Translation = ReaderPtr->getNeutralJointTranslation(Index); // X = X, Y = -Y, Z = Z return FVector(Translation.x, -Translation.y, Translation.z); } template FVector FDNAReader::GetNeutralJointRotation(uint16 Index) const { const auto Translation = ReaderPtr->getNeutralJointRotation(Index); // X = -Y, Y = -Z, Z = X return FVector(-Translation.y, -Translation.z, Translation.x); } template TArrayView FDNAReader::GetGUIToRawInputIndices() const { const auto Indices = ReaderPtr->getGUIToRawInputIndices(); return TArrayView(Indices.data(), static_cast(Indices.size())); } template TArrayView FDNAReader::GetGUIToRawOutputIndices() const { const auto Indices = ReaderPtr->getGUIToRawOutputIndices(); return TArrayView(Indices.data(), static_cast(Indices.size())); } template TArrayView FDNAReader::GetGUIToRawFromValues() const { const auto Values = ReaderPtr->getGUIToRawFromValues(); return TArrayView(Values.data(), static_cast(Values.size())); } template TArrayView FDNAReader::GetGUIToRawToValues() const { const auto Values = ReaderPtr->getGUIToRawToValues(); return TArrayView(Values.data(), static_cast(Values.size())); } template TArrayView FDNAReader::GetGUIToRawSlopeValues() const { const auto Values = ReaderPtr->getGUIToRawSlopeValues(); return TArrayView(Values.data(), static_cast(Values.size())); } template TArrayView FDNAReader::GetGUIToRawCutValues() const { const auto Values = ReaderPtr->getGUIToRawCutValues(); return TArrayView(Values.data(), static_cast(Values.size())); } template uint16 FDNAReader::GetPSDCount() const { return ReaderPtr->getPSDCount(); } template TArrayView FDNAReader::GetPSDRowIndices() const { const auto Indices = ReaderPtr->getPSDRowIndices(); return TArrayView(Indices.data(), static_cast(Indices.size())); } template TArrayView FDNAReader::GetPSDColumnIndices() const { const auto Indices = ReaderPtr->getPSDColumnIndices(); return TArrayView(Indices.data(), static_cast(Indices.size())); } template TArrayView FDNAReader::GetPSDValues() const { const auto Values = ReaderPtr->getPSDValues(); return TArrayView(Values.data(), static_cast(Values.size())); } template uint16 FDNAReader::GetJointRowCount() const { return ReaderPtr->getJointRowCount(); } template uint16 FDNAReader::GetJointColumnCount() const { return ReaderPtr->getJointColumnCount(); } template TArrayView FDNAReader::GetJointVariableAttributeIndices(uint16 LOD) const { const auto Indices = ReaderPtr->getJointVariableAttributeIndices(LOD); return TArrayView(Indices.data(), static_cast(Indices.size())); } template uint16 FDNAReader::GetJointGroupCount() const { return ReaderPtr->getJointGroupCount(); } template TArrayView FDNAReader::GetJointGroupLODs(uint16 JointGroupIndex) const { const auto LODs = ReaderPtr->getJointGroupLODs(JointGroupIndex); return TArrayView(LODs.data(), static_cast(LODs.size())); } template TArrayView FDNAReader::GetJointGroupInputIndices(uint16 JointGroupIndex) const { const auto Indices = ReaderPtr->getJointGroupInputIndices(JointGroupIndex); return TArrayView(Indices.data(), static_cast(Indices.size())); } template TArrayView FDNAReader::GetJointGroupOutputIndices(uint16 JointGroupIndex) const { const auto Indices = ReaderPtr->getJointGroupOutputIndices(JointGroupIndex); return TArrayView(Indices.data(), static_cast(Indices.size())); } template TArrayView FDNAReader::GetJointGroupValues(uint16 JointGroupIndex) const { const auto Values = ReaderPtr->getJointGroupValues(JointGroupIndex); return TArrayView(Values.data(), static_cast(Values.size())); } template TArrayView FDNAReader::GetJointGroupJointIndices(uint16 JointGroupIndex) const { const auto Indices = ReaderPtr->getJointGroupJointIndices(JointGroupIndex); return TArrayView(Indices.data(), static_cast(Indices.size())); } template TArrayView FDNAReader::GetBlendShapeChannelLODs() const { const auto LODs = ReaderPtr->getBlendShapeChannelLODs(); return TArrayView(LODs.data(), static_cast(LODs.size())); } template TArrayView FDNAReader::GetBlendShapeChannelOutputIndices() const { const auto Indices = ReaderPtr->getBlendShapeChannelOutputIndices(); return TArrayView(Indices.data(), static_cast(Indices.size())); } template TArrayView FDNAReader::GetBlendShapeChannelInputIndices() const { const auto Indices = ReaderPtr->getBlendShapeChannelInputIndices(); return TArrayView(Indices.data(), static_cast(Indices.size())); } template TArrayView FDNAReader::GetAnimatedMapLODs() const { const auto LODs = ReaderPtr->getAnimatedMapLODs(); return TArrayView(LODs.data(), static_cast(LODs.size())); } template TArrayView FDNAReader::GetAnimatedMapInputIndices() const { const auto Indices = ReaderPtr->getAnimatedMapInputIndices(); return TArrayView(Indices.data(), static_cast(Indices.size())); } template TArrayView FDNAReader::GetAnimatedMapOutputIndices() const { const auto Indices = ReaderPtr->getAnimatedMapOutputIndices(); return TArrayView(Indices.data(), static_cast(Indices.size())); } template TArrayView FDNAReader::GetAnimatedMapFromValues() const { const auto Values = ReaderPtr->getAnimatedMapFromValues(); return TArrayView(Values.data(), static_cast(Values.size())); } template TArrayView FDNAReader::GetAnimatedMapToValues() const { const auto Values = ReaderPtr->getAnimatedMapToValues(); return TArrayView(Values.data(), static_cast(Values.size())); } template TArrayView FDNAReader::GetAnimatedMapSlopeValues() const { const auto Values = ReaderPtr->getAnimatedMapSlopeValues(); return TArrayView(Values.data(), static_cast(Values.size())); } template TArrayView FDNAReader::GetAnimatedMapCutValues() const { const auto Values = ReaderPtr->getAnimatedMapCutValues(); return TArrayView(Values.data(), static_cast(Values.size())); } template uint32 FDNAReader::GetVertexPositionCount(uint16 MeshIndex) const { return ReaderPtr->getVertexPositionCount(MeshIndex); } template FVector FDNAReader::GetVertexPosition(uint16 MeshIndex, uint32 VertexIndex) const { const auto Position = ReaderPtr->getVertexPosition(MeshIndex, VertexIndex); // X = X, Y = Z, Z = Y return FVector(Position.x, Position.z, Position.y); } template TArrayView FDNAReader::GetVertexPositionXs(uint16 MeshIndex) const { // X = X const auto Values = ReaderPtr->getVertexPositionXs(MeshIndex); return TArrayView(Values.data(), static_cast(Values.size())); } template TArrayView FDNAReader::GetVertexPositionYs(uint16 MeshIndex) const { // Y = Z const auto Values = ReaderPtr->getVertexPositionZs(MeshIndex); return TArrayView(Values.data(), static_cast(Values.size())); } template TArrayView FDNAReader::GetVertexPositionZs(uint16 MeshIndex) const { // Z = Y const auto Values = ReaderPtr->getVertexPositionYs(MeshIndex); return TArrayView(Values.data(), static_cast(Values.size())); } template uint32 FDNAReader::GetVertexTextureCoordinateCount(uint16 MeshIndex) const { return ReaderPtr->getVertexTextureCoordinateCount(MeshIndex); } template FTextureCoordinate FDNAReader::GetVertexTextureCoordinate(uint16 MeshIndex, uint32 TextureCoordinateIndex) const { const auto Coordinate = ReaderPtr->getVertexTextureCoordinate(MeshIndex, TextureCoordinateIndex); return FTextureCoordinate{Coordinate.u, Coordinate.v}; } template uint32 FDNAReader::GetVertexNormalCount(uint16 MeshIndex) const { return ReaderPtr->getVertexNormalCount(MeshIndex); } template FVector FDNAReader::GetVertexNormal(uint16 MeshIndex, uint32 NormalIndex) const { const auto Normal = ReaderPtr->getVertexNormal(MeshIndex, NormalIndex); // X = X, Y = Z, Z = Y return FVector(Normal.x, Normal.z, Normal.y); } template uint32 FDNAReader::GetFaceCount(uint16 MeshIndex) const { return ReaderPtr->getFaceCount(MeshIndex); } template TArrayView FDNAReader::GetFaceVertexLayoutIndices(uint16 MeshIndex, uint32 FaceIndex) const { const auto Indices = ReaderPtr->getFaceVertexLayoutIndices(MeshIndex, FaceIndex); return TArrayView(Indices.data(), static_cast(Indices.size())); } template uint32 FDNAReader::GetVertexLayoutCount(uint16 MeshIndex) const { return ReaderPtr->getVertexLayoutCount(MeshIndex); } template FVertexLayout FDNAReader::GetVertexLayout(uint16 MeshIndex, uint32 LayoutIndex) const { const auto Layout = ReaderPtr->getVertexLayout(MeshIndex, LayoutIndex); return FVertexLayout{static_cast(Layout.position), static_cast(Layout.textureCoordinate), static_cast(Layout.normal)}; } template uint16 FDNAReader::GetMaximumInfluencePerVertex(uint16 MeshIndex) const { return ReaderPtr->getMaximumInfluencePerVertex(MeshIndex); } template uint32 FDNAReader::GetSkinWeightsCount(uint16 MeshIndex) const { return ReaderPtr->getSkinWeightsCount(MeshIndex); } template TArrayView FDNAReader::GetSkinWeightsValues(uint16 MeshIndex, uint32 VertexIndex) const { const auto Values = ReaderPtr->getSkinWeightsValues(MeshIndex, VertexIndex); return TArrayView(Values.data(), static_cast(Values.size())); } template TArrayView FDNAReader::GetSkinWeightsJointIndices(uint16 MeshIndex, uint32 VertexIndex) const { const auto Indices = ReaderPtr->getSkinWeightsJointIndices(MeshIndex, VertexIndex); return TArrayView(Indices.data(), static_cast(Indices.size())); } template uint16 FDNAReader::GetBlendShapeTargetCount(uint16 MeshIndex) const { return ReaderPtr->getBlendShapeTargetCount(MeshIndex); } template uint16 FDNAReader::GetBlendShapeChannelIndex(uint16 MeshIndex, uint16 BlendShapeTargetIndex) const { return ReaderPtr->getBlendShapeChannelIndex(MeshIndex, BlendShapeTargetIndex); } template uint32 FDNAReader::GetBlendShapeTargetDeltaCount(uint16 MeshIndex, uint16 BlendShapeTargetIndex) const { return ReaderPtr->getBlendShapeTargetDeltaCount(MeshIndex, BlendShapeTargetIndex); } template FVector FDNAReader::GetBlendShapeTargetDelta(uint16 MeshIndex, uint16 BlendShapeTargetIndex, uint32 DeltaIndex) const { const auto Delta = ReaderPtr->getBlendShapeTargetDelta(MeshIndex, BlendShapeTargetIndex, DeltaIndex); // X = X, Y = Z, Z = Y return FVector(Delta.x, Delta.z, Delta.y); } template TArrayView FDNAReader::GetBlendShapeTargetDeltaXs(uint16 MeshIndex, uint16 BlendShapeTargetIndex) const { // X = X const auto Values = ReaderPtr->getBlendShapeTargetDeltaXs(MeshIndex, BlendShapeTargetIndex); return TArrayView(Values.data(), static_cast(Values.size())); } template TArrayView FDNAReader::GetBlendShapeTargetDeltaYs(uint16 MeshIndex, uint16 BlendShapeTargetIndex) const { // Y = Z const auto Values = ReaderPtr->getBlendShapeTargetDeltaZs(MeshIndex, BlendShapeTargetIndex); return TArrayView(Values.data(), static_cast(Values.size())); } template TArrayView FDNAReader::GetBlendShapeTargetDeltaZs(uint16 MeshIndex, uint16 BlendShapeTargetIndex) const { // Z = Y const auto Values = ReaderPtr->getBlendShapeTargetDeltaYs(MeshIndex, BlendShapeTargetIndex); return TArrayView(Values.data(), static_cast(Values.size())); } template TArrayView FDNAReader::GetBlendShapeTargetVertexIndices(uint16 MeshIndex, uint16 BlendShapeTargetIndex) const { const auto Indices = ReaderPtr->getBlendShapeTargetVertexIndices(MeshIndex, BlendShapeTargetIndex); return TArrayView(Indices.data(), static_cast(Indices.size())); } template uint16 FDNAReader::GetMLControlCount() const { return ReaderPtr->getMLControlCount(); } template FString FDNAReader::GetMLControlName(uint16 Index) const { return FString(ANSI_TO_TCHAR(ReaderPtr->getMLControlName(Index).data())); } template uint16 FDNAReader::GetNeuralNetworkCount() const { return ReaderPtr->getNeuralNetworkCount(); } template uint16 FDNAReader::GetNeuralNetworkIndexListCount() const { return ReaderPtr->getNeuralNetworkIndexListCount(); } template TArrayView FDNAReader::GetNeuralNetworkIndicesForLOD(uint16 LOD) const { const auto Values = ReaderPtr->getNeuralNetworkIndicesForLOD(LOD); return TArrayView(Values.data(), static_cast(Values.size())); } template uint16 FDNAReader::GetMeshRegionCount(uint16 MeshIndex) const { return ReaderPtr->getMeshRegionCount(MeshIndex); } template FString FDNAReader::GetMeshRegionName(uint16 MeshIndex, uint16 RegionIndex) const { return FString(ANSI_TO_TCHAR(ReaderPtr->getMeshRegionName(MeshIndex, RegionIndex).data())); } template TArrayView FDNAReader::GetNeuralNetworkIndicesForMeshRegion(uint16 MeshIndex, uint16 RegionIndex) const { const auto Values = ReaderPtr->getNeuralNetworkIndicesForMeshRegion(MeshIndex, RegionIndex); return TArrayView(Values.data(), static_cast(Values.size())); } template TArrayView FDNAReader::GetNeuralNetworkInputIndices(uint16 NetIndex) const { const auto Values = ReaderPtr->getNeuralNetworkInputIndices(NetIndex); return TArrayView(Values.data(), static_cast(Values.size())); } template TArrayView FDNAReader::GetNeuralNetworkOutputIndices(uint16 NetIndex) const { const auto Values = ReaderPtr->getNeuralNetworkOutputIndices(NetIndex); return TArrayView(Values.data(), static_cast(Values.size())); } template uint16 FDNAReader::GetNeuralNetworkLayerCount(uint16 NetIndex) const { return ReaderPtr->getNeuralNetworkLayerCount(NetIndex); } template EActivationFunction FDNAReader::GetNeuralNetworkLayerActivationFunction(uint16 NetIndex, uint16 LayerIndex) const { return static_cast(ReaderPtr->getNeuralNetworkLayerActivationFunction(NetIndex, LayerIndex)); } template TArrayView FDNAReader::GetNeuralNetworkLayerActivationFunctionParameters(uint16 NetIndex, uint16 LayerIndex) const { const auto Values = ReaderPtr->getNeuralNetworkLayerActivationFunctionParameters(NetIndex, LayerIndex); return TArrayView(Values.data(), static_cast(Values.size())); } template TArrayView FDNAReader::GetNeuralNetworkLayerBiases(uint16 NetIndex, uint16 LayerIndex) const { const auto Values = ReaderPtr->getNeuralNetworkLayerBiases(NetIndex, LayerIndex); return TArrayView(Values.data(), static_cast(Values.size())); } template TArrayView FDNAReader::GetNeuralNetworkLayerWeights(uint16 NetIndex, uint16 LayerIndex) const { const auto Values = ReaderPtr->getNeuralNetworkLayerWeights(NetIndex, LayerIndex); return TArrayView(Values.data(), static_cast(Values.size())); } template ETranslationRepresentation FDNAReader::GetJointTranslationRepresentation(uint16 JointIndex) const { return static_cast(ReaderPtr->getJointTranslationRepresentation(JointIndex)); } template ERotationRepresentation FDNAReader::GetJointRotationRepresentation(uint16 JointIndex) const { return static_cast(ReaderPtr->getJointRotationRepresentation(JointIndex)); } template EScaleRepresentation FDNAReader::GetJointScaleRepresentation(uint16 JointIndex) const { return static_cast(ReaderPtr->getJointScaleRepresentation(JointIndex)); } template uint16 FDNAReader::GetRBFPoseCount() const { return ReaderPtr->getRBFPoseCount(); } template FString FDNAReader::GetRBFPoseName(uint16 PoseIndex) const { return FString(ANSI_TO_TCHAR(ReaderPtr->getRBFPoseName(PoseIndex).data())); } template TArrayView FDNAReader::GetRBFPoseJointOutputIndices(uint16 PoseIndex) const { const auto Indices = ReaderPtr->getRBFPoseJointOutputIndices(PoseIndex); return TArrayView(Indices.data(), static_cast(Indices.size())); } template TArrayView FDNAReader::GetRBFPoseBlendShapeChannelOutputIndices(uint16 PoseIndex) const { const auto Indices = ReaderPtr->getRBFPoseBlendShapeChannelOutputIndices(PoseIndex); return TArrayView(Indices.data(), static_cast(Indices.size())); } template TArrayView FDNAReader::GetRBFPoseAnimatedMapOutputIndices(uint16 PoseIndex) const { const auto Indices = ReaderPtr->getRBFPoseAnimatedMapOutputIndices(PoseIndex); return TArrayView(Indices.data(), static_cast(Indices.size())); } template TArrayView FDNAReader::GetRBFPoseJointOutputValues(uint16 PoseIndex) const { const auto Values = ReaderPtr->getRBFPoseJointOutputValues(PoseIndex); return TArrayView(Values.data(), static_cast(Values.size())); } template float FDNAReader::GetRBFPoseScale(uint16 PoseIndex) const { return ReaderPtr->getRBFPoseScale(PoseIndex); } template uint16 FDNAReader::GetRBFPoseControlCount() const { return ReaderPtr->getRBFPoseControlCount(); } template FString FDNAReader::GetRBFPoseControlName(uint16 PoseControlIndex) const { return FString(ANSI_TO_TCHAR(ReaderPtr->getRBFPoseControlName(PoseControlIndex).data())); } template TArrayView FDNAReader::GetRBFPoseInputControlIndices(uint16 PoseIndex) const { const auto Indices = ReaderPtr->getRBFPoseInputControlIndices(PoseIndex); return TArrayView(Indices.data(), static_cast(Indices.size())); } template TArrayView FDNAReader::GetRBFPoseOutputControlIndices(uint16 PoseIndex) const { const auto Indices = ReaderPtr->getRBFPoseOutputControlIndices(PoseIndex); return TArrayView(Indices.data(), static_cast(Indices.size())); } template TArrayView FDNAReader::GetRBFPoseOutputControlWeights(uint16 PoseIndex) const { const auto Values = ReaderPtr->getRBFPoseOutputControlWeights(PoseIndex); return TArrayView(Values.data(), static_cast(Values.size())); } template uint16 FDNAReader::GetRBFSolverCount() const { return ReaderPtr->getRBFSolverCount(); } template uint16 FDNAReader::GetRBFSolverIndexListCount() const { return ReaderPtr->getRBFSolverIndexListCount(); } template TArrayView FDNAReader::GetRBFSolverIndicesForLOD(uint16 LOD) const { const auto Indices = ReaderPtr->getRBFSolverIndicesForLOD(LOD); return TArrayView(Indices.data(), static_cast(Indices.size())); } template FString FDNAReader::GetRBFSolverName(uint16 SolverIndex) const { return FString(ANSI_TO_TCHAR(ReaderPtr->getRBFSolverName(SolverIndex).data())); } template TArrayView FDNAReader::GetRBFSolverRawControlIndices(uint16 SolverIndex) const { const auto Indices = ReaderPtr->getRBFSolverRawControlIndices(SolverIndex); return TArrayView(Indices.data(), static_cast(Indices.size())); } template TArrayView FDNAReader::GetRBFSolverPoseIndices(uint16 SolverIndex) const { const auto Indices = ReaderPtr->getRBFSolverPoseIndices(SolverIndex); return TArrayView(Indices.data(), static_cast(Indices.size())); } template TArrayView FDNAReader::GetRBFSolverRawControlValues(uint16 SolverIndex) const { const auto Values = ReaderPtr->getRBFSolverRawControlValues(SolverIndex); return TArrayView(Values.data(), static_cast(Values.size())); } template ERBFSolverType FDNAReader::GetRBFSolverType(uint16 SolverIndex) const { return static_cast(ReaderPtr->getRBFSolverType(SolverIndex)); } template float FDNAReader::GetRBFSolverRadius(uint16 SolverIndex) const { return ReaderPtr->getRBFSolverRadius(SolverIndex); } template EAutomaticRadius FDNAReader::GetRBFSolverAutomaticRadius(uint16 SolverIndex) const { return static_cast(ReaderPtr->getRBFSolverAutomaticRadius(SolverIndex)); } template float FDNAReader::GetRBFSolverWeightThreshold(uint16 SolverIndex) const { return ReaderPtr->getRBFSolverWeightThreshold(SolverIndex); } template ERBFDistanceMethod FDNAReader::GetRBFSolverDistanceMethod(uint16 SolverIndex) const { return static_cast(ReaderPtr->getRBFSolverDistanceMethod(SolverIndex)); } template ERBFNormalizeMethod FDNAReader::GetRBFSolverNormalizeMethod(uint16 SolverIndex) const { return static_cast(ReaderPtr->getRBFSolverNormalizeMethod(SolverIndex)); } template ERBFFunctionType FDNAReader::GetRBFSolverFunctionType(uint16 SolverIndex) const { return static_cast(ReaderPtr->getRBFSolverFunctionType(SolverIndex)); } template ETwistAxis FDNAReader::GetRBFSolverTwistAxis(uint16 SolverIndex) const { return static_cast(ReaderPtr->getRBFSolverTwistAxis(SolverIndex)); } template uint16 FDNAReader::GetTwistCount() const { return ReaderPtr->getTwistCount(); } template ETwistAxis FDNAReader::GetTwistSetupTwistAxis(uint16 TwistIndex) const { return static_cast(ReaderPtr->getTwistSetupTwistAxis(TwistIndex)); } template TArrayView FDNAReader::GetTwistInputControlIndices(uint16 TwistIndex) const { const auto Indices = ReaderPtr->getTwistInputControlIndices(TwistIndex); return TArrayView(Indices.data(), static_cast(Indices.size())); } template TArrayView FDNAReader::GetTwistOutputJointIndices(uint16 TwistIndex) const { const auto Indices = ReaderPtr->getTwistOutputJointIndices(TwistIndex); return TArrayView(Indices.data(), static_cast(Indices.size())); } template TArrayView FDNAReader::GetTwistBlendWeights(uint16 TwistIndex) const { const auto Values = ReaderPtr->getTwistBlendWeights(TwistIndex); return TArrayView(Values.data(), static_cast(Values.size())); } template uint16 FDNAReader::GetSwingCount() const { return ReaderPtr->getSwingCount(); } template ETwistAxis FDNAReader::GetSwingSetupTwistAxis(uint16 SwingIndex) const { return static_cast(ReaderPtr->getSwingSetupTwistAxis(SwingIndex)); } template TArrayView FDNAReader::GetSwingInputControlIndices(uint16 SwingIndex) const { const auto Indices = ReaderPtr->getSwingInputControlIndices(SwingIndex); return TArrayView(Indices.data(), static_cast(Indices.size())); } template TArrayView FDNAReader::GetSwingOutputJointIndices(uint16 SwingIndex) const { const auto Indices = ReaderPtr->getSwingOutputJointIndices(SwingIndex); return TArrayView(Indices.data(), static_cast(Indices.size())); } template TArrayView FDNAReader::GetSwingBlendWeights(uint16 SwingIndex) const { const auto Values = ReaderPtr->getSwingBlendWeights(SwingIndex); return TArrayView(Values.data(), static_cast(Values.size())); }