-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathFbxWriter.cs
More file actions
47 lines (42 loc) · 1.35 KB
/
FbxWriter.cs
File metadata and controls
47 lines (42 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.Runtime.InteropServices;
using PLATEAU.Geometries;
using PLATEAU.Interop;
using PLATEAU.PolygonMesh;
namespace PLATEAU.MeshWriter
{
[StructLayout(LayoutKind.Sequential)]
public struct FbxWriteOptions
{
public FbxFileFormat FileFormat;
public CoordinateSystem CoordinateSystem;
public FbxWriteOptions(FbxFileFormat fileFormat, CoordinateSystem coordinateSystem)
{
this.FileFormat = fileFormat;
this.CoordinateSystem = coordinateSystem;
}
}
public enum FbxFileFormat : UInt32
{
Binary, Ascii
}
public static class FbxWriter
{
public static bool Write(string fbxPath, Model model, FbxWriteOptions options)
{
var fbxPathUtf8 = DLLUtil.StrToUtf8Bytes(fbxPath);
var result = NativeMethods.plateau_fbx_writer_write(fbxPathUtf8, model.Handle, options, out bool isSucceed);
DLLUtil.CheckDllError(result);
return isSucceed;
}
private static class NativeMethods
{
[DllImport(DLLUtil.DllName)]
internal static extern APIResult plateau_fbx_writer_write(
[In] byte[] fbxFilePathUtf8,
[In] IntPtr modelPtr,
FbxWriteOptions options,
out bool outIsSucceed);
}
}
}