Skip to content

Instantly share code, notes, and snippets.

@noppefoxwolf
Created June 21, 2021 08:20
Show Gist options
  • Save noppefoxwolf/c9b5520bbdb7f4f24f0c2397927803df to your computer and use it in GitHub Desktop.
Save noppefoxwolf/c9b5520bbdb7f4f24f0c2397927803df to your computer and use it in GitHub Desktop.
perfectsync.cs
if (arFaceManager.subsystem is ARKitFaceSubsystem subsystem) {
using(var blendShapes = subsystem.GetBlendShapeCoefficients(face.trackableId, Allocator.Temp)) {
view.SetBlendShapes(blendShapes);
}
}
private void SetBlendShapes(NativeArray < ARKitBlendShapeCoefficient > blendShapes) {
foreach(var blendShape in blendShapes) {
float x = 0.0 f;
float fixedCoefficient = 0.0 f;
cubicBezier.Eval(blendShape.coefficient, ref x, ref fixedCoefficient);
var location = blendShape.blendShapeLocation.ToString();
var key = BlendShapeKey.CreateUnknown(location);
blendShapeProxy.AccumulateValue(key, fixedCoefficient);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment