DatasmithMeshExporter.h
1 // Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
2 #pragma once
3 
4 #include "DatasmithExportOptions.h"
5 #include "Templates/SharedPointer.h"
6 
7 class FDatasmithMesh;
8 class FDatasmithMeshExporterImpl;
10 struct FMeshDescription;
11 
12 class DATASMITHEXPORTER_API FDatasmithMeshExporter
13 {
14 public:
15  /**
16  * Exports the DatasmithMesh as a UObject.
17  *
18  * @param Filepath The path where the resulting file will be written
19  * @param Filename The name of the file to export to, without any path or extension
20  * @param Mesh The mesh to export
21  * @param CollisionMesh An optional collision mesh
22  * @param LightmapUV The UV generation export option
23  *
24  * @return A IDatasmithMeshElement that refers to the exported file
25  */
26  TSharedPtr< IDatasmithMeshElement > ExportToUObject( const TCHAR* Filepath, const TCHAR* Filename, FDatasmithMesh& Mesh, FDatasmithMesh* CollisionMesh, EDSExportLightmapUV LightmapUV );
27 
28  /**
29  * @return The error that happened during the last export, if any
30  */
31  FString GetLastError() const { return LastError; }
32 
33 private:
34  void PreExport( FDatasmithMesh& DatasmithMesh, const TCHAR* Filepath, const TCHAR* Filename, EDSExportLightmapUV LightmapUV );
35  void PostExport( const FDatasmithMesh& DatasmithMesh, TSharedRef< IDatasmithMeshElement > MeshElement );
36 
37  void CreateDefaultUVs( FDatasmithMesh& DatasmithMesh );
38  void RegisterStaticMeshAttributes( FMeshDescription& MeshDescription);
39 
40  FString LastError;
41 };
IDatasmithMeshElement
IDatasmithMeshElement defines an actual geometry.
Definition: IDatasmithSceneElements.h:168
FDatasmithMeshExporter
Definition: DatasmithMeshExporter.h:12
FDatasmithMesh
Definition: DatasmithMesh.h:6
FDatasmithMeshExporter::GetLastError
FString GetLastError() const
Definition: DatasmithMeshExporter.h:31