UnityARKitPlugin FaceTracking FaceBlendshapeで取得できるパラメーター

## FaceBlendshape とは
顔の各部位の状態を取得できるAPIのこと。
取得した各部位の値を元にして顔の位置に配置した3Dモデルの表情を動かしたり、
コントローラーの代わりにすることができる。

Note. 顔の各部位の状態は取得できるが、各部位の位置の取得はできない？

## iOS ARKitのリファレンス
https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation

## Unity ARKitPlugin Blog
https://blogs.unity3d.com/jp/2017/11/03/arkit-face-tracking-on-iphone-x/

## Unity ARKitPlugin でのBlendshapeの取得方法
Start() で UnityARSessionNativeInterface.ARFaceAnchorUpdatedEvent にメソッドを登録

```C#:
void Start() {
    (略)
    UnityARSessionNativeInterface.ARFaceAnchorUpdatedEvent += FaceUpdated;
}
```

登録したメソッドでFaceトラッキングの変更通知を受け取り、ARFaceAnchorからblendShapeを取得

```C#:
void FaceUpdated(ARFaceAnchor anchorData) {
   Dictionary<string, float> currentBlendShapes = anchorData.blendShapes;
}
```
取得したDictionaryに下記のパラメータキーでそれぞれの値がとれる。

### パラメータについての注
L,Rはカメラに写った像の右左に対するパラメーター。
ARKitでディスプレイに表示される映像は鏡に写ったように表示されるので、実際の右左とは逆のパラメーターになる
>In the naming of blend shape coefficients, the left and right directions are relative to the face. That is, the eyeBlinkRight coefficient refers to the face's right eye. ARKit views running a face-tracking session mirror the camera image, so the face's right eye appears on the right side in the view.

## 眉

|パラメーターキー|顔の部位|ARKit|備考|
|:-----------|------------|------------|------------|
|browInnerUp|両眉の内側部分の上方向への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928264-browinnerup)||
|browOuterUp_L|左眉の外側の上方向への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928274-browouterupleft)|
|browOuterUp_R|右眉の外側の上方向への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928255-browouteruprigh)|
|browDown_L|左眉の外側の下方向への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928223-browdownleft)|
|browDown_R|右眉の外側の下方向への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928254-browdownright)|

## 眼

|パラメーターキー|顔の部位|ARKit|備考|
|:-----------|------------|------------|------------|
|eyeBlink_L|左目瞬き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928261-eyeblinkleft)|開いていると0（に近づき）,閉じていると1（に近づく）
|eyeBlink_R|右目瞬き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928262-eyeblinkright)|開いていると0（に近づき）,閉じていると1（に近づく）
|eyeWide_L|左の瞼の広がり→左眼の開き具合|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928233-eyewideleft)|
|eyeWide_R|右の瞼の広がり→右目の開き具合|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928267-eyewideright)|
|eyeLookDown_L|左目の下方向への視線|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928234-eyelookdownleft)|
|eyeLookDown_R|右目の下方向への視線|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928272-eyelookdownright)|
|eyeLookIn_L|左目の右方向への視線|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928260-eyelookinleft)|
|eyeLookIn_R|右目の左方向への視線|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928243-eyelookinright)|
|eyeLookOut_L|左目の左方向への視線|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928269-eyelookoutleft)|
|eyeLookOut_R|右目の右方向への視線|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928265-eyelookoutright)|
|eyeSquint_L|左目周辺の顔の収縮具合|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928252-eyesquintleft)|
|eyeSquint_R|右目周辺の顔の収縮具合|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928237-eyesquintright)|
|eyeLookUp_L|左目の上方向への視線|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928250-eyelookupleft)|
|eyeLookUp_R|右目の上方向への視線|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928258-eyelookupright)|

## 鼻

|パラメーターキー|顔の部位|ARKit|備考|
|:-----------|------------|------------|------------|
|noseSneer_L|左の鼻孔周辺の上方向への移動|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928263-nosesneerleft)|
|noseSneer_R|右の鼻孔周辺の上方向への移動|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928239-nosesneerright)|

## 頬

|パラメーターキー|顔の部位|ARKit|備考|
|:-----------|------------|------------|------------|
|cheekPuff|両頬の外側への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928232-cheekpuff)|
|cheekSquint_L|左頬の周辺の上方向への移動|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928226-cheeksquintleft)|
|cheekSquint_R|右頬の周辺の上方向への移動|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928238-cheeksquintright)|

## 口

|パラメーターキー|顔の部位|ARKit|備考|
|:-----------|------------|------------|------------|
|mouthRollLower|下唇の口内への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928224-mouthrolllower)|
|mouthRollUpper|上唇の口内への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928227-mouthrollupper)|
|mouthPucker|唇の収縮|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928257-mouthpucker)|
|mouthShrugLower|下唇の外側への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928230-mouthshruglower)|
|mouthShrugUpper|上唇の外側への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928276-mouthshrugupper)|
|mouthClose|唇の開閉（顎の位置に依存しない）|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928266-mouthclose)|
|mouthFunnel|開いた口の収縮|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928253-mouthfunnel)|
|mouthLowerDown_L|左側の下唇の下方向への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928242-mouthlowerdownleft)|
|mouthLowerDown_R|左側の下唇の下方向への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928275-mouthlowerdownright)|
|mouthUpperUp_L|左側の上唇の上方向への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928240-mouthupperupleft)|
|mouthUpperUp_R|左側の上唇の上方向への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928247-mouthupperupright)|
|mouthDimple_L|口の最左端の後方への移動|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928231-mouthdimpleleft)|
|mouthDimple_R|口の最右端の後方への移動|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928259-mouthdimpleright)|
|mouthPress_L|左側の下唇の上方向への収縮(移動)|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928241-mouthpressleft)|
|mouthPress_R|右側の下唇の上方向への収縮(移動)|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928245-mouthpressright)|
|mouthStretch_L|口の最左端の左方向への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928235-mouthstretchleft)|
|mouthStretch_R|口の最右端の右方向への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928268-mouthstretchright)|
|mouthLeft|唇の左方向への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928228-mouthleft)|
|mouthRight|唇の右方向への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928246-mouthright)|
|mouthSmile_L|口の最左端の上方向への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928249-mouthsmileleft)|
|mouthSmile_R|口の最右端の上方向への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928244-mouthsmileright)|
|mouthFrown_L|口の最左端の下方向への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928277-mouthfrownleft)|
|mouthFrown_R|口の最右端の下方向への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928270-mouthfrownright)|

## 顎

|パラメーターキー|顔の部位|ARKit|備考|
|:-----------|------------|------------|------------|
|jawOpen|下顎の開閉|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928236-jawopen)|
|jawForward|下顎の前方向への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928229-jawforward)|
|jawLeft|下顎の左方向への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928273-jawleft)|
|jawRight|下顎の右方向への動き|[詳細](https://developer.apple.com/documentation/arkit/arfaceanchor.blendshapelocation/2928248-jawright)|


## メモ
ARKitのリファレンスでは

> ranging from 0.0 (neutral) to 1.0 (maximum movement).

とあるが、どう頑張っても1にならないパラメータがある。
顔の作りによって取得できやすいパラメータがあるのかもしれない。