Adapt MetaXR and MetaXRInteraction to UE5.7.3

I’m making a game using UE v5.7.3, MetaXR v1.117.0, and MetaXRInteraction v1.85.0. These plugins officially support UE v5.6.0 but with a few minor tweaks I made them to run on UE v5.7.3:

Adapting MetaXR

In Plugins\MetaXR\OculusXR.uplugin, replace "EngineVersion": "5.6.0", by "EngineVersion": "5.7.0",. That will not change the code nor compatibility but suppress the warning that the plugin targets the wrong UE version.

Add these in Config\DefaultEditorPerProjectUserSettings.ini. I think it did it automatically on project launch so might not be useful to do it manually:

[/Script/OculusXRProjectSetupTool.OculusXRPSTSettings]
IgnoredRules=()
CurrentPlatform=14
bBackGroundChecks=True
bStopBuildOnUnAppliedCriticalItems=False
bGuidedTutorialComplete=True
bShowGuidedTutorial=False

Adapting MetaXRInteraction

Likewise, in Plugins\MetaXRInteraction\OculusInteraction.uplugin, replace "EngineVersion": "5.6.0", by "EngineVersion": "5.7.0",

In UE 5.7+, FXRMotionControllerData and GetMotionControllerData were removed, so we can use OutPositions/OutRotations already populated by GetAllKeypointStates, so in Plugins\MetaXRInteraction\Source\IsdkDataSourcesOpenXR\Private\DataSources\IsdkFromOpenXRHandDataSource.cpp replace this

  FXRMotionControllerData MotionControllerData;
  EControllerHand Hand =
      (Handedness == EIsdkHandedness::Left) ? EControllerHand::Left : EControllerHand::Right;

  UHeadMountedDisplayFunctionLibrary::GetMotionControllerData(this, Hand, MotionControllerData);

  if (MotionControllerData.bValid && !MotionControllerData.HandKeyPositions.IsEmpty())

by this

  if (!OutPositions.IsEmpty())

and this

    for (int32 Index = 0; Index < MotionControllerData.HandKeyPositions.Num(); ++Index)
    {
      auto AdjustedTransform = FTransform(
          MotionControllerData.HandKeyRotations[Index],
          MotionControllerData.HandKeyPositions[Index],

by this

    for (int32 Index = 0; Index < OutPositions.Num(); ++Index)
    {
      auto AdjustedTransform = FTransform(
          OutRotations[Index],
          OutPositions[Index],

There also seems to be a few update in the paths syntax: in Plugins\MetaXRInteraction\Source\OculusInteraction\Public\Interaction\Grabbable\IsdkITransformer.h, replace meta = (HasNativeMake = "OculusInteraction.IsdkFunctionLibrary.MakeGrabPoseStruct")) by meta = (HasNativeMake = "/Script/OculusInteraction.IsdkFunctionLibrary:MakeGrabPoseStruct")) and meta = (HasNativeMake = "OculusInteraction.IsdkFunctionLibrary.MakeTargetTransformStruct")) by meta = (HasNativeMake = "/Script/OculusInteraction.IsdkFunctionLibrary:MakeTargetTransformStruct"))

Lastly in Plugins\MetaXRInteraction\Source\OculusInteractionEditor\Private\EditorTelemetry\IsdkTelemetryPrivacySettings.cpp replace return Links.begin().Value(); by return Links.begin()->Value(); and return FText::FromString(Links.begin().Key()); by return FText::FromString(Links.begin()->Key);.

1 Like

Many thanks for that. It’s amazing that the MetaXR plugin compiles in a higher UE version without any major changes. ISDK is compiling as well, but I didn’t do any testing yet in my project.

Btw, i had to replace in \Plugins\MetaXRInteraction\Source\OculusInteractionEditor\Private\EditorTelemetry\IsdkTelemetryPrivacySettings.cpp` line 107

return Links.begin().Value();

by

return Links.begin()->Value;

thanks , it works !

when package project , still got some errors, fortunately it finally packed APK and ran on device well

Would it be as easy to adapt the Meta Movement plugin to 5.7?

yes, i can run it on ue-5.8 normally

Thanks for the reply, we’re talking about the Meta Movement SDK right? I can’t find a page with patch notes like the Interaction SDK.

I’ve also been experimenting with the MetaXR plugin to see if it can be made to work on an Apple Mac, and it does.

However, as far as I understand the Meta Platform Technologies’ SDK License Agreement - any modification to the code of their plugins and distribution of them are prohibited. Does that apply to the entire source code, or only to some pre-compiled .dll files that are closed source?