Skip to content

Commit

Permalink
2.3.0 Release for UE 5.2 (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
pl-dsk authored Sep 26, 2023
1 parent 42472e7 commit 603849f
Show file tree
Hide file tree
Showing 18 changed files with 85 additions and 41 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)

project(MayaLiveLink NONE) # Enable no language.

set(MAYA_VERSIONS 2020 2022 2023)
set(MAYA_VERSIONS 2022 2023 2024)
if(WIN32)
set(Platform Win64)
set(Extension .mll)
Expand Down
8 changes: 6 additions & 2 deletions Plugins/Runtime/MayaLiveLink/MayaLiveLink.uplugin
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"FileVersion": 3,
"Version": 1,
"VersionName": "2.2.0",
"VersionName": "2.3.0",
"FriendlyName": "Maya Live Link",
"Description": "Maya Live Link allows streaming of animated data into the Unreal Editor",
"Category": "Animation",
"CreatedBy": "Autodesk, Inc.",
"CreatedByURL": "https://www.autodesk.com",
"DocsURL": "https://help.autodesk.com/view/MAYAUL/2023/ENU/?guid=UnrealLiveLink_unreal_livelink_landing_html",
"DocsURL": "https://help.autodesk.com/view/MAYAUL/2024/ENU/?guid=UnrealLiveLink_unreal_livelink_landing_html",
"MarketplaceURL": "",
"SupportURL": "https://forums.autodesk.com/t5/unreal-live-link-for-maya-forum/bd-p/6143",
"CanContainContent": false,
Expand Down Expand Up @@ -51,6 +51,10 @@
{
"Name": "SequencerScripting",
"Enabled": true
},
{
"Name": "AnimationData",
"Enabled": true
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public MayaLiveLink(ReadOnlyTargetRules Target) : base(Target)
PrivateDependencyModuleNames.AddRange(
new string[]
{
"HeadMountedDisplay",
"AnimationData",
"InputCore",
"Media",
"Projects",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ void FMayaLiveLinkMessageBusSource::PushStaticDataToAnimSequence(const FName& Su
auto& StaticData = *TimelineStaticDataPtr;

// Push to the static data to generate an animation sequence
TArray<int32> BoneTrackRemapping;
TArray<FName> BoneTrackRemapping;
FString AnimSequenceName;
UMayaLiveLinkAnimSequenceHelper::PushStaticDataToAnimSequence(StaticData, BoneTrackRemapping, AnimSequenceName);
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ IMPLEMENT_MODULE(FMayaLiveLinkInterfaceModule, MayaLiveLinkInterface)

namespace
{
static const FString PluginVersion = "v2.2.0";
static const FString PluginVersion = "v2.3.0";
static const FString UnrealEngineVersion = VERSION_STRINGIFY(ENGINE_MAJOR_VERSION) TEXT(".") VERSION_STRINGIFY(ENGINE_MINOR_VERSION);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct MAYALIVELINKINTERFACE_API FMayaLiveLinkTimelineBaseParams

struct MAYALIVELINKINTERFACE_API FMayaLiveLinkAnimSequenceParams : public FMayaLiveLinkTimelineBaseParams
{
TArray<int32> BoneTrackRemapping;
TArray<FName> BoneTrackRemapping;
FString FullSequenceName;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "MayaLiveLinkUtils.h"

#include "Animation/AnimBlueprint.h"
#include "Animation/AnimCompress.h"
#include "Animation/AnimSequence.h"
#include "Animation/AnimSequenceHelpers.h"
#include "Animation/Skeleton.h"
Expand All @@ -34,9 +35,12 @@
#include "Kismet2/BlueprintEditorUtils.h"
#include "Kismet2/KismetEditorUtilities.h"

#include "Misc/FeedbackContext.h"

#include "Roles/MayaLiveLinkTimelineTypes.h"

#include "AssetToolsModule.h"
#include "CoreGlobals.h"
#include "Editor.h"

#define LOCTEXT_NAMESPACE "MayaLiveLinkAnimSequenceHelper"
Expand All @@ -59,7 +63,7 @@ UMayaLiveLinkAnimSequenceHelper::UMayaLiveLinkAnimSequenceHelper(const FObjectIn
}

void UMayaLiveLinkAnimSequenceHelper::PushStaticDataToAnimSequence(const FMayaLiveLinkAnimSequenceStaticData& StaticData,
TArray<int32>& BoneTrackRemapping,
TArray<FName>& BoneTrackRemapping,
FString& AnimSequenceName)
{
if (StaticData.LinkedAssetPath.IsEmpty() ||
Expand Down Expand Up @@ -143,20 +147,26 @@ void UMayaLiveLinkAnimSequenceHelper::PushStaticDataToAnimSequence(const FMayaLi
{
for (auto& BoneName : StaticData.BoneNames)
{
int32 TrackIndex = INDEX_NONE;
if (RefSkeleton.FindBoneIndex(BoneName) != INDEX_NONE)
{
TrackIndex = AnimSequence->GetDataModel()->GetBoneTrackIndexByName(BoneName);
bool bValidBone = AnimSequence->GetDataModel()->IsValidBoneTrackName(BoneName);

if (TrackIndex == INDEX_NONE)
if (!bValidBone)
{
FRawAnimSequenceTrack RawTrack;
RawTrack.PosKeys.Init(FVector3f::ZeroVector, NumberOfFrames);
RawTrack.RotKeys.Init(FQuat4f::Identity, NumberOfFrames);
RawTrack.ScaleKeys.Init(FVector3f::OneVector, NumberOfFrames);

TrackIndex = Controller.AddBoneTrack(BoneName, false);
Controller.SetBoneTrackKeys(BoneName, RawTrack.PosKeys, RawTrack.RotKeys, RawTrack.ScaleKeys, false);
bValidBone = Controller.AddBoneCurve(BoneName, false);
if (bValidBone)
{
Controller.SetBoneTrackKeys(BoneName, RawTrack.PosKeys, RawTrack.RotKeys, RawTrack.ScaleKeys, false);
}
else
{
continue;
}
}

FRawAnimSequenceTrack RawTrack;
Expand All @@ -182,9 +192,10 @@ void UMayaLiveLinkAnimSequenceHelper::PushStaticDataToAnimSequence(const FMayaLi
Controller.SetBoneTrackKeys(BoneName, RawTrack.PosKeys, RawTrack.RotKeys, RawTrack.ScaleKeys, false);
}
}
BoneTrackRemapping.Add(TrackIndex);
BoneTrackRemapping.Add(BoneName);
}
}

Controller.CloseBracket(false);
}

Expand Down Expand Up @@ -218,8 +229,8 @@ void UMayaLiveLinkAnimSequenceHelper::PushFrameDataToAnimSequence(const FMayaLiv

// Update the baked animation frame for each bone
bool SequenceUpdated = false;
const auto RawAnimationDataSize = AnimSequence->GetDataModel()->GetBoneAnimationTracks().Num();
TMap<FName, FMayaLiveLinkAnimSequenceFrame> FramesByBone;
const int32 NumberOfFrames = GetAnimSequenceNumberOfFrames(*AnimSequence);
for (int FrameIndex = 0; FrameIndex < FrameData.Frames.Num(); ++FrameIndex)
{
auto& Frame = FrameData.Frames[FrameIndex];
Expand All @@ -231,23 +242,18 @@ void UMayaLiveLinkAnimSequenceHelper::PushFrameDataToAnimSequence(const FMayaLiv
{
continue;
}
int32 TrackIndex = TimelineParams.BoneTrackRemapping[BoneIndex];
if (TrackIndex >= RawAnimationDataSize || TrackIndex == INDEX_NONE)
const FName& TrackName = TimelineParams.BoneTrackRemapping[BoneIndex];
if (!TrackName.IsValid())
{
continue;
}

const auto& TrackData = AnimSequence->GetDataModel()->GetBoneTrackByIndex(TrackIndex);
const auto& AnimTrack = TrackData.InternalTrackData;

if (AnimTrack.PosKeys.Num() > 0 && FrameIndex < AnimTrack.PosKeys.Num() &&
AnimTrack.RotKeys.Num() > 0 && FrameIndex < AnimTrack.RotKeys.Num() &&
AnimTrack.ScaleKeys.Num() > 0 && FrameIndex < AnimTrack.ScaleKeys.Num())
if (NumberOfFrames > 0 && FrameIndex < NumberOfFrames)
{
auto BoneTrackPtr = FramesByBone.Find(TrackData.Name);
auto BoneTrackPtr = FramesByBone.Find(TrackName);
if (!BoneTrackPtr)
{
BoneTrackPtr = &FramesByBone.Emplace(TrackData.Name);
BoneTrackPtr = &FramesByBone.Emplace(TrackName);
BoneTrackPtr->Locations.Init(FVector::ZeroVector, FrameData.Frames.Num());
BoneTrackPtr->Rotations.Init(FQuat::Identity, FrameData.Frames.Num());
BoneTrackPtr->Scales.Init(FVector::OneVector, FrameData.Frames.Num());
Expand Down Expand Up @@ -281,6 +287,7 @@ void UMayaLiveLinkAnimSequenceHelper::PushFrameDataToAnimSequence(const FMayaLiv
false);
}
}

Controller.CloseBracket(false);
}

Expand Down Expand Up @@ -336,6 +343,25 @@ void UMayaLiveLinkAnimSequenceHelper::PushFrameDataToAnimSequence(const FMayaLiv
}
}

if (SequenceUpdated)
{
// Need to start a compression task to update the AnimSequence
GWarn->BeginSlowTask(LOCTEXT("AnimCompressing", "Compressing"), true);
{
UE::Anim::Compression::FAnimationCompressionMemorySummaryScope Scope;

// Disable the modal summary window
UE::Anim::Compression::FAnimationCompressionMemorySummaryScope::CompressionSummary = MakeUnique<FCompressionMemorySummary>(false);

// Clear CompressCommandletVersion so we can recompress these animations later.
AnimSequence->CompressCommandletVersion = 0;
AnimSequence->ClearAllCachedCookedPlatformData();
AnimSequence->CacheDerivedDataForCurrentPlatform();
}

GWarn->EndSlowTask();
}

FMayaLiveLinkUtils::RefreshContentBrowser(*AnimSequence);
}

Expand All @@ -353,6 +379,8 @@ bool UMayaLiveLinkAnimSequenceHelper::StaticUpdateAnimSequence(UAnimSequence& An
{
AnimSequence.SetSkeleton(Skeleton);
Updated = true;

AnimSequence.GetController().InitializeModel();
}

// Resize the AnimSequence length
Expand All @@ -366,10 +394,10 @@ bool UMayaLiveLinkAnimSequenceHelper::StaticUpdateAnimSequence(UAnimSequence& An
auto& Controller = AnimSequence.GetController();
Controller.RemoveAllCurvesOfType(ERawCurveTrackTypes::RCT_Float);
Controller.RemoveAllCurvesOfType(ERawCurveTrackTypes::RCT_Transform);
Controller.SetPlayLength(SequenceLength);
Controller.SetFrameRate(FrameRate);
Controller.SetNumberOfFrames(NumberOfFrames);
AnimSequence.ImportResampleFramerate = FrameRate.AsDecimal();
AnimSequence.ImportFileFramerate = FrameRate.AsDecimal();
Controller.SetFrameRate(FrameRate);

// Trigger a notification to update the target/sampling frame rate used to playback the anim sequence
Controller.NotifyPopulated();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@

#include "GameFramework/Actor.h"

#include "MovieScene.h"

// Sections
#include "Sections/MovieScene3DTransformSection.h"
#include "Sections/MovieSceneBoolSection.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class UMayaLiveLinkAnimSequenceHelper : public UObject
GENERATED_UCLASS_BODY()

static MAYALIVELINKTIMELINESYNC_API void PushStaticDataToAnimSequence(const struct FMayaLiveLinkAnimSequenceStaticData& StaticData,
TArray<int32>& BoneTrackRemapping,
TArray<FName>& BoneTrackRemapping,
FString& AnimSequenceName);
static MAYALIVELINKTIMELINESYNC_API void PushFrameDataToAnimSequence(const struct FMayaLiveLinkAnimSequenceFrameData& FrameData,
const struct FMayaLiveLinkAnimSequenceParams& TimelineParams);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

scriptDir="$(dirname "$(readlink -f "$0")")"

# arg[1] specifies the Maya version (2020|2022|2023 ...), see BuildMayaUnrealLiveLinkPlugin.xml for default value
# arg[1] specifies the Maya version (2022|2023|2024 ...), see BuildMayaUnrealLiveLinkPlugin.xml for default value
if [ ! -z "$1" ]; then
MayaVersion=-set:MayaVersion=$1
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<BuildGraph xmlns="http://www.epicgames.com/BuildGraph" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.epicgames.com/BuildGraph ../../../../../Engine/Build/Graph/Schema.xsd" >

<Option Name="PublishZipDir_Win" DefaultValue="$(RootDir)/LocalBuilds/Engine/WindowsZips" Description="The output directory for published zip artifacts on Windows"/>
<Option Name="MayaVersion" Restrict="2020|2022|2023" DefaultValue="2022" Description="Select the maya version"/>
<Option Name="MayaVersion" Restrict="2022|2023|2024" DefaultValue="2024" Description="Select the maya version"/>
<Option Name="MayaPlatform" Restrict="Win64|Linux" DefaultValue="Win64" Description="Select the platform"/>
<Option Name="BuildTarget" Restrict="Debug|Development" DefaultValue="Development" Description="Select the build target"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,17 @@ private void Init(ReadOnlyTargetRules Target, string pMayaVersion="")
// For GL/gl.h
if(IsLinux)
{
PrivateIncludePaths.Add("/usr/include");
// There was some include reordering in UE 5.2 which causes a problem on Linux with cmath.
//
// Got this fix from EPIC Games to make sure that the custom cmath in ThirdParty is found
// before the one in /usr/include.
//
// This may not be required in 5.3
//
//PrivateIncludePaths.Add("/usr/include");
PublicSystemIncludePaths.Add("ThirdParty/Unix/LibCxx/include");
PublicSystemIncludePaths.Add("ThirdParty/Unix/LibCxx/include/c++/v1");
PublicSystemIncludePaths.Add("/usr/include");
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1329,7 +1329,7 @@ class LiveLinkGetPluginDocumentationUrlCommand : public MPxCommand

MStatus doIt(const MArgList& args) override
{
appendToResult(MString("https://help.autodesk.com/view/MAYAUL/2023/ENU/?guid=UnrealLiveLink_unreal_livelink_landing_html"));
appendToResult(MString("https://help.autodesk.com/view/MAYAUL/2024/ENU/?guid=UnrealLiveLink_unreal_livelink_landing_html"));

return MS::kSuccess;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. -->

+ MAYAVERSION:2023 LiveLink 2.2 ./2023
+ MAYAVERSION:2024 LiveLink 2.3 ./2024
plug-ins: .
scripts: .

+ MAYAVERSION:2022 LiveLink 2.2 ./2022
+ MAYAVERSION:2023 LiveLink 2.3 ./2023
plug-ins: .
scripts: .

+ MAYAVERSION:2020 LiveLink 2.2 ./2020
+ MAYAVERSION:2022 LiveLink 2.3 ./2022
plug-ins: .
scripts: .
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

using UnrealBuildTool;

public class MayaUnrealLiveLinkPlugin2020 : MayaUnrealLiveLinkPlugin
public class MayaUnrealLiveLinkPlugin2024 : MayaUnrealLiveLinkPlugin
{
public MayaUnrealLiveLinkPlugin2020(ReadOnlyTargetRules Target) : base(Target, "2020")
public MayaUnrealLiveLinkPlugin2024(ReadOnlyTargetRules Target) : base(Target, "2024")
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

using UnrealBuildTool;

public class MayaUnrealLiveLinkPlugin2020Target : MayaUnrealLiveLinkPluginTarget
public class MayaUnrealLiveLinkPlugin2024Target : MayaUnrealLiveLinkPluginTarget
{
public MayaUnrealLiveLinkPlugin2020Target(TargetInfo Target) : base(Target, "2020")
public MayaUnrealLiveLinkPlugin2024Target(TargetInfo Target) : base(Target, "2024")
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,7 @@ def onSelectionChanged(*args, **kwargs):

# Initialize the script plug-in
def initializePlugin(mobject):
mplugin = OpenMayaMPx.MFnPlugin(mobject, 'Autodesk, Inc.', 'v2.2.0')
mplugin = OpenMayaMPx.MFnPlugin(mobject, 'Autodesk, Inc.', 'v2.3.0')

print("LiveLinkUI Init:")
for Command in Commands:
Expand Down
2 changes: 1 addition & 1 deletion resource/copyright.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Unreal� Live Link for Autodesk � Maya � 2.2.0
Unreal� Live Link for Autodesk � Maya � 2.3.0

� 2022 Autodesk, Inc. All rights reserved.

Expand Down

0 comments on commit 603849f

Please sign in to comment.