Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unreal Engine 5.4 support #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MovementSample.uproject
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"FileVersion": 3,
"EngineAssociation": "5.3",
"EngineAssociation": "5.4",
"Category": "",
"Description": "",
"Modules": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,36 @@ void UOculusXRRetargetIKRetargeterEditor::ValidateAnimNodeDuringCompilation(USke
}

// validate SOURCE IK Rig asset has been assigned
#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 4
if (!Node.IKRetargeterAsset->GetIKRig(ERetargetSourceOrTarget::Source))
{
MessageLog.Warning(TEXT("@@ has IK Retargeter that is missing a source IK Rig asset."), this);
}
#else
if (!Node.IKRetargeterAsset->GetSourceIKRig())
{
MessageLog.Warning(TEXT("@@ has IK Retargeter that is missing a source IK Rig asset."), this);
}
#endif

// validate TARGET IK Rig asset has been assigned
#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 4
if (!Node.IKRetargeterAsset->GetIKRig(ERetargetSourceOrTarget::Target))
{
MessageLog.Warning(TEXT("@@ has IK Retargeter that is missing a target IK Rig asset."), this);
}
#else
if (!Node.IKRetargeterAsset->GetTargetIKRig())
{
MessageLog.Warning(TEXT("@@ has IK Retargeter that is missing a target IK Rig asset."), this);
}
#endif

#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 4
if (!(Node.IKRetargeterAsset->GetIKRig(ERetargetSourceOrTarget::Source) && Node.IKRetargeterAsset->GetIKRig(ERetargetSourceOrTarget::Target)))
#else
if (!(Node.IKRetargeterAsset->GetSourceIKRig() && Node.IKRetargeterAsset->GetTargetIKRig()))
#endif
{
return;
}
Expand Down Expand Up @@ -115,7 +133,11 @@ void UOculusXRRetargetIKRetargeterEditor::ValidateAnimNodeDuringCompilation(USke
{
// validate that target bone chains exist on this skeleton
const FReferenceSkeleton& RefSkel = ForSkeleton->GetReferenceSkeleton();
#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 4
const TArray<FBoneChain>& TargetBoneChains = Node.IKRetargeterAsset->GetIKRig(ERetargetSourceOrTarget::Target)->GetRetargetChains();
#else
const TArray<FBoneChain>& TargetBoneChains = Node.IKRetargeterAsset->GetTargetIKRig()->GetRetargetChains();
#endif
for (const FBoneChain& Chain : TargetBoneChains)
{
if (RefSkel.FindBoneIndex(Chain.StartBone.BoneName) == INDEX_NONE)
Expand All @@ -131,16 +153,23 @@ void UOculusXRRetargetIKRetargeterEditor::ValidateAnimNodeDuringCompilation(USke
}
}


void UOculusXRRetargetIKRetargeterEditor::PreloadRequiredAssets()
{
Super::PreloadRequiredAssets();

if (Node.IKRetargeterAsset)
{
PreloadObject(Node.IKRetargeterAsset);
#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 4
PreloadObject(Node.IKRetargeterAsset->GetIKRigWriteable(ERetargetSourceOrTarget::Source));
PreloadObject(Node.IKRetargeterAsset->GetIKRigWriteable(ERetargetSourceOrTarget::Target));
#else
PreloadObject(Node.IKRetargeterAsset->GetSourceIKRigWriteable());
PreloadObject(Node.IKRetargeterAsset->GetTargetIKRigWriteable());
#endif
}
}


#undef LOCTEXT_NAMESPACE
5 changes: 3 additions & 2 deletions Source/MovementSampleEditor.Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ public class MovementSampleEditorTarget : TargetRules
public MovementSampleEditorTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Editor;
DefaultBuildSettings = BuildSettingsVersion.V2;
DefaultBuildSettings = BuildSettingsVersion.V5;
IncludeOrderVersion = EngineIncludeOrderVersion.Latest;

ExtraModuleNames.AddRange(new string[] { "MovementSample" });
ExtraModuleNames.AddRange(new string[] { "MovementSample" });
}
}