1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

VRMモデルを使っているけど、どうしてもFBXでUnityに入れたいとき用(BlenderでのBlendshapeを使いたいとき)

Last updated at Posted at 2022-02-28

BlenderでVRMをFBXで出力後にLook Atを適用する方法

Blenderの設定

fbx の出力時に、

  1. 内容からアーマチュアとメッシュを選択。
  2. アーマチュアからリーフボーンを追加のチェックを外す。
  3. アニメーションをベイクのチェックを外す。

そのあとで、FBXをエクスポートをクリック

FBXの設定

肝のところ!

Model の Bake Axis Conversion のチェックをつける

Rig の Animation Type を Humanoid に設定

VRN Look At Headの変更

VRMLookAtHead.cs
        [SerializeField] public float yawDiff; //追加

        [SerializeField] public float pitchDiff; //追加

...
        public void LookWorldPosition(Vector3 targetPosition, out float yaw, out float pitch)
        {
            var localPosition = Head.worldToLocalMatrix.MultiplyPoint(targetPosition);
            Matrix4x4.identity.CalcYawPitch(localPosition, out yaw, out pitch);
            yaw -= yawDiff; //追加
            pitch -= pitchDiff; //追加
            RaiseYawPitchChanged(yaw, pitch);
        }

Gizumoでデバッグしてyawとpitchの分のずれを補正する.

Modelの設定

あとは通常通りに、

  1. 別にimportしたVRMモデルからマテリアルの設定
  2. VRM Look At Head と VRM Look at Bone Applyer を設定する!

REM_TEST-SampleScene-PC_-Mac-_-Linux-Standalone-Unity-2020.3.gif

2022/04/01 追記

もっと、いい方法があったのでそっちの方を追記

Blender 側の出力設定

qiita_20220401.PNG

同じ設定

内容を

  • アーマチュア

  • メッシュ

  • その他

を選択する

トランスフォームを適用

をチェックする

リーフボーンを追加しない

新しい設定

アーマチュアのセカンダリボーンを-X軸に設定する

これにより、Model の Bake Axis Conversion のチェックをつけなくてもよくなる。

Bake Axis Conversion があると、Very Animation が崩れる(´;ω;`)....。

以上!

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?