-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
111 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,50 @@ | ||
# モデルをカスタマイズする | ||
# 素体を作る | ||
|
||
素体を作ります。色々と探したのですが、なかなか納得するものが見つかりません。できる限り現実に近いものを目指します。 | ||
素体を作ります。できる限り現実に近い再現を目指します。これを`gender system`と呼び、わかりやすくいうとキャラクターの性器システムです。 | ||
|
||
今回は、Aモデル(vrm)とBモデル(部位)の統合をblenderで行います。統合したものをvrmにexportして、ueでimportします。Bモデルにはシェイプキーを設定しているので、ueではモーフターゲットとして動かせるようにします。 | ||
|
||
blenderのexportやueのimportは注意が必要です。`VRM MToon`, `ペアレントで[Body]頂点`, `UVMap`, `シェイプキーをSKkeeperで上書き`が必要でした。 | ||
ueで動かすにはmaterialに`VRM MToon`を使うこと、`UVMap`の名前に設定すること、`vrm0`を使うこと、データ転送で`頂点`を設定することが大切です。今回使用する[addon](/blender/)は、vrmをimport, exportするaddonだけです。 | ||
|
||
使用する[addon](/blender/)を確認してください。 | ||
## vroidの設定 | ||
|
||
1. まずBモデルをblenderで読み込み、いらないものを削除します。vrmを読み込むaddonが必要です。 | ||
2. materialに`VRM MToon`を設定します。ueでimportする際にcrashします。 | ||
3. dataのUVマップに`UVMap_xxx`となっているときは名前を`UVMap`にします。色がおかしくなります。 | ||
4. 編集モードでBモデルを膨らませます。これは頂点を選択して[G]を押します。 | ||
5. addonの`SKkeeper`を使い、オブジェクトメニューからapply modifyを選択します。追加モデルのmirrorやkeyをまとめます。これをしないとvrmにexportできません。 | ||
6. 次にAモデルの編集です。いくつかの面を削除してBモデルをくっつけても違和感ないようにします。 | ||
7. トランスフォームのペアレントで`[Body]頂点`を選択します。G, [y, z, r]などを駆使して位置調整してください。 | ||
素体はvroidをベースにします。つけている衣装を全部はずします。そして、パンツなどもテクスチャを削除しておくと素体の完成です。 | ||
|
||
ペアレントは正しく設定されるときもあればズレることもあります。同じファイルをvrmにexportしても結果がその都度異なります。また、モーフターゲットが正しく反映されないこともあります。 | ||
## materialの設定 | ||
|
||
私は`[Armatrue]ボーン(hip)`につけることで設定しました。しかし、ueで読み込んだとき少し下に表示されるので、これ自体をずらした位置で調整し、ueで確認する必要がありました。 | ||
vrmをblenderで読み込みます。 | ||
|
||
1. Bモデルのmaterialに`VRM MToon`を設定します。ueでimportする際にcrashします。 | ||
2. dataのUVマップに`UVMap_xxx`となっているときは名前を`UVMap`にします。色がおかしくなります。 | ||
|
||
## 基本的な編集(移動、削除、位置) | ||
|
||
1. Bモデルを正しい位置にセットします。[G], [Z], [R] | ||
2. Aモデルを適切に切り取ります。[面を選択], [細分化], [四角形に], [面を削除] | ||
3. シェイプキーを動かしても問題ないかの確認します。 | ||
|
||
 | ||
|
||
## bodyに追従させる | ||
|
||
このままではBモデルは体に追従しません。追従させるには頂点をアーマチュア(armature)に追加します。 | ||
|
||
1. Bモデルのモディファイアから[データ転送], [Body(J_Bip_C_Hips)], [頂点], [頂点グループ]を選択し、[データレイヤーを生成], [適用]します。 | ||
2. Bモデルのモディファイアでアーマチュアで[Armature]を追加します。 | ||
3. 女性の場合はボーン(足)を調整します。なお、少し浮くようになってしまうため全体を-Zします。[G], [X], [R] | ||
|
||
> シェイプキーをueでも有効にするには、vrm0を使います。また、編集しているときにobjectを分離した場合は元の構成に再統合してください。 | ||
 | ||
|
||
## gender systemについて | ||
|
||
例外ない限りキャラクターにはgender systemが搭載されます。アイは原作で性別がないので、例外的にgender systemから除外されています。 | ||
|
||
最初に実装するキャラは、仮名で`アダブ(男性)`, `イブチェ(女性)`になります。 | ||
|
||
## issue: ueで読み込むと一部のmaterialが正しく表示されない | ||
|
||
この現象はblenderで作った`.vrm`をvrm4uで読み込み、一旦、ueを終了するとその後、materialがおかしくなります。 | ||
|
||
しかし、`vrm1`の出力は正常なので、それを読み込んで生成されたmaterialを`SK_${name}`にセットしています。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# 衣装を着せる | ||
|
||
1. blenderに[kiseru](https://pielotopica.booth.pm/items/4854979)をインストールします。これは、頂点をデータ転送で設定するaddonです。 | ||
2. 衣装を編集モードの分離やテクスチャペイントなどを駆使して作ります。衣装は体に合わせてください。 | ||
3. 衣装を選択した状態で、モディファイア -> データ転送、頂点を選択し、頂点グループにチェックを入れ、データレイヤーを生成します。そして、データ転送を適用します。すると、頂点グループが作られます。 | ||
4. 衣装とボディを選択し、統合します。統合を適用します。 | ||
|
||
なお、`SKkeeper`を使わないとueで動かない可能性があります。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# vrmで統合する | ||
|
||
`.vrm`を読み込んで、別の`.vrm`に統合する方法を紹介します。最終的にはueでも動くようにします。 | ||
|
||
編集しているうちにblenderのシェイプキーがueのモーフターゲットにexportできなくなったり、髪の毛のウェイトが消えていたりといったトラブルが多発します。 | ||
|
||
blenderのvrmはspring boneを設定して髪の毛を動かしています。これはboneに付いているcolliderと連動しています。 | ||
|
||
髪の毛はboneとも連動していて、armature(bone)を統合したあとにheadとheadをつなげなければなりません。 | ||
|
||
統合するobjectの動きを本体に追従したい場合は頂点とアーマチュアを正しく設定しなければなりません。データ転送を活用します。 | ||
|
||
髪の毛が動かない場合、物理シュミレーションが設定されているか確認してください。ueの`kawaiiphysics`でも設定できます。私はueのほうで設定しています。また、髪の毛のウェイトが剥がされていないか確認してください。データ転送後は髪の毛にウェイトが付いているか確認しましょう。 | ||
|
||
シェイプキー(モーフターゲット)が消えてしまうのは`vrm1`に起因します。blenderで編集する場合は`vrm0`をベースにしてください。また、シェイプキーは元のobject名に再統合しなければ消えてしまいます。 | ||
|
||
1. vrm0をベースにしているか。 | ||
2. objectを元の状態に再統合できているか。 | ||
3. 髪の毛にウェイトはあるか。 | ||
4. 髪の毛に物理シュミレーションはあるか。 | ||
|
||
## 具体的な手順 | ||
|
||
hair(髪の毛)とbody(体)で分けられたvrmを読み込むこととします。これを統合します。 | ||
|
||
1. まず、boneの統合を行います。boneはarmatureというようです。不要なboneを削除します。そして、完成版となるarmatureを最後に選択して統合します。 | ||
2. 次に必要なboneをつなぎます。boneを編集モードで編集し、`J_Bip_C_Head` -> `head`を選択し、右クリックで親を`オフセット維持`で設定します。 | ||
3. 次にhairを選択し、モディファイアからデータ転送を行います。ソースに`body`, 頂点グループに`J_Bip_C_Head`を選択します。ここが特に重要です。そして、頂点データにチェックを入れ、頂点グループを選択します。最後にデータレイヤーを生成し、適用します。これでhairとbodyがつながった状態になりました。bodyが主体になります。 | ||
|
||
ウェイトがhair(J_Bip_C_Head)に設定されていることを確認してください。今後、hairのobjectをいじると削除される可能性があります。 | ||
|
||
## ueで物理シュミレーションを設定する | ||
|
||
1. 次にueでhairを動くようにします。ueでvrmを読み込んで、`ABP_Post_${name}`を編集します。`kawaiiphysics`でRoot Boneに`J_Sec_Hair_1_xx`を1-12まで入れて、Capsule Limitsに`chest`, `hip`などを設定します。私は`chest`の値を大きめにして対処しました。 | ||
2. 次に、服が体に入りこまないようにしなければなりません。これも先ほどと同じように設定します。 | ||
3. 設定後は`ABP_Post_${name}`をコピーしておきましょう。このファイルは新しくvrmを読み込むと上書きされるため、最新版を読み込んだあと再設定しやすいように。 | ||
|
||
blenderから読み込んだmodelを動かしてみた。 | ||
|
||
 | ||
|
||
## blendshapeとvmc | ||
|
||
vmcは`.vrm`をblenderで開いたときblendshape(ブレンドシェイプ)が設定されていれば大抵動くと思います。 | ||
|
||
ただし、blenderで編集した際に使えなくなってしまう可能性が高いです。例えば、objectを分離した場合がそうです。最初の構成にobjectを統合すると動くようになります。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.