# モーションキャプチャで動かす カメラ(camera)からcharacterを動かす技術をモーションキャプチャ(motion capture)といいます。様々なprotocol(プロトコル)がありますが、`vrm4u`では[vmc](https://qiita.com/mintan/items/72d63cce4e6197b151b7)というprotocolを使います。 `epicgames`は[livelink](https://dev.epicgames.com/documentation/ja-jp/unreal-engine/live-link-in-unreal-engine)というものを作っています。 必要なものは多く、基本的には`web-camera`、`client-app`, `ue-plugin`が必要です。私は以下を使っています。 - camera: ノートパソコンに付属しているwebカメラ - client: [webcam motion capture](https://webcammotioncapture.info/) - plugin: [vrm4u](https://github.com/ruyo/VRM4U) clientはそれぞれのosにあったものを選びます。無料でも可能ですが、性能的には有料アプリがおすすめです。いくつか紹介しておきます。 この辺の情報は最初はわからないと思いますが、基本的には以下の流れで情報を処理します。 ```sh [camera] --> [client] --> [plugin] ``` ## client |name|body|free| |---|---|---| |[vmc](https://github.com/sh-akira/VirtualMotionCapture)|vmcの開発元が出しているclient。protocolと同じ名前がつけられている|🟩| |[vseeface](https://www.vseeface.icu/)|高性能なclient|🟩| |[xr animator](https://booth.pm/ja/items/4513654)|お手軽に表示できるclient|🟩| |[waidayo](https://booth.pm/ja/items/1779185)|iosにも対応しているclient|🟩| |[vrm posing desktop](https://store.steampowered.com/app/1895630/VRM_Posing_Desktop/)|steamから出ているclient|🟥| |[webcam motion capture](https://webcammotioncapture.info/)|安定したclient。使ってみた中では動きが一番良かった|🟥| ## build packageを使うときportに注意 clientから送信されるportをpluginで受信します。build packageの`.exe`で確認するときは、editor(エディタ)を落としておきましょう。 ## 停止したときだけvmcを有効にする VMCモードを有効にすると、キャラクターがidle状態、つまり、停止しているときだけVMCのモーションキャプチャを反映させます。 これはVMCモードの変数を用意し、ABPで条件を書いて実現しています。キャラクターを動かしたときは一時的に無効にします。