From 429965a47fd836d8dd7b55ece6d87e013dbeb9f5 Mon Sep 17 00:00:00 2001 From: KirillFromTechAnimTeam <99897702+KirillFromTechAnimTeam@users.noreply.github.com> Date: Tue, 9 Aug 2022 15:13:23 +0200 Subject: [PATCH 01/10] Supports Unreal Engine 5 --- Source/MobuLiveLinkPlugin2017.Target.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/MobuLiveLinkPlugin2017.Target.cs b/Source/MobuLiveLinkPlugin2017.Target.cs index 11eb1364..76e4a310 100644 --- a/Source/MobuLiveLinkPlugin2017.Target.cs +++ b/Source/MobuLiveLinkPlugin2017.Target.cs @@ -3,7 +3,7 @@ using UnrealBuildTool; using System; using System.IO; -using Tools.DotNETCommon; +using EpicGames.Core; using System.Runtime.CompilerServices; [SupportedPlatforms(UnrealPlatformClass.Desktop)] From 11dfcc3892eb3d7b6016a6625d97d31717d9b2a9 Mon Sep 17 00:00:00 2001 From: KirillFromTechAnimTeam <99897702+KirillFromTechAnimTeam@users.noreply.github.com> Date: Wed, 10 Aug 2022 10:19:01 +0200 Subject: [PATCH 02/10] Second try in supporting python wrapping --- Source/MobuLiveLinkPlugin2016.Build.cs | 2 ++ Source/MobuLiveLinkPlugin2017.Build.cs | 10 ++++++++++ Source/MobuLiveLinkPlugin2018.Build.cs | 2 ++ Source/MobuLiveLinkPlugin2019.Build.cs | 2 ++ Source/MobuLiveLinkPlugin2020.Build.cs | 2 ++ Source/MobuLiveLinkPlugin2022.Build.cs | 2 ++ 6 files changed, 20 insertions(+) diff --git a/Source/MobuLiveLinkPlugin2016.Build.cs b/Source/MobuLiveLinkPlugin2016.Build.cs index f47f6701..f460328b 100644 --- a/Source/MobuLiveLinkPlugin2016.Build.cs +++ b/Source/MobuLiveLinkPlugin2016.Build.cs @@ -5,6 +5,8 @@ public class MobuLiveLinkPlugin2016 : MobuLiveLinkPluginBase { + public override string PyFullVerFloat() => "2.7.6"; + public override string PyVer() => "27"; public MobuLiveLinkPlugin2016(ReadOnlyTargetRules Target) : base(Target, "2016") { } diff --git a/Source/MobuLiveLinkPlugin2017.Build.cs b/Source/MobuLiveLinkPlugin2017.Build.cs index 2af6f30a..286e5d37 100644 --- a/Source/MobuLiveLinkPlugin2017.Build.cs +++ b/Source/MobuLiveLinkPlugin2017.Build.cs @@ -5,6 +5,8 @@ public abstract class MobuLiveLinkPluginBase : ModuleRules { + public abstract string PyFullVerFloat(); + public abstract string PyVer(); public MobuLiveLinkPluginBase(ReadOnlyTargetRules Target, string MobuVersionString) : base(Target) { PrivatePCHHeaderFile = "Private/MobuLiveLinkPluginPrivatePCH.h"; @@ -56,13 +58,19 @@ public MobuLiveLinkPluginBase(ReadOnlyTargetRules Target, string MobuVersionStri if (Directory.Exists(MobuInstallFolder)) { PrivateIncludePaths.Add(Path.Combine(MobuInstallFolder, "include")); + PrivateIncludePaths.Add(Path.Combine(MobuInstallFolder, "include\\pyfbsdk")); + PrivateIncludePaths.Add(Path.Combine(MobuInstallFolder, "include\\boost")); + PrivateIncludePaths.Add(Path.Combine(MobuInstallFolder, $"include\\python-{PyFullVerFloat()}")); if (Target.Platform == UnrealTargetPlatform.Win64) // @todo: Support other platforms? { string LibDir = Path.Combine(MobuInstallFolder, "lib/x64"); + string PyLibDir = Path.Combine(MobuInstallFolder, $"lib/x64/python{PyVer()}"); // Mobu library we're depending on PublicAdditionalLibraries.Add(Path.Combine(LibDir, "fbsdk.lib")); + PublicAdditionalLibraries.Add(Path.Combine(LibDir, $"boost_python{PyVer()}.lib")); + PublicAdditionalLibraries.Add(Path.Combine(PyLibDir, "pyfbsdk.lib")); } } } @@ -71,6 +79,8 @@ public MobuLiveLinkPluginBase(ReadOnlyTargetRules Target, string MobuVersionStri public class MobuLiveLinkPlugin2017 : MobuLiveLinkPluginBase { + public override string PyFullVerFloat() => "2.7.6"; + public override string PyVer() => "27"; public MobuLiveLinkPlugin2017(ReadOnlyTargetRules Target) : base(Target, "2017") { } diff --git a/Source/MobuLiveLinkPlugin2018.Build.cs b/Source/MobuLiveLinkPlugin2018.Build.cs index b9d18ed9..3d20fbaa 100644 --- a/Source/MobuLiveLinkPlugin2018.Build.cs +++ b/Source/MobuLiveLinkPlugin2018.Build.cs @@ -5,6 +5,8 @@ public class MobuLiveLinkPlugin2018 : MobuLiveLinkPluginBase { + public override string PyFullVerFloat() => "2.7.6"; + public override string PyVer() => "27"; public MobuLiveLinkPlugin2018(ReadOnlyTargetRules Target) : base(Target, "2018") { } diff --git a/Source/MobuLiveLinkPlugin2019.Build.cs b/Source/MobuLiveLinkPlugin2019.Build.cs index a1cfa58a..e4867ef4 100644 --- a/Source/MobuLiveLinkPlugin2019.Build.cs +++ b/Source/MobuLiveLinkPlugin2019.Build.cs @@ -5,6 +5,8 @@ public class MobuLiveLinkPlugin2019 : MobuLiveLinkPluginBase { + public override string PyFullVerFloat() => "2.7.11"; + public override string PyVer() => "27"; public MobuLiveLinkPlugin2019(ReadOnlyTargetRules Target) : base(Target, "2019") { } diff --git a/Source/MobuLiveLinkPlugin2020.Build.cs b/Source/MobuLiveLinkPlugin2020.Build.cs index 8985cad0..b244b880 100644 --- a/Source/MobuLiveLinkPlugin2020.Build.cs +++ b/Source/MobuLiveLinkPlugin2020.Build.cs @@ -5,6 +5,8 @@ public class MobuLiveLinkPlugin2020 : MobuLiveLinkPluginBase { + public override string PyFullVerFloat() => "2.7.11"; + public override string PyVer() => "27"; public MobuLiveLinkPlugin2020(ReadOnlyTargetRules Target) : base(Target, "2020") { } diff --git a/Source/MobuLiveLinkPlugin2022.Build.cs b/Source/MobuLiveLinkPlugin2022.Build.cs index af16378c..6e081946 100644 --- a/Source/MobuLiveLinkPlugin2022.Build.cs +++ b/Source/MobuLiveLinkPlugin2022.Build.cs @@ -5,6 +5,8 @@ public class MobuLiveLinkPlugin2022 : MobuLiveLinkPluginBase { + public override string PyFullVerFloat() => "3.7.7"; + public override string PyVer() => "37"; public MobuLiveLinkPlugin2022(ReadOnlyTargetRules Target) : base(Target, "2022") { CppStandard = CppStandardVersion.Cpp17; From 75e356eb181419fffcba81052e23c0e2237d861a Mon Sep 17 00:00:00 2001 From: KirillFromTechAnimTeam <99897702+KirillFromTechAnimTeam@users.noreply.github.com> Date: Wed, 10 Aug 2022 10:58:05 +0200 Subject: [PATCH 03/10] Implements proper include for Python --- Source/MobuLiveLinkPlugin2017.Build.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/MobuLiveLinkPlugin2017.Build.cs b/Source/MobuLiveLinkPlugin2017.Build.cs index 286e5d37..bed1ec15 100644 --- a/Source/MobuLiveLinkPlugin2017.Build.cs +++ b/Source/MobuLiveLinkPlugin2017.Build.cs @@ -54,13 +54,16 @@ public MobuLiveLinkPluginBase(ReadOnlyTargetRules Target, string MobuVersionStri } } + PrivateDefinitions.Add($"FBPYTHON_VERSION ={PyVer()}"); + PrivateDefinitions.Add("MOBU_PYTHON_PLUGIN"); + // Make sure this version of Mobu is actually installed if (Directory.Exists(MobuInstallFolder)) { PrivateIncludePaths.Add(Path.Combine(MobuInstallFolder, "include")); PrivateIncludePaths.Add(Path.Combine(MobuInstallFolder, "include\\pyfbsdk")); PrivateIncludePaths.Add(Path.Combine(MobuInstallFolder, "include\\boost")); - PrivateIncludePaths.Add(Path.Combine(MobuInstallFolder, $"include\\python-{PyFullVerFloat()}")); + PrivateIncludePaths.Add(Path.Combine(MobuInstallFolder, $"include\\python-{PyFullVerFloat()}\\include")); if (Target.Platform == UnrealTargetPlatform.Win64) // @todo: Support other platforms? { From ab7573755a6e160e0f435c335cdc395cce031e34 Mon Sep 17 00:00:00 2001 From: KirillFromTechAnimTeam <99897702+KirillFromTechAnimTeam@users.noreply.github.com> Date: Tue, 16 Aug 2022 11:10:19 +0200 Subject: [PATCH 04/10] Revert "Implements proper include for Python" This reverts commit 75e356eb181419fffcba81052e23c0e2237d861a. --- Source/MobuLiveLinkPlugin2017.Build.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Source/MobuLiveLinkPlugin2017.Build.cs b/Source/MobuLiveLinkPlugin2017.Build.cs index bed1ec15..286e5d37 100644 --- a/Source/MobuLiveLinkPlugin2017.Build.cs +++ b/Source/MobuLiveLinkPlugin2017.Build.cs @@ -54,16 +54,13 @@ public MobuLiveLinkPluginBase(ReadOnlyTargetRules Target, string MobuVersionStri } } - PrivateDefinitions.Add($"FBPYTHON_VERSION ={PyVer()}"); - PrivateDefinitions.Add("MOBU_PYTHON_PLUGIN"); - // Make sure this version of Mobu is actually installed if (Directory.Exists(MobuInstallFolder)) { PrivateIncludePaths.Add(Path.Combine(MobuInstallFolder, "include")); PrivateIncludePaths.Add(Path.Combine(MobuInstallFolder, "include\\pyfbsdk")); PrivateIncludePaths.Add(Path.Combine(MobuInstallFolder, "include\\boost")); - PrivateIncludePaths.Add(Path.Combine(MobuInstallFolder, $"include\\python-{PyFullVerFloat()}\\include")); + PrivateIncludePaths.Add(Path.Combine(MobuInstallFolder, $"include\\python-{PyFullVerFloat()}")); if (Target.Platform == UnrealTargetPlatform.Win64) // @todo: Support other platforms? { From dabb8d11e4898357e7559a8beb485757a3081c3b Mon Sep 17 00:00:00 2001 From: KirillFromTechAnimTeam <99897702+KirillFromTechAnimTeam@users.noreply.github.com> Date: Tue, 16 Aug 2022 11:10:23 +0200 Subject: [PATCH 05/10] Revert "Second try in supporting python wrapping" This reverts commit 11dfcc3892eb3d7b6016a6625d97d31717d9b2a9. --- Source/MobuLiveLinkPlugin2016.Build.cs | 2 -- Source/MobuLiveLinkPlugin2017.Build.cs | 10 ---------- Source/MobuLiveLinkPlugin2018.Build.cs | 2 -- Source/MobuLiveLinkPlugin2019.Build.cs | 2 -- Source/MobuLiveLinkPlugin2020.Build.cs | 2 -- Source/MobuLiveLinkPlugin2022.Build.cs | 2 -- 6 files changed, 20 deletions(-) diff --git a/Source/MobuLiveLinkPlugin2016.Build.cs b/Source/MobuLiveLinkPlugin2016.Build.cs index f460328b..f47f6701 100644 --- a/Source/MobuLiveLinkPlugin2016.Build.cs +++ b/Source/MobuLiveLinkPlugin2016.Build.cs @@ -5,8 +5,6 @@ public class MobuLiveLinkPlugin2016 : MobuLiveLinkPluginBase { - public override string PyFullVerFloat() => "2.7.6"; - public override string PyVer() => "27"; public MobuLiveLinkPlugin2016(ReadOnlyTargetRules Target) : base(Target, "2016") { } diff --git a/Source/MobuLiveLinkPlugin2017.Build.cs b/Source/MobuLiveLinkPlugin2017.Build.cs index 286e5d37..2af6f30a 100644 --- a/Source/MobuLiveLinkPlugin2017.Build.cs +++ b/Source/MobuLiveLinkPlugin2017.Build.cs @@ -5,8 +5,6 @@ public abstract class MobuLiveLinkPluginBase : ModuleRules { - public abstract string PyFullVerFloat(); - public abstract string PyVer(); public MobuLiveLinkPluginBase(ReadOnlyTargetRules Target, string MobuVersionString) : base(Target) { PrivatePCHHeaderFile = "Private/MobuLiveLinkPluginPrivatePCH.h"; @@ -58,19 +56,13 @@ public MobuLiveLinkPluginBase(ReadOnlyTargetRules Target, string MobuVersionStri if (Directory.Exists(MobuInstallFolder)) { PrivateIncludePaths.Add(Path.Combine(MobuInstallFolder, "include")); - PrivateIncludePaths.Add(Path.Combine(MobuInstallFolder, "include\\pyfbsdk")); - PrivateIncludePaths.Add(Path.Combine(MobuInstallFolder, "include\\boost")); - PrivateIncludePaths.Add(Path.Combine(MobuInstallFolder, $"include\\python-{PyFullVerFloat()}")); if (Target.Platform == UnrealTargetPlatform.Win64) // @todo: Support other platforms? { string LibDir = Path.Combine(MobuInstallFolder, "lib/x64"); - string PyLibDir = Path.Combine(MobuInstallFolder, $"lib/x64/python{PyVer()}"); // Mobu library we're depending on PublicAdditionalLibraries.Add(Path.Combine(LibDir, "fbsdk.lib")); - PublicAdditionalLibraries.Add(Path.Combine(LibDir, $"boost_python{PyVer()}.lib")); - PublicAdditionalLibraries.Add(Path.Combine(PyLibDir, "pyfbsdk.lib")); } } } @@ -79,8 +71,6 @@ public MobuLiveLinkPluginBase(ReadOnlyTargetRules Target, string MobuVersionStri public class MobuLiveLinkPlugin2017 : MobuLiveLinkPluginBase { - public override string PyFullVerFloat() => "2.7.6"; - public override string PyVer() => "27"; public MobuLiveLinkPlugin2017(ReadOnlyTargetRules Target) : base(Target, "2017") { } diff --git a/Source/MobuLiveLinkPlugin2018.Build.cs b/Source/MobuLiveLinkPlugin2018.Build.cs index 3d20fbaa..b9d18ed9 100644 --- a/Source/MobuLiveLinkPlugin2018.Build.cs +++ b/Source/MobuLiveLinkPlugin2018.Build.cs @@ -5,8 +5,6 @@ public class MobuLiveLinkPlugin2018 : MobuLiveLinkPluginBase { - public override string PyFullVerFloat() => "2.7.6"; - public override string PyVer() => "27"; public MobuLiveLinkPlugin2018(ReadOnlyTargetRules Target) : base(Target, "2018") { } diff --git a/Source/MobuLiveLinkPlugin2019.Build.cs b/Source/MobuLiveLinkPlugin2019.Build.cs index e4867ef4..a1cfa58a 100644 --- a/Source/MobuLiveLinkPlugin2019.Build.cs +++ b/Source/MobuLiveLinkPlugin2019.Build.cs @@ -5,8 +5,6 @@ public class MobuLiveLinkPlugin2019 : MobuLiveLinkPluginBase { - public override string PyFullVerFloat() => "2.7.11"; - public override string PyVer() => "27"; public MobuLiveLinkPlugin2019(ReadOnlyTargetRules Target) : base(Target, "2019") { } diff --git a/Source/MobuLiveLinkPlugin2020.Build.cs b/Source/MobuLiveLinkPlugin2020.Build.cs index b244b880..8985cad0 100644 --- a/Source/MobuLiveLinkPlugin2020.Build.cs +++ b/Source/MobuLiveLinkPlugin2020.Build.cs @@ -5,8 +5,6 @@ public class MobuLiveLinkPlugin2020 : MobuLiveLinkPluginBase { - public override string PyFullVerFloat() => "2.7.11"; - public override string PyVer() => "27"; public MobuLiveLinkPlugin2020(ReadOnlyTargetRules Target) : base(Target, "2020") { } diff --git a/Source/MobuLiveLinkPlugin2022.Build.cs b/Source/MobuLiveLinkPlugin2022.Build.cs index 6e081946..af16378c 100644 --- a/Source/MobuLiveLinkPlugin2022.Build.cs +++ b/Source/MobuLiveLinkPlugin2022.Build.cs @@ -5,8 +5,6 @@ public class MobuLiveLinkPlugin2022 : MobuLiveLinkPluginBase { - public override string PyFullVerFloat() => "3.7.7"; - public override string PyVer() => "37"; public MobuLiveLinkPlugin2022(ReadOnlyTargetRules Target) : base(Target, "2022") { CppStandard = CppStandardVersion.Cpp17; From 0e21767d2e86a4ee06c47b61233ea3fc7449aea0 Mon Sep 17 00:00:00 2001 From: KirillFromTechAnimTeam <99897702+KirillFromTechAnimTeam@users.noreply.github.com> Date: Tue, 16 Aug 2022 11:14:31 +0200 Subject: [PATCH 06/10] Implements build and target for MotionBuilder 2023 --- Source/MobuLiveLinkPlugin2023.Build.cs | 12 ++++++++++++ Source/MobuLiveLinkPlugin2023.Target.cs | 11 +++++++++++ 2 files changed, 23 insertions(+) create mode 100644 Source/MobuLiveLinkPlugin2023.Build.cs create mode 100644 Source/MobuLiveLinkPlugin2023.Target.cs diff --git a/Source/MobuLiveLinkPlugin2023.Build.cs b/Source/MobuLiveLinkPlugin2023.Build.cs new file mode 100644 index 00000000..8777eda7 --- /dev/null +++ b/Source/MobuLiveLinkPlugin2023.Build.cs @@ -0,0 +1,12 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +using UnrealBuildTool; +using System.IO; + +public class MobuLiveLinkPlugin2023 : MobuLiveLinkPluginBase +{ + public MobuLiveLinkPlugin2023(ReadOnlyTargetRules Target) : base(Target, "2023") + { + CppStandard = CppStandardVersion.Cpp17; + } +} diff --git a/Source/MobuLiveLinkPlugin2023.Target.cs b/Source/MobuLiveLinkPlugin2023.Target.cs new file mode 100644 index 00000000..8badfc5f --- /dev/null +++ b/Source/MobuLiveLinkPlugin2023.Target.cs @@ -0,0 +1,11 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +using UnrealBuildTool; +using System.Collections.Generic; +using System.IO; + +public class MobuLiveLinkPlugin2023Target : MobuLiveLinkPluginTargetBase +{ + public MobuLiveLinkPlugin2023Target(TargetInfo Target) : base(Target, "2023") + {} +} \ No newline at end of file From 6b50ba5268d80e692fe64ad188b31dc4acb2b4c5 Mon Sep 17 00:00:00 2001 From: KirillFromTechAnimTeam <99897702+KirillFromTechAnimTeam@users.noreply.github.com> Date: Wed, 17 Aug 2022 16:11:31 +0200 Subject: [PATCH 07/10] Implements support for Python Wrapping for MotionBuilder 2022 --- Source/MobuLiveLinkPlugin2016.Build.cs | 4 + Source/MobuLiveLinkPlugin2017.Build.cs | 81 +++++++++++++++++++ Source/MobuLiveLinkPlugin2018.Build.cs | 4 + Source/MobuLiveLinkPlugin2019.Build.cs | 4 + Source/MobuLiveLinkPlugin2020.Build.cs | 4 + Source/MobuLiveLinkPlugin2022.Build.cs | 8 ++ Source/MobuLiveLinkPlugin2022.Target.cs | 3 +- Source/MobuLiveLinkPlugin2023.Build.cs | 4 + Source/Private/MobuLiveLink.cpp | 2 +- Source/Public/MobuLiveLinkCommon.h | 2 +- Source/Public/MobuLiveLinkDevice.h | 2 + .../EditorActiveCameraStreamObject.cpp | 2 +- .../Private/ModelStreamObject.cpp | 8 +- 13 files changed, 122 insertions(+), 6 deletions(-) diff --git a/Source/MobuLiveLinkPlugin2016.Build.cs b/Source/MobuLiveLinkPlugin2016.Build.cs index f47f6701..edb917fb 100644 --- a/Source/MobuLiveLinkPlugin2016.Build.cs +++ b/Source/MobuLiveLinkPlugin2016.Build.cs @@ -5,6 +5,10 @@ public class MobuLiveLinkPlugin2016 : MobuLiveLinkPluginBase { + readonly private string pythonFullVersion = "2.7.6"; + public override string PythonFullVersion => pythonFullVersion; + readonly private string pythonVersion = "27"; + public override string PythonVersion => pythonVersion; public MobuLiveLinkPlugin2016(ReadOnlyTargetRules Target) : base(Target, "2016") { } diff --git a/Source/MobuLiveLinkPlugin2017.Build.cs b/Source/MobuLiveLinkPlugin2017.Build.cs index 2af6f30a..67d7c35e 100644 --- a/Source/MobuLiveLinkPlugin2017.Build.cs +++ b/Source/MobuLiveLinkPlugin2017.Build.cs @@ -5,12 +5,41 @@ 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[] { @@ -36,11 +65,15 @@ public MobuLiveLinkPluginBase(ReadOnlyTargetRules Target, string MobuVersionStri { //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)) { @@ -67,10 +100,58 @@ public MobuLiveLinkPluginBase(ReadOnlyTargetRules Target, string MobuVersionStri } } } + public void IncludePyFbSdkVersionSpecific() + { + if(Directory.Exists(MotionBuilderOpenRealitySDK)) + { + string pyFbSdkIncludeFolder = Path.Combine(MotionBuilderOpenRealitySDK, "include\\pyfbsdk"); + PrivateIncludePaths.Add(pyFbSdkIncludeFolder); + if (Target.Platform == UnrealTargetPlatform.Win64) // @todo: Support other platforms? + { + string pyFbSdkLibDir = Path.Combine(MotionBuilderOpenRealitySDK, $"lib\\x64\\python{PythonVersion}"); + // Mobu library we're depending on + PublicAdditionalLibraries.Add(Path.Combine(pyFbSdkLibDir, "pyfbsdk.lib")); + } + } + } + + public void IncludePythonBoostVersionSpecific() + { + if (Directory.Exists(MotionBuilderOpenRealitySDK)) + { + string pythonBoostIncludeFolder = Path.Combine(MotionBuilderOpenRealitySDK, "include\\boost"); + PrivateIncludePaths.Add(pythonBoostIncludeFolder); + if (Target.Platform == UnrealTargetPlatform.Win64) + { + string pythonBoostLibPath = Path.Combine(MotionBuilderOpenRealitySDK, $"lib\\x64\\boost_python{PythonVersion}.lib"); + PublicAdditionalLibraries.Add(pythonBoostLibPath); + } + } + } + + public void IncludePythonVersionSpecific() + { + if (Directory.Exists(MotionBuilderOpenRealitySDK)) + { + string pythonIncludeFolder = Path.Combine(MotionBuilderOpenRealitySDK, $"include\\python-{PythonFullVersion}\\include"); + PrivateIncludePaths.Add(pythonIncludeFolder); + } + } + + public void AddPythonPreprocessDefinitions() + { + PublicDefinitions.Add($"FBPYTHON_VERSION={PythonVersion}"); + PublicDefinitions.Add("MOBU_PYTHON_PLUGIN"); + // PublicDefinitions.Add("_DEBUG"); + } } 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") { } diff --git a/Source/MobuLiveLinkPlugin2018.Build.cs b/Source/MobuLiveLinkPlugin2018.Build.cs index b9d18ed9..23d6ee50 100644 --- a/Source/MobuLiveLinkPlugin2018.Build.cs +++ b/Source/MobuLiveLinkPlugin2018.Build.cs @@ -5,6 +5,10 @@ public class MobuLiveLinkPlugin2018 : MobuLiveLinkPluginBase { + readonly private string pythonFullVersion = "2.7.6"; + public override string PythonFullVersion => pythonFullVersion; + readonly private string pythonVersion = "27"; + public override string PythonVersion => pythonVersion; public MobuLiveLinkPlugin2018(ReadOnlyTargetRules Target) : base(Target, "2018") { } diff --git a/Source/MobuLiveLinkPlugin2019.Build.cs b/Source/MobuLiveLinkPlugin2019.Build.cs index a1cfa58a..6e25756a 100644 --- a/Source/MobuLiveLinkPlugin2019.Build.cs +++ b/Source/MobuLiveLinkPlugin2019.Build.cs @@ -5,6 +5,10 @@ public class MobuLiveLinkPlugin2019 : MobuLiveLinkPluginBase { + readonly private string pythonFullVersion = "2.7.11"; + public override string PythonFullVersion => pythonFullVersion; + readonly private string pythonVersion = "27"; + public override string PythonVersion => pythonVersion; public MobuLiveLinkPlugin2019(ReadOnlyTargetRules Target) : base(Target, "2019") { } diff --git a/Source/MobuLiveLinkPlugin2020.Build.cs b/Source/MobuLiveLinkPlugin2020.Build.cs index 8985cad0..327246aa 100644 --- a/Source/MobuLiveLinkPlugin2020.Build.cs +++ b/Source/MobuLiveLinkPlugin2020.Build.cs @@ -5,6 +5,10 @@ public class MobuLiveLinkPlugin2020 : MobuLiveLinkPluginBase { + readonly private string pythonFullVersion = "2.7.11"; + public override string PythonFullVersion => pythonFullVersion; + readonly private string pythonVersion = "27"; + public override string PythonVersion => pythonVersion; public MobuLiveLinkPlugin2020(ReadOnlyTargetRules Target) : base(Target, "2020") { } diff --git a/Source/MobuLiveLinkPlugin2022.Build.cs b/Source/MobuLiveLinkPlugin2022.Build.cs index af16378c..2b8d46e8 100644 --- a/Source/MobuLiveLinkPlugin2022.Build.cs +++ b/Source/MobuLiveLinkPlugin2022.Build.cs @@ -5,8 +5,16 @@ public class MobuLiveLinkPlugin2022 : MobuLiveLinkPluginBase { + readonly private string pythonFullVersion = "3.7.7"; + public override string PythonFullVersion => pythonFullVersion; + readonly private string pythonVersion = "37"; + public override string PythonVersion => pythonVersion; public MobuLiveLinkPlugin2022(ReadOnlyTargetRules Target) : base(Target, "2022") { CppStandard = CppStandardVersion.Cpp17; + IncludePyFbSdkVersionSpecific(); + IncludePythonBoostVersionSpecific(); + IncludePythonVersionSpecific(); + AddPythonPreprocessDefinitions(); } } diff --git a/Source/MobuLiveLinkPlugin2022.Target.cs b/Source/MobuLiveLinkPlugin2022.Target.cs index 7e6249c5..2fc5abca 100644 --- a/Source/MobuLiveLinkPlugin2022.Target.cs +++ b/Source/MobuLiveLinkPlugin2022.Target.cs @@ -7,5 +7,6 @@ public class MobuLiveLinkPlugin2022Target : MobuLiveLinkPluginTargetBase { public MobuLiveLinkPlugin2022Target(TargetInfo Target) : base(Target, "2022") - {} + { + } } \ No newline at end of file diff --git a/Source/MobuLiveLinkPlugin2023.Build.cs b/Source/MobuLiveLinkPlugin2023.Build.cs index 8777eda7..fbd4d3f3 100644 --- a/Source/MobuLiveLinkPlugin2023.Build.cs +++ b/Source/MobuLiveLinkPlugin2023.Build.cs @@ -5,6 +5,10 @@ public class MobuLiveLinkPlugin2023 : MobuLiveLinkPluginBase { + readonly private string pythonFullVersion = "3.9.7"; + public override string PythonFullVersion => pythonFullVersion; + readonly private string pythonVersion = "39"; + public override string PythonVersion => pythonVersion; public MobuLiveLinkPlugin2023(ReadOnlyTargetRules Target) : base(Target, "2023") { CppStandard = CppStandardVersion.Cpp17; diff --git a/Source/Private/MobuLiveLink.cpp b/Source/Private/MobuLiveLink.cpp index b25d174c..ee8fc47e 100644 --- a/Source/Private/MobuLiveLink.cpp +++ b/Source/Private/MobuLiveLink.cpp @@ -1,4 +1,4 @@ -// Copyright Epic Games, Inc. All Rights Reserved. +// Copyright Epic Games, Inc. All Rights Reserved. #include "RequiredProgramMainCPPInclude.h" #include "MobuLiveLinkCommon.h" diff --git a/Source/Public/MobuLiveLinkCommon.h b/Source/Public/MobuLiveLinkCommon.h index d7cc893c..118dd960 100644 --- a/Source/Public/MobuLiveLinkCommon.h +++ b/Source/Public/MobuLiveLinkCommon.h @@ -1,4 +1,4 @@ -// Copyright Epic Games, Inc. All Rights Reserved. +// Copyright Epic Games, Inc. All Rights Reserved. #pragma once diff --git a/Source/Public/MobuLiveLinkDevice.h b/Source/Public/MobuLiveLinkDevice.h index b5f01305..b7dafc9a 100644 --- a/Source/Public/MobuLiveLinkDevice.h +++ b/Source/Public/MobuLiveLinkDevice.h @@ -12,6 +12,8 @@ #include "Misc/ConfigCacheIni.h" #include "Misc/OutputDevice.h" +#include + //--- Registration defines #define MOBULIVELINK__CLASSNAME FMobuLiveLink #define MOBULIVELINK__CLASSSTR "MobuLiveLink" diff --git a/Source/StreamObjects/Private/EditorActiveCameraStreamObject.cpp b/Source/StreamObjects/Private/EditorActiveCameraStreamObject.cpp index 1772bc02..a0c02385 100644 --- a/Source/StreamObjects/Private/EditorActiveCameraStreamObject.cpp +++ b/Source/StreamObjects/Private/EditorActiveCameraStreamObject.cpp @@ -1,4 +1,4 @@ -// Copyright Epic Games, Inc. All Rights Reserved. +// Copyright Epic Games, Inc. All Rights Reserved. #include "EditorActiveCameraStreamObject.h" #include "MobuLiveLinkUtilities.h" diff --git a/Source/StreamObjects/Private/ModelStreamObject.cpp b/Source/StreamObjects/Private/ModelStreamObject.cpp index 79650da9..ab39fbd5 100644 --- a/Source/StreamObjects/Private/ModelStreamObject.cpp +++ b/Source/StreamObjects/Private/ModelStreamObject.cpp @@ -102,8 +102,12 @@ const FString FModelStreamObject::GetRootName() const bool FModelStreamObject::IsValid() const { - // By Default an object is valid if the root model is in the scene - return FBSystem().Scene->Components.Find((FBComponent*)RootModel) >= 0; + if (RootModel) + { + // By Default an object is valid if the root model is in the scene + return FBSystem().Scene->Components.Find((FBComponent*)RootModel) >= 0; + } + return false; }; void FModelStreamObject::Refresh(const TSharedPtr Provider) From 4776f8234ebf67efbab7ab4f93bee10ca1c44638 Mon Sep 17 00:00:00 2001 From: KirillFromTechAnimTeam <99897702+KirillFromTechAnimTeam@users.noreply.github.com> Date: Thu, 18 Aug 2022 11:32:32 +0200 Subject: [PATCH 08/10] Iteration on Python --- Source/MobuLiveLinkPlugin2017.Build.cs | 21 ++++----------------- Source/MobuLiveLinkPlugin2022.Build.cs | 2 -- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/Source/MobuLiveLinkPlugin2017.Build.cs b/Source/MobuLiveLinkPlugin2017.Build.cs index 67d7c35e..49162863 100644 --- a/Source/MobuLiveLinkPlugin2017.Build.cs +++ b/Source/MobuLiveLinkPlugin2017.Build.cs @@ -96,13 +96,14 @@ public MobuLiveLinkPluginBase(ReadOnlyTargetRules Target, string MobuVersionStri // Mobu library we're depending on PublicAdditionalLibraries.Add(Path.Combine(LibDir, "fbsdk.lib")); + PublicAdditionalLibraries.Add(Path.Combine(LibDir, "libfbxsdk-adsk.lib")); } } } } public void IncludePyFbSdkVersionSpecific() { - if(Directory.Exists(MotionBuilderOpenRealitySDK)) + if (Directory.Exists(MotionBuilderOpenRealitySDK)) { string pyFbSdkIncludeFolder = Path.Combine(MotionBuilderOpenRealitySDK, "include\\pyfbsdk"); PrivateIncludePaths.Add(pyFbSdkIncludeFolder); @@ -121,6 +122,8 @@ public void IncludePythonBoostVersionSpecific() { string pythonBoostIncludeFolder = Path.Combine(MotionBuilderOpenRealitySDK, "include\\boost"); PrivateIncludePaths.Add(pythonBoostIncludeFolder); + string pythonIncludeFolder = Path.Combine(MotionBuilderOpenRealitySDK, $"include\\python-{PythonFullVersion}\\include"); + PrivateIncludePaths.Add(pythonIncludeFolder); if (Target.Platform == UnrealTargetPlatform.Win64) { string pythonBoostLibPath = Path.Combine(MotionBuilderOpenRealitySDK, $"lib\\x64\\boost_python{PythonVersion}.lib"); @@ -128,22 +131,6 @@ public void IncludePythonBoostVersionSpecific() } } } - - public void IncludePythonVersionSpecific() - { - if (Directory.Exists(MotionBuilderOpenRealitySDK)) - { - string pythonIncludeFolder = Path.Combine(MotionBuilderOpenRealitySDK, $"include\\python-{PythonFullVersion}\\include"); - PrivateIncludePaths.Add(pythonIncludeFolder); - } - } - - public void AddPythonPreprocessDefinitions() - { - PublicDefinitions.Add($"FBPYTHON_VERSION={PythonVersion}"); - PublicDefinitions.Add("MOBU_PYTHON_PLUGIN"); - // PublicDefinitions.Add("_DEBUG"); - } } public class MobuLiveLinkPlugin2017 : MobuLiveLinkPluginBase diff --git a/Source/MobuLiveLinkPlugin2022.Build.cs b/Source/MobuLiveLinkPlugin2022.Build.cs index 2b8d46e8..a22081ac 100644 --- a/Source/MobuLiveLinkPlugin2022.Build.cs +++ b/Source/MobuLiveLinkPlugin2022.Build.cs @@ -14,7 +14,5 @@ public MobuLiveLinkPlugin2022(ReadOnlyTargetRules Target) : base(Target, "2022") CppStandard = CppStandardVersion.Cpp17; IncludePyFbSdkVersionSpecific(); IncludePythonBoostVersionSpecific(); - IncludePythonVersionSpecific(); - AddPythonPreprocessDefinitions(); } } From be167dfcbb2496b58797b859a8efd8ed8ce9f572 Mon Sep 17 00:00:00 2001 From: KirillFromTechAnimTeam <99897702+KirillFromTechAnimTeam@users.noreply.github.com> Date: Thu, 18 Aug 2022 11:37:56 +0200 Subject: [PATCH 09/10] Update MobuLiveLinkDevice.h --- Source/Public/MobuLiveLinkDevice.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Source/Public/MobuLiveLinkDevice.h b/Source/Public/MobuLiveLinkDevice.h index b7dafc9a..b5f01305 100644 --- a/Source/Public/MobuLiveLinkDevice.h +++ b/Source/Public/MobuLiveLinkDevice.h @@ -12,8 +12,6 @@ #include "Misc/ConfigCacheIni.h" #include "Misc/OutputDevice.h" -#include - //--- Registration defines #define MOBULIVELINK__CLASSNAME FMobuLiveLink #define MOBULIVELINK__CLASSSTR "MobuLiveLink" From eb89aa199488380b2cd83df79ba8bc7df036529c Mon Sep 17 00:00:00 2001 From: KirillFromTechAnimTeam <99897702+KirillFromTechAnimTeam@users.noreply.github.com> Date: Mon, 29 Aug 2022 20:28:10 +0200 Subject: [PATCH 10/10] Implements better pyfbsdk including --- Source/MobuLiveLinkPlugin2017.Build.cs | 26 ++++++++------------------ Source/MobuLiveLinkPlugin2022.Build.cs | 1 - 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/Source/MobuLiveLinkPlugin2017.Build.cs b/Source/MobuLiveLinkPlugin2017.Build.cs index 49162863..9dc47bb8 100644 --- a/Source/MobuLiveLinkPlugin2017.Build.cs +++ b/Source/MobuLiveLinkPlugin2017.Build.cs @@ -96,7 +96,6 @@ public MobuLiveLinkPluginBase(ReadOnlyTargetRules Target, string MobuVersionStri // Mobu library we're depending on PublicAdditionalLibraries.Add(Path.Combine(LibDir, "fbsdk.lib")); - PublicAdditionalLibraries.Add(Path.Combine(LibDir, "libfbxsdk-adsk.lib")); } } } @@ -106,29 +105,20 @@ public void IncludePyFbSdkVersionSpecific() if (Directory.Exists(MotionBuilderOpenRealitySDK)) { string pyFbSdkIncludeFolder = Path.Combine(MotionBuilderOpenRealitySDK, "include\\pyfbsdk"); - PrivateIncludePaths.Add(pyFbSdkIncludeFolder); - if (Target.Platform == UnrealTargetPlatform.Win64) // @todo: Support other platforms? - { - string pyFbSdkLibDir = Path.Combine(MotionBuilderOpenRealitySDK, $"lib\\x64\\python{PythonVersion}"); - // Mobu library we're depending on - PublicAdditionalLibraries.Add(Path.Combine(pyFbSdkLibDir, "pyfbsdk.lib")); - } - } - } - - public void IncludePythonBoostVersionSpecific() - { - if (Directory.Exists(MotionBuilderOpenRealitySDK)) - { string pythonBoostIncludeFolder = Path.Combine(MotionBuilderOpenRealitySDK, "include\\boost"); - PrivateIncludePaths.Add(pythonBoostIncludeFolder); string pythonIncludeFolder = Path.Combine(MotionBuilderOpenRealitySDK, $"include\\python-{PythonFullVersion}\\include"); + PrivateIncludePaths.Add(pyFbSdkIncludeFolder); + PrivateIncludePaths.Add(pythonBoostIncludeFolder); PrivateIncludePaths.Add(pythonIncludeFolder); if (Target.Platform == UnrealTargetPlatform.Win64) { - string pythonBoostLibPath = Path.Combine(MotionBuilderOpenRealitySDK, $"lib\\x64\\boost_python{PythonVersion}.lib"); - PublicAdditionalLibraries.Add(pythonBoostLibPath); + 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}"); } } } diff --git a/Source/MobuLiveLinkPlugin2022.Build.cs b/Source/MobuLiveLinkPlugin2022.Build.cs index a22081ac..4e8bb520 100644 --- a/Source/MobuLiveLinkPlugin2022.Build.cs +++ b/Source/MobuLiveLinkPlugin2022.Build.cs @@ -13,6 +13,5 @@ public MobuLiveLinkPlugin2022(ReadOnlyTargetRules Target) : base(Target, "2022") { CppStandard = CppStandardVersion.Cpp17; IncludePyFbSdkVersionSpecific(); - IncludePythonBoostVersionSpecific(); } }