2019-12-26 15:32:37 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
2019-10-04 13:11:45 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
2022-07-20 12:03:45 -04:00
|
|
|
#include "Containers/UnrealString.h"
|
2019-10-04 13:11:45 -04:00
|
|
|
#include "DatasmithExportOptions.h"
|
2022-07-20 12:03:45 -04:00
|
|
|
#include "HAL/Platform.h"
|
2019-10-04 13:11:45 -04:00
|
|
|
#include "Templates/SharedPointer.h"
|
2022-07-20 12:03:45 -04:00
|
|
|
#include "Templates/UniquePtr.h"
|
2019-10-04 13:11:45 -04:00
|
|
|
|
|
|
|
|
class FDatasmithMesh;
|
|
|
|
|
class IDatasmithMeshElement;
|
|
|
|
|
|
|
|
|
|
class DATASMITHEXPORTER_API FDatasmithMeshExporter
|
|
|
|
|
{
|
|
|
|
|
public:
|
2022-08-16 08:22:50 -04:00
|
|
|
FDatasmithMeshExporter();
|
2020-02-17 13:28:31 -05:00
|
|
|
virtual ~FDatasmithMeshExporter();
|
|
|
|
|
|
2019-10-04 13:11:45 -04:00
|
|
|
/**
|
|
|
|
|
* Exports the DatasmithMesh as a UObject.
|
|
|
|
|
*
|
|
|
|
|
* @param Filepath The path where the resulting file will be written
|
|
|
|
|
* @param Filename The name of the file to export to, without any path or extension
|
|
|
|
|
* @param Mesh The mesh to export
|
|
|
|
|
* @param CollisionMesh An optional collision mesh
|
|
|
|
|
* @param LightmapUV The UV generation export option
|
|
|
|
|
*
|
|
|
|
|
* @return A IDatasmithMeshElement that refers to the exported file
|
|
|
|
|
*/
|
2022-08-16 08:22:50 -04:00
|
|
|
TSharedPtr<IDatasmithMeshElement> ExportToUObject(const TCHAR* Filepath, const TCHAR* Filename, FDatasmithMesh& Mesh, FDatasmithMesh* CollisionMesh, EDSExportLightmapUV LightmapUV);
|
2022-03-23 16:31:37 -04:00
|
|
|
|
2020-09-24 00:43:27 -04:00
|
|
|
/**
|
|
|
|
|
* Exports a FDatasmithMesh as a UObject and link it to the given IDatasmithMeshElementElement.
|
|
|
|
|
*
|
2022-05-20 13:21:20 -04:00
|
|
|
* @param MeshElement The existing MeshElement for which we want to export a FDatasmithMesh, the name of the MeshElement will determine the name of the exported file.
|
2020-09-24 00:43:27 -04:00
|
|
|
* @param Filepath The path where the resulting file will be written
|
|
|
|
|
* @param Mesh The mesh to export
|
|
|
|
|
* @param CollisionMesh An optional collision mesh
|
|
|
|
|
* @param LightmapUV The UV generation export option
|
|
|
|
|
*
|
|
|
|
|
* @return True if export was successful.
|
|
|
|
|
*/
|
2022-08-16 08:22:50 -04:00
|
|
|
bool ExportToUObject(TSharedPtr<IDatasmithMeshElement>& MeshElement, const TCHAR* Filepath, FDatasmithMesh& Mesh, FDatasmithMesh* CollisionMesh, EDSExportLightmapUV LightmapUV);
|
2019-10-04 13:11:45 -04:00
|
|
|
|
2022-08-26 13:20:02 -04:00
|
|
|
bool ExportCloth(class FDatasmithCloth& Cloth, TSharedPtr<class IDatasmithClothElement>& ClothElement, const TCHAR* FilePath, const TCHAR* AssetsOutputPath) const;
|
|
|
|
|
|
2019-10-04 13:11:45 -04:00
|
|
|
/**
|
|
|
|
|
* @return The error that happened during the last export, if any
|
|
|
|
|
*/
|
2020-02-17 13:28:31 -05:00
|
|
|
FString GetLastError() const;
|
2019-10-04 13:11:45 -04:00
|
|
|
|
|
|
|
|
private:
|
2022-03-23 16:31:37 -04:00
|
|
|
TUniquePtr<class FDatasmithMeshExporterImpl> Impl;
|
2019-10-04 13:11:45 -04:00
|
|
|
};
|