From 9bb90d5662ae3be5cbeb19304278dfc161ddfeff Mon Sep 17 00:00:00 2001 From: Jason Walter Date: Mon, 15 Apr 2024 21:08:33 -0400 Subject: [PATCH] Add 2025 support and fix a crash with saving Unreal device in an Fbx file. --- README.md | 13 ++----------- Source/MobuLiveLinkPlugin2025.Build.cs | 12 ++++++++++++ Source/MobuLiveLinkPlugin2025.Target.cs | 11 +++++++++++ Source/Private/MobuLiveLinkDevice.cpp | 2 +- .../Private/EditorActiveCameraStreamObject.cpp | 18 +++++++++++++----- 5 files changed, 39 insertions(+), 17 deletions(-) create mode 100644 Source/MobuLiveLinkPlugin2025.Build.cs create mode 100644 Source/MobuLiveLinkPlugin2025.Target.cs diff --git a/README.md b/README.md index 9d965570..311a4394 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,2 @@ -# MotionBuilder Live Link - -Enables Unreal to receives data from MotionBuilder via the Live Link system. - -Currently built and tested with Unreal 4.27 and MotionBuilder 2016, 2017, 2018, 2019, 2020, and 2022 - -### Pre-built plugins are available on the Releases tab here: [https://github.com/ue4plugins/MobuLiveLink/releases](https://github.com/ue4plugins/MobuLiveLink/releases) - -### Please see the Wiki for details on setup, usage and known issues: [https://github.com/ue4plugins/MobuLiveLink/wiki](https://github.com/ue4plugins/MobuLiveLink/wiki) - -### If you have any issues or questions please log them in the issues tab +Documentation for MotionBuilder Live Link can be found on our site: +https://docs.unrealengine.com/en-US/Engine/Animation/LiveLinkPlugin/ConnectingLiveLinktoMobu/index.html \ No newline at end of file diff --git a/Source/MobuLiveLinkPlugin2025.Build.cs b/Source/MobuLiveLinkPlugin2025.Build.cs new file mode 100644 index 00000000..56ff2160 --- /dev/null +++ b/Source/MobuLiveLinkPlugin2025.Build.cs @@ -0,0 +1,12 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +using UnrealBuildTool; +using System.IO; + +public class MobuLiveLinkPlugin2025 : MobuLiveLinkPluginBase +{ + public MobuLiveLinkPlugin2025(ReadOnlyTargetRules Target) : base(Target, "2025") + { + CppStandard = CppStandardVersion.Cpp17; + } +} diff --git a/Source/MobuLiveLinkPlugin2025.Target.cs b/Source/MobuLiveLinkPlugin2025.Target.cs new file mode 100644 index 00000000..03b45564 --- /dev/null +++ b/Source/MobuLiveLinkPlugin2025.Target.cs @@ -0,0 +1,11 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +using UnrealBuildTool; +using System.Collections.Generic; +using System.IO; + +public class MobuLiveLinkPlugin2025Target : MobuLiveLinkPluginTargetBase +{ + public MobuLiveLinkPlugin2025Target(TargetInfo Target) : base(Target, "2025") + {} +} diff --git a/Source/Private/MobuLiveLinkDevice.cpp b/Source/Private/MobuLiveLinkDevice.cpp index c5516b76..93592d10 100644 --- a/Source/Private/MobuLiveLinkDevice.cpp +++ b/Source/Private/MobuLiveLinkDevice.cpp @@ -150,7 +150,7 @@ bool FMobuLiveLink::DeviceOperation(kDeviceOperations pOperation) void FMobuLiveLink::SetDeviceInformation(const char* NewDeviceInformation) { - FString VersionString("v3.0.3 ("); + FString VersionString("v3.0.4 ("); VersionString += __DATE__; VersionString += ")"; HardwareVersionInfo.SetString(FStringToChar(VersionString)); diff --git a/Source/StreamObjects/Private/EditorActiveCameraStreamObject.cpp b/Source/StreamObjects/Private/EditorActiveCameraStreamObject.cpp index c571c0bc..99c12977 100644 --- a/Source/StreamObjects/Private/EditorActiveCameraStreamObject.cpp +++ b/Source/StreamObjects/Private/EditorActiveCameraStreamObject.cpp @@ -96,13 +96,21 @@ bool FEditorActiveCameraStreamObject::IsValid() const void FEditorActiveCameraStreamObject::Refresh(const TSharedPtr Provider) { + if (!bIsActive) + { + return; + } + FBSystem System; const FBCamera* CameraModel = System.Scene->Renderer->GetCameraInPane(0); - FLiveLinkStaticDataStruct CameraData(FLiveLinkCameraStaticData::StaticStruct()); - FModelStreamObject::UpdateSubjectTransformStaticData(CameraModel, bSendAnimatable, *CameraData.Cast()); - FCameraStreamObject::UpdateSubjectCameraStaticData(CameraModel, *CameraData.Cast()); - Provider->UpdateSubjectStaticData(SubjectName, ULiveLinkCameraRole::StaticClass(), MoveTemp(CameraData)); + if (CameraModel) + { + FLiveLinkStaticDataStruct CameraData(FLiveLinkCameraStaticData::StaticStruct()); + FModelStreamObject::UpdateSubjectTransformStaticData(CameraModel, bSendAnimatable, *CameraData.Cast()); + FCameraStreamObject::UpdateSubjectCameraStaticData(CameraModel, *CameraData.Cast()); + Provider->UpdateSubjectStaticData(SubjectName, ULiveLinkCameraRole::StaticClass(), MoveTemp(CameraData)); + } } void FEditorActiveCameraStreamObject::UpdateSubjectFrame(const TSharedPtr Provider, FLiveLinkWorldTime WorldTime, FQualifiedFrameTime QualifiedFrameTime) @@ -122,4 +130,4 @@ void FEditorActiveCameraStreamObject::UpdateSubjectFrame(const TSharedPtr()); Provider->UpdateSubjectFrameData(SubjectName, MoveTemp(CameraData)); } -} \ No newline at end of file +}