Skip to content

Commit ef48264

Browse files
Andrew Kimfacebook-github-bot
authored andcommitted
feat(Samples): v77 release
Summary: v77 release ### What's New - **Upper Body Support**: Implemented upper body support for the CharacterRetargeter with configurable leg scaling options on full body characters. - **Hand IK Processor**: Added HandIKProcessor to the CharacterRetargeter to support custom hands. - **Retargeting Configuration Generation**: Improved automatic mapping, alignment, joint recognition and more for the retargeting configuration generation. - **Automatic Twist Joint Mapping**: Added automatic twist joint mapping for arms & legs for skeletal retargeting, removing the need for Twist Joint Processors. ### What's Fixed - Fixed quaternion calculation errors. - Fixed out of view hands handling. - Fixed incorrect skeleton visualization for some samples. - Fixed various invalid configuration retargeting errors and erroneous joint mapping. - Fixed sample UI inconsistent behavior. ### Improvements - **Performance**: Optimized native retargeting resulting in a 25% performance improvement. - **Retargeting Editor**: Updated UI and improved editor flow. Reviewed By: sohailshafiiWk Differential Revision: D76142805 fbshipit-source-id: 7c39041283f71f25127a6195c00907bc9b0e216a
1 parent b1de7b8 commit ef48264

181 files changed

Lines changed: 11036 additions & 7483 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 86 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,105 @@
1+
## [77.0.0]
2+
3+
### What's New
4+
5+
- **Upper Body Support**: Implemented upper body support for the CharacterRetargeter with configurable leg scaling options on full body characters.
6+
- **Hand IK Processor**: Added HandIKProcessor to the CharacterRetargeter to support custom hands.
7+
- **Retargeting Configuration Generation**: Improved automatic mapping, alignment, joint recognition and more for the retargeting configuration generation.
8+
- **Automatic Twist Joint Mapping**: Added automatic twist joint mapping for arms & legs for skeletal retargeting, removing the need for Twist Joint Processors.
9+
10+
### What's Fixed
11+
12+
- Fixed quaternion calculation errors.
13+
- Fixed out of view hands handling.
14+
- Fixed incorrect skeleton visualization for some samples.
15+
- Fixed various invalid configuration retargeting errors and erroneous joint mapping.
16+
- Fixed sample UI inconsistent behavior.
17+
18+
### Improvements
19+
20+
- **Performance**: Optimized native retargeting resulting in a 25% performance improvement.
21+
- **Retargeting Editor**: Updated UI and improved editor flow.
22+
123
## [76.0.1]
224

3-
### Added
25+
### What's New
426

5-
- Mac and Linux libraries.
27+
- **Platform Support**: Mac and Linux libraries.
628

7-
### Fixed
29+
### What's Fixed
830

9-
- Hip pinning scene target changed to tracked anchors to prevent tracking invalid hands.
10-
- Addressed CCD stretching arm stretching bug.
11-
- Resolved protential race condition in NetworkCharacterBehaviorNGO.
12-
- Dispose TempJob arrays.
31+
- Fixed hip pinning scene target to use tracked anchors to prevent tracking invalid hands.
32+
- Fixed CCD stretching arm stretching bug.
33+
- Fixed potential race condition in NetworkCharacterBehaviorNGO.
34+
- Fixed memory leaks by properly disposing TempJob arrays.
1335
- Fixed project setup tool requirements for all platforms.
1436

1537
## [76.0.0]
16-
- Replaced retargeting system with a more efficient, data-driven CharacterRetargeter.
17-
- Added powerful and easy-to-use tooling system to create retargeted characters.
18-
- Revised body tracking, networking, ISDK, hip pinning and locomotion scenes to use new retargeting system.
38+
39+
### What's New
40+
41+
- **Replaced retargeting system**: Implemented a more efficient, data-driven CharacterRetargeter.
42+
- **Added tooling system**: Created powerful and easy-to-use tooling system to create retargeted characters.
43+
44+
### Improvements
45+
46+
- **Revised sample scenes**: Updated body tracking, networking, ISDK, hip pinning and locomotion scenes to use new retargeting system.
1947

2048
## [74.0.0]
49+
50+
### What's Fixed
51+
2152
- Fixed MovementBodyTrackingForFitness scene so that the UI in the scene is visible to cameras.
22-
- Updated Project Setup Tool to enable audio-based face tracking when using A2E, and enable face tracking visemes output when using visemes.
2353
- Fixed bug in VisemeDriver where it was returning if the OVRFaceExpressions reference wasn't null.
24-
- Updated BlendshapeMappingExample's body mesh, mirrored or not, to animate based on body tracking movements when not visible.
54+
- Fixed BlendshapeMappingExample's body mesh animation to work based on body tracking movements when not visible.
55+
56+
### Improvements
57+
58+
- Updated Project Setup Tool to enable audio-based face tracking when using A2E, and enable face tracking visemes output when using visemes.
2559

2660
## [72.0.0]
27-
- Updated sample scenes to use OpenXRHands.
61+
62+
### What's New
63+
64+
- **Added viseme support**: Implemented `VisemeDriver.cs` to allow using visemes.
65+
66+
### What's Fixed
67+
2868
- Fixed readme, documentation links and UI path.
29-
- Changed Normal recalculator to run independently by default.
30-
- Added `VisemeDriver.cs` to allow using visemes.
69+
70+
### Improvements
71+
72+
- **Updated hand tracking**: Sample scenes now use OpenXRHands.
73+
- **Improved normal recalculation**: Changed Normal recalculator to run independently by default.
3174

3275
## [71.0.0]
33-
- Normal recalculator has been fixed to run on submeshes with index greater than zero.
34-
- New networking sample shows how to efficiently network body movement by compressing the joint-related movement information for transmission and is compatible with common network providers.
35-
- New Audio To Expressions (A2E) Lina sample, BlendshapeMapping (ARKit) character and other characters modified to support A2E.
76+
77+
### What's New
78+
79+
- **New networking sample**: Added efficient body movement networking with compression, compatible with common network providers.
80+
- **New A2E sample**: Implemented Audio To Expressions (A2E) Lina sample.
81+
82+
### What's Fixed
83+
84+
- Fixed normal recalculator to run on submeshes with index greater than zero.
85+
86+
### Improvements
87+
88+
- **Enhanced character support**: BlendshapeMapping (ARKit) character and other characters modified to support A2E.
3689

3790
## [69.0.0]
38-
- Fixed bug in ISDK scene where controllers were not able to be used
39-
- Improved performance and removed garbage creation when drawing the debug skeleton
40-
- Added HMD remount + restart tracking feature via HMDRemountRestartTracking.cs
41-
- Added menu action to build all available samples (Movement/Build Samples APK)
42-
- Remove unused duplicate face quick action
43-
- Fixed FaceExpressionModifierDrawer call to GUI properties on constructor
91+
92+
### What's New
93+
94+
- **Added HMD remount feature**: Implemented restart tracking feature via HMDRemountRestartTracking.cs
95+
- **Added build menu**: Created menu action to build all available samples (Movement/Build Samples APK)
96+
97+
### What's Fixed
98+
99+
- Fixed bug in ISDK scene where controllers were not able to be used.
100+
- Fixed FaceExpressionModifierDrawer call to GUI properties on constructor.
101+
- Fixed duplicate face quick action by removing unused instance.
102+
103+
### Improvements
104+
105+
- **Improved debug visualization**: Enhanced performance and removed garbage creation when drawing the debug skeleton

Editor/Native/Meta.XR.Movement.Editor.asmdef

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
{
2424
"name": "com.meta.xr.sdk.interaction",
2525
"expression": "",
26-
"define": "INTERACTION_OVR_DEFINED"
26+
"define": "ISDK_DEFINED"
2727
}
2828
],
2929
"noEngineReferences": false
30-
}
30+
}

Editor/Native/Scripts/Block/CharacterRetargeterBlockData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Meta Platforms, Inc. and affiliates.
1+
// Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved.
22

33

44
using System.Collections.Generic;

Editor/Native/Scripts/Block/InstallMovementBuildingBlock.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Meta Platforms, Inc. and affiliates.
1+
// Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved.
22

33
using System.Reflection;
44
using Meta.XR.BuildingBlocks.Editor;

Editor/Native/Scripts/JointAlignmentUtility.cs

Lines changed: 126 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Meta Platforms, Inc. and affiliates.
1+
// Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved.
22

33
using System;
44
using System.Collections.Generic;
@@ -77,7 +77,7 @@ public static void AlignWrists(MSDKUtilityEditorConfig source, MSDKUtilityEditor
7777
PerformArmScaling(source, target);
7878

7979
// 2. Match wrists.
80-
JointMappingUtility.PerformWristMatching(source, target);
80+
PerformWristMatching(source, target);
8181

8282
// 3. Align fingers based on wrist to middle.
8383
foreach (var wristType in new[] { KnownJointType.LeftWrist, KnownJointType.RightWrist })
@@ -197,6 +197,130 @@ public static void TranslateHips(MSDKUtilityEditorConfig source, MSDKUtilityEdit
197197
}
198198
}
199199

200+
/// <summary>
201+
/// Aligns finger bones between source and target skeletons.
202+
/// </summary>
203+
/// <param name="win">The editor window.</param>
204+
/// <param name="startBoneIds">The array of starting bone IDs for fingers.</param>
205+
/// <param name="endBoneIds">The array of ending bone IDs for fingers.</param>
206+
/// <param name="wristType">The wrist joint type.</param>
207+
public static void PerformFingerMatching(MSDKUtilityEditorWindow win,
208+
FullBodyTrackingBoneId[] startBoneIds,
209+
FullBodyTrackingBoneId[] endBoneIds,
210+
KnownJointType wristType)
211+
{
212+
var fingerNames = new[]
213+
{
214+
new[] { "thumb" },
215+
new[] { "index" },
216+
new[] { "middle" },
217+
new[] { "ring" },
218+
new[] { "pinky" }
219+
};
220+
var startNameExtensions = new[]
221+
{
222+
"metacarpal", "proximal", "1", "2"
223+
};
224+
var endNameExtensions = new[]
225+
{
226+
"distal", "3", "4"
227+
};
228+
229+
var startBones = new List<Transform>();
230+
var endBones = new List<Transform>();
231+
var wrist = GetTargetTransformFromKnownJoint(win.TargetInfo, wristType);
232+
var wristBones = wrist.GetAllChildren();
233+
foreach (var fingerNameSet in fingerNames)
234+
{
235+
foreach (var fingerName in fingerNameSet)
236+
{
237+
var startBonesToCheck = startNameExtensions.Select(e => fingerName + e);
238+
var endBonesToCheck = endNameExtensions.Select(e => fingerName + e);
239+
var startBone =
240+
MSDKUtilityHelper.FindClosestMatches(wristBones.ToArray(), startBonesToCheck.ToArray())[0]
241+
.Item1;
242+
var endBone =
243+
MSDKUtilityHelper.FindClosestMatches(wristBones.ToArray(), endBonesToCheck.ToArray())[0]
244+
.Item1;
245+
startBones.Add(startBone);
246+
endBones.Add(endBone);
247+
}
248+
}
249+
250+
for (var i = 0; i < startBoneIds.Length; i++)
251+
{
252+
var startPos = win.SourceInfo.ReferencePose[(int)startBoneIds[i]].Position;
253+
var endPos = win.SourceInfo.ReferencePose[(int)endBoneIds[i]].Position;
254+
var startBone = startBones[i];
255+
var endBone = endBones[i];
256+
Undo.RecordObject(startBone, "Match Fingers");
257+
startBone.position = startPos;
258+
259+
var targetDirection = endPos - startPos;
260+
var targetLength = targetDirection.magnitude;
261+
targetDirection.Normalize();
262+
var currentDirection = endBone.position - startBone.position;
263+
var currentLength = currentDirection.magnitude;
264+
currentDirection.Normalize();
265+
266+
var scaleFactor = targetLength / currentLength;
267+
var rotation = Quaternion.FromToRotation(currentDirection, targetDirection);
268+
startBone.rotation = rotation * startBone.rotation;
269+
UpdateTPoseData(win.TargetInfo);
270+
ApplyScalingToJointIndexAndChildren(win.TargetInfo,
271+
Array.IndexOf(win.TargetInfo.JointNames, startBone.name), scaleFactor);
272+
UpdateTPoseData(win.TargetInfo);
273+
}
274+
}
275+
276+
/// <summary>
277+
/// Aligns wrist joints between source and target skeletons.
278+
/// </summary>
279+
/// <param name="source">The source skeleton configuration.</param>
280+
/// <param name="target">The target skeleton configuration.</param>
281+
public static void PerformWristMatching(MSDKUtilityEditorConfig source, MSDKUtilityEditorConfig target)
282+
{
283+
// Rotate to match left/right hand.
284+
var sourceRightHand = source.ReferencePose[(int)FullBodyTrackingBoneId.RightHandWrist];
285+
var sourceLeftHand = source.ReferencePose[(int)FullBodyTrackingBoneId.LeftHandWrist];
286+
var leftArmIndex = GetKnownJointIndex(target, KnownJointType.LeftUpperArm);
287+
var rightArmIndex = GetKnownJointIndex(target, KnownJointType.RightUpperArm);
288+
289+
var leftUpperArm = target.SkeletonJoints[leftArmIndex];
290+
var leftHand =
291+
target.SkeletonJoints[GetKnownJointIndex(target, KnownJointType.LeftWrist)];
292+
leftUpperArm.rotation =
293+
GetBestRotation(leftUpperArm, leftHand, sourceLeftHand.Position);
294+
295+
var rightUpperArm = target.SkeletonJoints[rightArmIndex];
296+
var rightHand =
297+
target.SkeletonJoints[GetKnownJointIndex(target, KnownJointType.RightWrist)];
298+
rightUpperArm.rotation =
299+
GetBestRotation(rightUpperArm, rightHand, sourceRightHand.Position);
300+
301+
UpdateTPoseData(target);
302+
}
303+
304+
/// <summary>
305+
/// Performs automatic alignment between source and target skeletons.
306+
/// </summary>
307+
/// <param name="win">The editor window.</param>
308+
public static void AutoAlignment(MSDKUtilityEditorWindow win)
309+
{
310+
win.TargetInfo.SkeletonTPoseType = win.Step switch
311+
{
312+
MSDKUtilityEditorConfig.EditorStep.MinTPose => SkeletonTPoseType.MinTPose,
313+
MSDKUtilityEditorConfig.EditorStep.MaxTPose => SkeletonTPoseType.MaxTPose,
314+
_ => win.TargetInfo.SkeletonTPoseType
315+
};
316+
317+
win.ModifyConfig(false, true);
318+
if (win.FileReader.IsPlaying)
319+
{
320+
win.OpenPlaybackFile(win.CurrentPreviewPose);
321+
}
322+
}
323+
200324
/// <summary>
201325
/// Sets the target skeleton to a T-pose configuration.
202326
/// </summary>
@@ -264,7 +388,6 @@ public static void UpdateTPoseData(MSDKUtilityEditorConfig target)
264388
}
265389
}
266390

267-
268391
/// <summary>
269392
/// Scales the arms of the target skeleton to match the source skeleton.
270393
/// </summary>

0 commit comments

Comments
 (0)