Blenderでモデルを作成しUnityに取り込むまで

使用環境

Windows 10
Blender 2.90.0
MediBang Paint Pro 25.3

モデリング

  • SDSで板ポリゴンでも尖らせる方法

https://dskjal.com/blender/sharpen-edge.html

クリース: 2辺選択 > Shift+E

透過選択

https://qiita.com/kazuma_f/items/48b44d8e5d1c0049c7b0

立方体からではなくカプセルから作るべき

https://teratail.com/questions/247656

https://i.imgur.com/8EU9rNa.png

  • ひれを板ポリで作りたい todo

UV展開

辺選択, ctrl + e, シームをつける

https://mrsoramame.jpn.org/archives/687

左上 編集モードの右: 点・辺・面選択モード切り替え

https://tamago-design.net/sentaku-01

https://blender-cg.net/senntaku-shortcut/#ShiftG

シーム辺選択した状態で [選択] > [類似選択] > [シーム] でシーム選択

メッシュ選択 > U で [展開]

UVエディタ

L で Island選択

UVマップを一つにまとめたい

https://reflectorange.blog.jp/archives/082.html

全体を選択しても一枚の画像にエクスポート出来ない

テクスチャ作成

  • UVメッシュは非表示にして書き出すように

    https://i.imgur.com/LtWYP1C.jpg

適当なテクスチャを作成

https://i.imgur.com/ck5Fict.png

https://i.imgur.com/OIiFNCj.png

テクスチャを貼る

シェーダーエディターで

https://bookyakuno.com/how-to-set-textures-in-blender280/#シェーダーエディターでの設定方法

TODO: 一つのオブジェクトしかテクスチャが反映されない

オブジェクト

シーンコレクション > オブジェクト

選択 > P > [選択] でオブジェクトを分離できる

めり込んだメッシュの選択はいちいち範囲選択をしなければいけないのか

https://www.cgradproject.com/archives/1757/

頂点スムース

ボーン

https://styly.cc/ja/tips/blender-modeling-start5-1/

https://nn-hokuson.hatenablog.com/entry/2017/10/03/205639#:~:text=hokuson.hatenablog.com-,ボーンとメッシュを関連付ける,的に関連付けられます。

メッシュを一つに統合しなければならない

  • Layoutで全選択して Ctrl + J

メッシュ → アーマチュア を選択して Ctrl + P > 自動のウェイトで

Ctrl + Tab でポーズモードになる

特定のボーンを選択しながらウェイトペイントモードにするというのがどうやっても出来ない

エディタ(モディファイアとかあるところ)の逆三角形のマークがボーンエディタ、頂点グループを選択するとそのボーンのウェイトが見れる

https://reflectorange.blog.jp/archives/090.html

xxx.L, xxx.R というボーン名にして右クリック > 対称化で左右対称なウェイトを作れる

左右対称なボーン

https://reflectorange.blog.jp/archives/071.html

  • humanoidのボーンのほうが後々楽?

https://your-3d.com/blender-rigging-humanoid/

https://unity-shoshinsha.biz/archives/1226

https://i.imgur.com/TyYkkME.png

Unity向けのエクスポート設定

fbx

https://3dcg-school.pro/blender-export-export-settings-for-unity/

https://qiita.com/sagaraKUN/items/9b9e3e3aa6458368ea18

  • テクスチャが反映されない

https://nn-hokuson.hatenablog.com/entry/2016/06/29/220310

fbx を D&D → Rig.AnimationType = humanoid, configureからリグを少し修正

ボーン名で自動的に設定したかったが一筋縄ではいかなかった

https://blogs.unity3d.com/2013/02/07/automatic-setup-of-a-humanoid/?_ga=2.98276505.707566150.1610014620-1212033088.1591368555

https://i.imgur.com/3uQjuWp.png

fbxに埋め込みのマテリアル(Embedded Materials) を使うほうが今流

Blednerで埋め込み設定できる

https://dkrevel.com/unity-and-blender/blender-to-unity-fbx-model/

反映されなかったのでレガシーな方で

  1. fbx > Materials > Location を Use External Materials(Legacy) に
  2. 生成されたMaterialのAlbedoの左に画像をD&D

https://i.imgur.com/cXsyilM.png

シェーダー周り

メッシュの裏側が表示されないのは Standardシェーダーがカリングをしてくれるから

カリングしないシェーダーを書いて設定

https://tutorials.shade3d.jp/マテリアルとシェーダーについて裏面も表示する/post/1865

シャドウ周り

https://light11.hatenadiary.com/entry/2019/08/30/080812

https://i.imgur.com/0NKU8y8.png

https://i.imgur.com/aTbGm4h.png

https://i.imgur.com/7vLRLne.png

手先, 足先のウェイトを無くした

アニメーション

https://assetstore.unity.com/packages/3d/characters/taichi-character-pack-15667?locale=ja-JP

https://i.imgur.com/XhpOXIK.png

TODO

  • 当たり判定
  • 操作
  • fbxの中に余計なものがありサイズが大きいので最適化
  • モーションとか
  • シェーダー周り, きれいな描画にしたい