# FBX出力を有効にする手順について

## 事前準備

### open-brushをUnity上で実行できるところまで進めておく
* https://unity.com/ja
* https://github.com/icosa-gallery/open-brush/

### com.autodesk.fbxのソースコードの入手
* https://github.com/Unity-Technologies/com.autodesk.fbx/releases/tag/3.0.1-preview.1
  * `3.0.1-preview.1`で動作確認済み
* わかりやすいパスに置いておく
  * 例として `C:\Tools\src\com-autodesk-fbx`を使用する

### Visual Studio 2017(Community)をインストール
* https://visualstudio.microsoft.com/ja/vs/older-downloads/

* `C# SDK`, `C++ SDK`, `Universal Windows App Development Tools`が必要
  
### Cmakeをインストール
* https://cmake.org/download/
  * 最新のWindows版インストーラで問題無し
  * `cmake-3.19.4-win64-x64.msi`で動作確認
  * インストール時に、PATHの追加をしておく(Current User/System WideどちらでもOK)

### swigwin-3.0.12を導入
* http://www.swig.org/download.html
  * `swigwin-3.0.12.zip`
  * `3.0.12`を使用する必要有り

* ダウンロード後、わかりやすいパスに移動してPATHを通しておく
  * 例として`C:\Tools\swigwin`を利用
  * ユーザ環境変数で問題無し
  * https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/
  
### Pythonの導入
* https://www.python.org/downloads/
  * `Add Python 3.9 to PATH`にチェックを入れておく

### FBX SDKの導入
* https://www.autodesk.com/developer-network/platform-technologies/fbx-sdk-2020-0
  * `FBX SDK 2020.0.1 VS2015`を使用すること

### gitの導入
* https://git-scm.com/
  * `Git from the command line and also from 3rd-party software`にチェックしておく

## TiltBrush対応の補正
* TiltBrushのリポジトリから、`Support/fbx/tilt_brush.i`を`com.autodesk.fbx`の`Sources`ディレクトリ内にコピー
* `Sources/fbxsdk.i`を開き、`%include "fbxtemplates.i"`の行の下に`%include "tilt_brush.i"`を追加

## ビルド

1. コマンドプロンプトを開き、`com.autodesk.fbx`のソースコードのあるディレクトリへ移動
2. `python build.py`を実行

## TiltBrush上でのFBXサポートの有効化

1. TiltBrushの`Packages`に、`build/install`の中の`com.autodesk.fbx`をコピー

![image.png](/attachment/60150e29c04cf70047878755)

![image.png](/attachment/60150e58c04cf70047878756)

![image.png](/attachment/60150e80c04cf70047878757)

2. `Scripting Define Symbols`に`;FBX_SUPPORTED;FBXSDK_RUNTIME`を追加

![image.png](/attachment/60150febc04cf70047878758)

3. `Tilt/Build/Do Build`を実行

![image.png](/attachment/601510ffc04cf70047878759)

---

## Page Navigation

- Canonical URL: https://wiki.thakyuu.invr.chat/TiltBrush/Tips_how_to_support_fbx_ja
- Permalink: https://wiki.thakyuu.invr.chat/601508d0c04cf70047878752
- Parent: [TiltBrush](/60150573c04cf7004787874f.md)
- Children: 0 total
- Total descendants: 0
- Siblings: 1 total
  - [Tips_how_to_support_fbx_en](/60151306c04cf7004787875b.md)
- Last updated: 2021-01-30T07:56:06.674Z by thakyuu
- Full page listing (all children regardless of count): https://wiki.thakyuu.invr.chat/_api/v3/page-listing/children?id=601508d0c04cf70047878752
