Code Monkey home page Code Monkey logo

easymotionrecorder's Introduction

release

EasyMotionRecorder

Unityエディタ上でVRIKなどのモーションキャプチャをしたHumanoidキャラクターのモーションを記録, 再生をするスクリプトです。

例えばVTuberの人が1テイク目でキャラの動きだけを撮り、2テイク目以降で1テイク目のモーションを再生しながら音声と表情を付ける、という使い方を想定しています。

使い方

releasesからEasyMotionRecorder.unitypackageをダウンロードしてプロジェクトにインポートしてください

Setup手順

  1. モーションキャプチャ対象のキャラクターをHumanoidにしておく。OculusTouchやViveコントローラ、あるいはAxisNeuronやKinectの動きがエディタ上で反映されているシーンをセットアップする。

  2. シーン上に/Assets/EasyMotionRecorder/Prefabs/EasyMotionRecorder.prefabを配置する。

  3. 1.でシーン上に配置したEasyMotionRecorderにアタッチされているMotionDataPlayerコンポーネントおよびMotionDataRecoderコンポーネントのAnimatorにモーションキャプチャ対象のキャラクターをアタッチする。

モーション記録

  1. Unityエディタ上で実行して、Rキーを押したタイミングからモーションキャプチャデータを記録、Xキーでファイル書き出しをして記録を終了します。

  2. /Assets/Resources/の中にRecordMotion_2018~~~ ファイルが生成されていればモーション記録が成功しています。

モーション再生

  1. エディタ実行前にモーション録画で生成したファイル(RecordMotion_2018~~~ )をシーン上に存在するEasyMotionRecorderゲームオブジェクトのMotionDataPlayerコンポーネントのRecordedMotionDataプロパティにアタッチします。

  2. Unityエディタ上で実行して、Sキーでモーションデータの再生開始が行えます。モーションデータの最後に到達するか、Tキーでモーションデータ再生が終了します。

おすすめの使い方(.animファイル書き出し)

モーション記録して生成されたRecordMotion_2018~~~ ファイルを選択、インスペクタ上で右クリックして「Export as Humanoid animation clips」を選択するとAnimationClipに変換されます。

変換後のAnimationClipはHumanoid準拠のモーションとしてMecanimAnimatorやUnityTimeline上で扱うことが出来ます。

もし床にキャラクターが沈んでしまう場合はHumanoidのAnimationClipにあるRoot Transform Position(Y)をBased Upon:Originalに変更してください。
export_gif

FAQ

使っているとUnityが重い

申し訳ありません、録画中の処理負荷は多少増えます。

使うショートカットキーを変えたい

インスペクタ上のEasyMotionRecorder内、MotionDataRecoderとMotionDataPlayerでキーを選べるようになっています。

長時間記録しているとUnityが落ちた

素朴な実装を行っているため記録中は常にメモリを食い続けます。

もし長時間の記録が必要であればメモリの増設をお勧めします、10分程度でしたら問題ありません。

モーションを再生しているときにスカートや髪が揺れない

スクリプトの実行順を変更してください。

SpringBone, DynamicBone, BulletPhysicsImplなど、揺れ物アセットのScript Execution Orderを20000以上に設定してください。

再生開始フレームを指定したい

MotionDataPlayer内のstartFrameで再生開始フレーム指定が可能です。

セットアップの説明が分かりづらい

申し訳ありません、セットアップ手順の動画がありますのでご参照ください。

ビルドしたバイナリ上でモーションを記録したい場合はMotionDataPlayerCSV.csなどをご参照ください。

Known Issues

VRIK使用時にキャラクターの立ち位置がズレることがある

VRIKの処理順による問題です、再生開始時の位置を変更することで暫定対処可能です。

動作環境

Unity 2017.4.28f1 64bit (Windows)のエディタ上で動作確認をしています。

Unity2017.4~Unity2019.3 での動作実績があります。

公式にはVRIKをサポートしますが、Kinectや各種モーションキャプチャーシステムでの動作も(無保証ですが)動作実績があります。

ライセンス

This software is released under the MIT License, see LICENSE.txt.

(このソフトウェアは、MITライセンスのもとで公開されています。)

easymotionrecorder's People

Contributors

entum avatar neon-izm avatar phields avatar nkjzm avatar sh-akira avatar arumani avatar twilight07 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.