-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathMobuLiveLinkPlugin2017.Build.cs
More file actions
135 lines (120 loc) · 4.35 KB
/
MobuLiveLinkPlugin2017.Build.cs
File metadata and controls
135 lines (120 loc) · 4.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
// Copyright Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
using System.IO;
public abstract class MobuLiveLinkPluginBase : ModuleRules
{
private string version;
public string Version
{
get { return version; }
set { version = value; }
}
abstract public string PythonFullVersion
{
get;
}
abstract public string PythonVersion
{
get;
}
private string moBuInstallFolder;
public string MotionBuilderInstallFolder
{
get { return moBuInstallFolder; }
set { moBuInstallFolder = value; }
}
private string moBuOpenRealitySDK;
public string MotionBuilderOpenRealitySDK
{
get { return moBuOpenRealitySDK; }
set { moBuOpenRealitySDK = value; }
}
public MobuLiveLinkPluginBase(ReadOnlyTargetRules Target, string MobuVersionString) : base(Target)
{
PrivatePCHHeaderFile = "Private/MobuLiveLinkPluginPrivatePCH.h";
bEnforceIWYU = false;
bUseRTTI = true;
PrivateIncludePaths.AddRange(new string[]
{
Path.Combine(EngineDirectory, "Source/Runtime/Launch/Public"),
Path.Combine(EngineDirectory, "Source/Runtime/Launch/Private"),
Path.Combine(ModuleDirectory, "StreamObjects/Public"),
});
// Unreal dependency modules
PrivateDependencyModuleNames.AddRange(new string[]
{
"Core",
"CoreUObject",
"ApplicationCore",
"Messaging",
"Projects",
"UdpMessaging",
"LiveLinkInterface",
"LiveLinkMessageBusFramework",
});
// Mobu SDK setup
{
//UE_MOTIONBUILDER2017_INSTALLATIONFOLDER
string MobuInstallFolder = System.Environment.GetEnvironmentVariable("UE_MOTIONBUILDER" + MobuVersionString + "_INSTALLATIONFOLDER");
if (string.IsNullOrEmpty(MobuInstallFolder))
{
MobuInstallFolder = @"C:\Program Files\Autodesk\MotionBuilder " + MobuVersionString;
}
MotionBuilderInstallFolder = MobuInstallFolder;
// now MobuInstallFolder is actually MotionBuilder's SDK folder
MobuInstallFolder = Path.Combine(MobuInstallFolder, "OpenRealitySDK");
MotionBuilderOpenRealitySDK = MobuInstallFolder;
if (!Directory.Exists(MobuInstallFolder))
{
// Try with build machine setup
string SDKRootEnvVar = System.Environment.GetEnvironmentVariable("UE_SDKS_ROOT");
if (!string.IsNullOrEmpty(SDKRootEnvVar))
{
MobuInstallFolder = Path.Combine(SDKRootEnvVar, "HostWin64", "Win64", "MotionBuilder", MobuVersionString);
}
}
// Make sure this version of Mobu is actually installed
if (Directory.Exists(MobuInstallFolder))
{
PrivateIncludePaths.Add(Path.Combine(MobuInstallFolder, "include"));
if (Target.Platform == UnrealTargetPlatform.Win64) // @todo: Support other platforms?
{
string LibDir = Path.Combine(MobuInstallFolder, "lib/x64");
// Mobu library we're depending on
PublicAdditionalLibraries.Add(Path.Combine(LibDir, "fbsdk.lib"));
}
}
}
}
public void IncludePyFbSdkVersionSpecific()
{
if (Directory.Exists(MotionBuilderOpenRealitySDK))
{
string pyFbSdkIncludeFolder = Path.Combine(MotionBuilderOpenRealitySDK, "include\\pyfbsdk");
string pythonBoostIncludeFolder = Path.Combine(MotionBuilderOpenRealitySDK, "include\\boost");
string pythonIncludeFolder = Path.Combine(MotionBuilderOpenRealitySDK, $"include\\python-{PythonFullVersion}\\include");
PrivateIncludePaths.Add(pyFbSdkIncludeFolder);
PrivateIncludePaths.Add(pythonBoostIncludeFolder);
PrivateIncludePaths.Add(pythonIncludeFolder);
if (Target.Platform == UnrealTargetPlatform.Win64)
{
string LibDir = Path.Combine(MotionBuilderOpenRealitySDK, "lib\\x64");
PublicAdditionalLibraries.Add(Path.Combine(LibDir, $"boost_python{PythonVersion}.lib"));
string pyFbSdkLibDir = Path.Combine(MotionBuilderOpenRealitySDK, $"lib\\x64\\python{PythonVersion}");
PublicAdditionalLibraries.Add(Path.Combine(pyFbSdkLibDir, "pyfbsdk.lib"));
}
PrivateDefinitions.Add("MOBU_PYTHON_PLUGIN");
PrivateDefinitions.Add($"FBPYTHON_VERSION={PythonVersion}");
}
}
}
public class MobuLiveLinkPlugin2017 : MobuLiveLinkPluginBase
{
readonly private string pythonFullVersion = "2.7.6";
public override string PythonFullVersion => pythonFullVersion;
readonly private string pythonVersion = "27";
public override string PythonVersion => pythonVersion;
public MobuLiveLinkPlugin2017(ReadOnlyTargetRules Target) : base(Target, "2017")
{
}
}