MetaHuman Animator を使用したアニメーションの処理は、Python API を使用して、パフォーマンス キャプチャ ワークフローの一部として自動化することができます。 MetaHuman Animator プラグインには多数のサンプル スクリプトが用意されており、参考として使用したり特定の要件に合わせて変更したりできます。 Python スクリプトは、UnrealEditor 実行可能ファイルを使用して実行する必要があります。
キャラクター解析で問題が起こらないよう、コマンドに表示されるパスには、「\」ではなく「/」を使用してください。
音声駆動アニメーション
音声を使ってアニメーションを解決するためのサンプル スクリプトが、プラグインで提供されます。 これを参考として使用したり特定の要件に合わせて変更したりできます。 次の場所にあります。
\Engine\Plugins\MetaHuman\MetaHumanAnimator\Content\Python\process_audio_performance.pyexport_performance.py スクリプトを使用したアニメーション シーケンスまたはレベル シーケンスのエクスポートに関する追加情報については、この Python スクリプトに付属する ReadMe.txt ファイルを参照してください。
深度データを使ったアニメーション
深度データを使ってアニメーションを解決するためのサンプル スクリプトが、プラグインで提供されます。 これを参考として使用したり特定の要件に合わせて変更したりできます。 次の場所にあります。
\Engine\Plugins\MetaHuman\MetaHumanAnimator\Content\Python\process_performance.pycreate_identity_for_performance.py スクリプトを使用した ID の作成に関する追加情報については、この Python スクリプトに付属する ReadMe.txt ファイルを参照してください。また、export_performance.py スクリプトを使用したアニメーション シーケンスまたはレベル シーケンスのエクスポート、およびレンダリングについても同ファイルを参照してください。
キャリブレーションを生成する
キャリブレーションは、ステレオ カメラ ペアを使ってキャプチャしたキャリブレーション テイクから生成できます。 これには、キャプチャ データ アセット (Capture Manager を使用して取り込まれたもの) と MetaHumanCalibrationGeneratorOptions のインスタンスが必要です。 次に例を示します。
import unreal
calibration_generator = unreal.MetaHumanCalibrationGenerator()
calibration_generator.process(capture_data_asset, calibration_generator_options)MetaHumanCalibrationGeneratorOptions のインスタンスは次のとおり作成できますが、設定の多くはデフォルトで行われます。
calibration_generator_options = unreal.MetaHumanCalibrationGeneratorOptions()
calibration_generator_options.package_path.path = '/Game/GenerateCalibration/'
calibration_generator_options.auto_save_assets = True # Set by default
calibration_generator_options.sample_rate = 30 # Set by default
calibration_generator_options.board_pattern_width = 15 # Set by default
calibration_generator_options.board_pattern_height = 10 # Set by default
calibration_generator_options.board_square_size = 0.75 # Set by default
calibration_generator_options.sharpness_threshold = 5.0 # Set by default深度を生成
ステレオ カメラ ペアから深度データを生成するためのサンプル スクリプトが提供されます。 これを参考として使用したり特定の要件に合わせて変更したりできます。 次の場所にあります。
\Engine\Plugins\MetaHuman\MetaHumanAnimator\Content\DepthGenerator\depth_generator_example.pyこのスクリプトは、次のコマンドを使用して Windows ターミナル (PowerShell など) から実行できます。パラメータはプロジェクトに合わせて更新してください。
.\UnrealEditor.exe "MyProject.uproject" -ExecutePythonScript="<path-to_ue-installation>/Engine/Plugins/MetaHuman/MetaHumanAnimator/Content/DepthGenerator/depth_generator_example.py --cd-package-path /Game/CaptureManager/Imports/ExampleTake/CD_Example"次の内容
メッシュをMetaHumanに変換
メッシュまたは動画フッテージから MetaHuman Identity を作成します。