Skip to content

Commit

Permalink
docs: development setup
Browse files Browse the repository at this point in the history
  • Loading branch information
saturday06 committed Aug 29, 2024
1 parent 70b6d42 commit 3bf9f08
Show file tree
Hide file tree
Showing 5 changed files with 186 additions and 16 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ VRM Add-on for Blender is an add-on to add VRM-related functions into Blender.
| :---: | :---: | :---: |
| <a href="https://vrm-addon-for-blender.info/en/installation?locale_redirection"><img width="200" src="https://vrm-addon-for-blender.info/images/installation.gif"></a> | <a href="https://vrm-addon-for-blender.info/en/create-simple-vrm-from-scratch?locale_redirection"><img width="200" src="https://vrm-addon-for-blender.info/images/simple.gif"></a> | <a href="https://vrm-addon-for-blender.info/en/create-humanoid-vrm-from-scratch?locale_redirection"><img width="200" src="https://vrm-addon-for-blender.info/images/humanoid.gif"></a> |
| **[Create Physics Based Material](https://vrm-addon-for-blender.info/en/material-pbr?locale_redirection)** | **[Create Anime Style Material](https://vrm-addon-for-blender.info/en/material-mtoon?locale_redirection)** | **[Automation with Python Scripts](https://vrm-addon-for-blender.info/en/scripting-api?locale_redirection)** |
| <a href="https://vrm-addon-for-blender.info/en/material-pbr?locale_redirection"><img width="200" src="https://vrm-addon-for-blender.info/images/material_pbr.gif"></a> | <a href="https://vrm-addon-for-blender.info/en/material-mtoon?locale_redirection"><img width="200" src="https://vrm-addon-for-blender.info/images/material_mtoon.gif"></a> | <a href="https://vrm-addon-for-blender.info/en/scripting-api?locale_redirection"><img width="200" src="https://vrm-addon-for-blender.info/images/scripting_api.png"></a> |
| **[VRM Animation](https://vrm-addon-for-blender.info/en/animation?locale_redirection)** | | |
| <a href="https://vrm-addon-for-blender.info/en/animation?locale_redirection"><img width="200" src="https://vrm-addon-for-blender.info/images/animation.gif"></a> | | |
| <a href="https://vrm-addon-for-blender.info/en/material-pbr?locale_redirection"><img width="200" src="https://vrm-addon-for-blender.info/images/material_pbr.gif"></a> | <a href="https://vrm-addon-for-blender.info/en/material-mtoon?locale_redirection"><img width="200" src="https://vrm-addon-for-blender.info/images/material_mtoon.gif"></a> | <a href="https://vrm-addon-for-blender.info/en/scripting-api?locale_redirection"><img width="200" src="https://vrm-addon-for-blender.info/images/scripting_api.gif"></a> |
| **[VRM Animation](https://vrm-addon-for-blender.info/en/animation?locale_redirection)** | **[Development How-To](https://vrm-addon-for-blender.info/en/development?locale_redirection)** | |
| <a href="https://vrm-addon-for-blender.info/en/animation?locale_redirection"><img width="200" src="https://vrm-addon-for-blender.info/images/animation.gif"></a> | <a href="https://vrm-addon-for-blender.info/en/development?locale_redirection"><img width="200" src="https://vrm-addon-for-blender.info/images/animation.gif"></a> | |

## Overview

Expand All @@ -29,7 +29,7 @@ This add-on adds VRM-related functions to Blender, such as importing and exporti

The source code for development is in the <a href="https://github.com/saturday06/VRM-Addon-for-Blender/tree/main">`main`</a> branch. Its <a href="https://github.com/saturday06/VRM-Addon-for-Blender/tree/main/src/io_scene_vrm">`src/io_scene_vrm`</a> folder is a main body of the add-on. For efficient development, you can create a link to that folder in the Blender `addons` folder.

For more advanced development, such as running tests, please use [astral.sh/uv](https://docs.astral.sh/uv/).
For more advanced development, such as running tests, please use [astral.sh/uv](https://docs.astral.sh/uv/). See [the tutorial](https://vrm-addon-for-blender.info/en/development?locale_redirection) for more information.

```text
git checkout main
Expand Down Expand Up @@ -79,20 +79,20 @@ BlenderにVRM関連機能を追加するアドオンです。
| :---: | :---: | :---: |
| <a href="https://vrm-addon-for-blender.info/en/installation?locale_redirection"><img width="200" src="https://vrm-addon-for-blender.info/images/installation.gif"></a> | <a href="https://vrm-addon-for-blender.info/en/create-simple-vrm-from-scratch?locale_redirection"><img width="200" src="https://vrm-addon-for-blender.info/images/simple.gif"></a> | <a href="https://vrm-addon-for-blender.info/en/create-humanoid-vrm-from-scratch?locale_redirection"><img width="200" src="https://vrm-addon-for-blender.info/images/humanoid.gif"></a> |
| **[物理ベースのマテリアル設定](https://vrm-addon-for-blender.info/ja/material-pbr?locale_redirection)** | **[アニメ風のマテリアル設定](https://vrm-addon-for-blender.info/ja/material-mtoon?locale_redirection)** | **[Pythonスクリプトによる自動化](https://vrm-addon-for-blender.info/en/scripting-api?locale_redirection)** |
| <a href="https://vrm-addon-for-blender.info/en/material-pbr?locale_redirection"><img width="200" src="https://vrm-addon-for-blender.info/images/material_pbr.gif"></a> | <a href="https://vrm-addon-for-blender.info/en/material-mtoon?locale_redirection"><img width="200" src="https://vrm-addon-for-blender.info/images/material_mtoon.gif"></a> | <a href="https://vrm-addon-for-blender.info/en/scripting-api?locale_redirection"><img width="200" src="https://vrm-addon-for-blender.info/images/scripting_api.png"></a> |
| **[VRMアニメーション](https://vrm-addon-for-blender.info/en/animation?locale_redirection)** | | |
| <a href="https://vrm-addon-for-blender.info/en/animation?locale_redirection"><img width="200" src="https://vrm-addon-for-blender.info/images/animation.gif"></a> | | |
| <a href="https://vrm-addon-for-blender.info/en/material-pbr?locale_redirection"><img width="200" src="https://vrm-addon-for-blender.info/images/material_pbr.gif"></a> | <a href="https://vrm-addon-for-blender.info/en/material-mtoon?locale_redirection"><img width="200" src="https://vrm-addon-for-blender.info/images/material_mtoon.gif"></a> | <a href="https://vrm-addon-for-blender.info/en/scripting-api?locale_redirection"><img width="200" src="https://vrm-addon-for-blender.info/images/scripting_api.gif"></a> |
| **[VRMアニメーション](https://vrm-addon-for-blender.info/en/animation?locale_redirection)** | **[改造するには?](https://vrm-addon-for-blender.info/en/development?locale_redirection)** | |
| <a href="https://vrm-addon-for-blender.info/en/animation?locale_redirection"><img width="200" src="https://vrm-addon-for-blender.info/images/animation.gif"></a> | <a href="https://vrm-addon-for-blender.info/en/development?locale_redirection"><img width="200" src="https://vrm-addon-for-blender.info/images/animation.gif"></a> | |

## 概要

BlenderにVRMのインポートやエクスポート、VRM Humanoidの追加やMToonシェーダーの設定などのVRM関連機能を追加するアドオンです。バグ報告、機能要望、Pull Request等歓迎します。[バージョン 0.79](https://github.com/iCyP/VRM_IMPORTER_for_Blender2_8/releases/tag/0.79)以降の開発を作者である[@iCyP](https://github.com/iCyP)さんから引き継ぎました。

## 開発するには
## 改造するには

開発用のソースコードは<a href="https://github.com/saturday06/VRM-Addon-for-Blender/tree/main">`main`</a>ブランチにあります。ブランチ内の <a href="https://github.com/saturday06/VRM-Addon-for-Blender/tree/main/src/io_scene_vrm">`src/io_scene_vrm`</a> フォルダがアドオン本体です。
開発用のソースコードは <a href="https://github.com/saturday06/VRM-Addon-for-Blender/tree/main">`main`</a>ブランチにあります。ブランチ内の <a href="https://github.com/saturday06/VRM-Addon-for-Blender/tree/main/src/io_scene_vrm">`src/io_scene_vrm`</a> フォルダがアドオン本体です。
そのフォルダへのリンクをBlenderの `addons` フォルダ内に作ることで効率的に開発をすることができます。

テストの実行など、より高度な開発をする場合は[astral.sh/uv](https://docs.astral.sh/uv/)をご利用ください。
テストの実行など、より高度な開発をする場合は[astral.sh/uv](https://docs.astral.sh/uv/)をご利用ください。詳しい情報は[チュートリアル](https://vrm-addon-for-blender.info/en/development?locale_redirection)にあります。

```text
git checkout main
Expand Down
8 changes: 4 additions & 4 deletions docs/website/content/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ For Blender 2.93 to 4.1: **[Download Latest Version {{< release_utc >}}](https:/

| [Installation]({{< ref "installation" >}}) | [Create Simple VRM]({{< ref "create-simple-vrm-from-scratch" >}}) | [Create Humanoid VRM]({{< ref "create-humanoid-vrm-from-scratch" >}}) |
| --- | --- | --- |
| [![](installation.png)]({{< ref "installation" >}}) | [![](simple.gif)]({{< ref "create-simple-vrm-from-scratch" >}}) | [![](humanoid.gif)]({{< ref "create-humanoid-vrm-from-scratch" >}}) |
| [![](installation.gif)]({{< ref "installation" >}}) | [![](simple.gif)]({{< ref "create-simple-vrm-from-scratch" >}}) | [![](humanoid.gif)]({{< ref "create-humanoid-vrm-from-scratch" >}}) |
| | | |
| [Create Physics Based Material]({{< ref "material-pbr" >}}) | [Create Anime Style Material]({{< ref "material-mtoon" >}}) | [Automation with Python scripts]({{< ref "scripting-api" >}}) |
| [![](material_pbr.gif)]({{< ref "material-pbr" >}}) | [![](material_mtoon.gif)]({{< ref "material-mtoon" >}}) | [![](scripting_api.png)]({{< ref "scripting-api" >}}) |
| [VRM Animation]({{< ref "animation" >}}) | | |
| [![](animation.gif)]({{< ref "animation" >}}) | | |
| [![](material_pbr.gif)]({{< ref "material-pbr" >}}) | [![](material_mtoon.gif)]({{< ref "material-mtoon" >}}) | [![](scripting_api.gif)]({{< ref "scripting-api" >}}) |
| [VRM Animation]({{< ref "animation" >}}) | [Development How-To]({{< ref "development" >}}) | |
| [![](animation.gif)]({{< ref "animation" >}}) | [![](animation.gif)]({{< ref "development" >}}) | |

## Overview

Expand Down
4 changes: 2 additions & 2 deletions docs/website/content/_index.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Blender 2.93から4.1をお使いの場合はこちら: **[最新版のダウン
| | | |
| [物理ベースのマテリアル設定]({{< ref "material-pbr" >}}) | [アニメ風のマテリアル設定]({{< ref "material-mtoon" >}}) | [Pythonスクリプトによる自動化]({{< ref "scripting-api" >}}) |
| [![](material_pbr.gif)]({{< ref "material-pbr" >}}) | [![](material_mtoon.gif)]({{< ref "material-mtoon" >}}) | [![](scripting_api.png)]({{< ref "scripting-api" >}}) |
| [VRMアニメーション]({{< ref "animation" >}}) | | |
| [![](animation.gif)]({{< ref "animation" >}}) | | |
| [VRMアニメーション]({{< ref "animation" >}}) | [改造するには]({{< ref "development" >}}) | |
| [![](animation.gif)]({{< ref "animation" >}}) | [![](animation.gif)]({{< ref "development" >}}) | |

## 概要

Expand Down
85 changes: 85 additions & 0 deletions docs/website/content/development/_index.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
title: "Development How-To"
---

The repository contains code formatting settings, code type checking settings, and software testing settings.

These are strongly dependent on the tool [astral-sh/uv](https://docs.astral.sh/uv/), so you will need to install that first.
Alternatively, you can use Visual Studio Code's devcontainer to set them up automatically.

## Link the repository to the add-on folder

The source code for development is in the [main](https://github.com/saturday06/VRM-Addon-for-Blender/tree/main) branch. Its [src/io_scene_vrm](https://github.com/saturday06/VRM-Addon-for-Blender/tree/main/src/io_scene_vrm) folder is a main body of the add-on. For efficient development, you can create a link to that folder in the Blender `addons` folder.

```text
# Repository setup
git checkout main
git submodule update --init
# Blender 4.2 or later
# Linux
ln -s "$PWD/src/io_scene_vrm" "$HOME/.config/blender/BLENDER_VERSION/extensions/user_default/vrm"
# macOS
ln -s "$PWD/src/io_scene_vrm" "$HOME/Library/Application Support/Blender/BLENDER_VERSION/extensions/user_default/vrm"
# Windows PowerShell
New-Item -ItemType Junction -Path "$Env:APPDATA\Blender Foundation\Blender\BLENDER_VERSION\extensions\user_default\vrm" -Value "$(Get-Location)\src\io_scene_vrm"
# Windows Command Prompt
mklink /j "%APPDATA%\Blender Foundation\Blender\BLENDER_VERSION\extensions\user_default\vrm" src\io_scene_vrm
# Blender 4.1.1 or earlier
# Linux
ln -s "$PWD/src/io_scene_vrm" "$HOME/.config/blender/BLENDER_VERSION/scripts/addons/io_scene_vrm"
# macOS
ln -s "$PWD/src/io_scene_vrm" "$HOME/Library/Application Support/Blender/BLENDER_VERSION/scripts/addons/io_scene_vrm"
# Windows PowerShell
New-Item -ItemType Junction -Path "$Env:APPDATA\Blender Foundation\Blender\BLENDER_VERSION\scripts\addons\io_scene_vrm" -Value "$(Get-Location)\src\io_scene_vrm"
# Windows Command Prompt
mklink /j "%APPDATA%\Blender Foundation\Blender\BLENDER_VERSION\scripts\addons\io_scene_vrm" src\io_scene_vrm
```

## To run the code format, follow these steps.

1. install [astral-sh/uv](https://docs.astral.sh/uv/).
2. double-click `tools\format.bat` in the repository to run it.

## To run the code format in Visual Studio Code, follow these steps.

1. install [astral-sh/uv](https://docs.astral.sh/uv/).
2. in the Visual Studio Code terminal, run the `uv sync` command.
3. run Visual Studio Code's `Format Document`.

The same result can be achieved by using the `Ruff` extension of Visual Studio Code.

## To run the code type check, follow these steps.

1. install [astral-sh/uv](https://docs.astral.sh/uv/).
2. double-click `tools\lint.bat` in the repository and run it.

## To run the type checking of the code in Visual Studio Code, follow these steps.

1. install [astral-sh/uv](https://docs.astral.sh/uv/).
2. in the Visual Studio Code terminal, run the `uv sync` command.
3. install `Ruff`, `Mypy Type Checker` and `Pylance` extensions in Visual Studio Code.
4. open the py file you want to type check.

## To run the software test of the code, follow these steps.

1. install [astral-sh/uv](https://docs.astral.sh/uv/).
2. in your terminal, run the command `git submodule update --init --recursive`.
3. double-click `tools\test.bat` in the repository and run it.
10. if you get the error `Blender not found`, set the environment variable `BLENDER_VRM_TEST_BLENDER_PATH` to the path of the Blender 4.2 or 3.6 or 3.3 or 2.93 exe file.

## To run the software test of the code in Visual Studio Code, follow these steps.

1. install [astral-sh/uv](https://docs.astral.sh/uv/).
2. in the Visual Studio Code terminal, run the `uv sync` command.
3. in the Visual Studio Code terminal, run the command `git submodule update --init --recursive`.
4. select `Testing` from the left icon in Visual Studio Code
5. select `Configure Python Tests.
6. select `unittests` as the test library.
7. select `Root Directory` as test folder.
8. select `test_*` as test file pattern.
9. press `Run Tests`
10. if you get the error `Blender not found`, set the environment variable `BLENDER_VRM_TEST_BLENDER_PATH` to the path of the Blender 4.2 or 3.6 or 3.3 or 2.93 exe file.
85 changes: 85 additions & 0 deletions docs/website/content/development/_index.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
title: "開発環境のセットアップ"
---

このリポジトリには、コードフォーマット設定、型チェック設定、ソフトウェアテスト設定が含まれています。

これらは [astral-sh/uv](https://docs.astral.sh/uv/) に強く依存しているので、まずそれをインストールする必要があります。あるいは、Visual Studio Codeのdevcontainerを使って全自動で設定することもできます。

## Blenderのアドオンフォルダにレポジトリにリンクする。

開発用のソースコードは [main](https://github.com/saturday06/VRM-Addon-for-Blender/tree/main) ブランチにあります。ブランチ内の [src/io_scene_vrm](https://github.com/saturday06/VRM-Addon-for-Blender/tree/main/src/io_scene_vrm) フォルダがアドオン本体です。
そのフォルダへのリンクをBlenderの `addons` フォルダ内に作ることで効率的に開発をすることができます。

```text
# レポジトリのセットアップ
git checkout main
git submodule update --init
# Blender 4.2以上の場合
# Linux
ln -s "$PWD/src/io_scene_vrm" "$HOME/.config/blender/BLENDER_VERSION/extensions/user_default/vrm"
# macOS
ln -s "$PWD/src/io_scene_vrm" "$HOME/Library/Application Support/Blender/BLENDER_VERSION/extensions/user_default/vrm"
# Windows PowerShell
New-Item -ItemType Junction -Path "$Env:APPDATA\Blender Foundation\Blender\BLENDER_VERSION\extensions\user_default\vrm" -Value "$(Get-Location)\src\io_scene_vrm"
# Windows Command Prompt
mklink /j "%APPDATA%\Blender Foundation\Blender\BLENDER_VERSION\extensions\user_default\vrm" src\io_scene_vrm
# Blender 4.2未満の場合
# Linux
ln -s "$PWD/src/io_scene_vrm" "$HOME/.config/blender/BLENDER_VERSION/scripts/addons/io_scene_vrm"
# macOS
ln -s "$PWD/src/io_scene_vrm" "$HOME/Library/Application Support/Blender/BLENDER_VERSION/scripts/addons/io_scene_vrm"
# Windows PowerShell
New-Item -ItemType Junction -Path "$Env:APPDATA\Blender Foundation\Blender\BLENDER_VERSION\scripts\addons\io_scene_vrm" -Value "$(Get-Location)\src\io_scene_vrm"
# Windows Command Prompt
mklink /j "%APPDATA%\Blender Foundation\Blender\BLENDER_VERSION\scripts\addons\io_scene_vrm" src\io_scene_vrm
```

## コードフォーマットの実行方法

1. [astral-sh/uv](https://docs.astral.sh/uv/) をインストールする。
2. リポジトリの `tools\format.bat` をダブルクリックして実行する。

## Visual Studio Codeでのコードフォーマットの実行方法

1. [astral-sh/uv](https://docs.astral.sh/uv/) をインストールする。
2. Visual Studio Code のターミナルで `uv sync` コマンドを実行する。
3. Visual Studio Code の `Format Document` を実行する。

Visual Studio Code の `Ruff` 拡張機能を使っても同じ結果が得られる。

## 型チェックの実行方法

1. [astral-sh/uv](https://docs.astral.sh/uv/) をインストールする。
2. リポジトリの `tools\lint.bat` をダブルクリックして実行する。

## Visual Studio Codeでの型チェックの実行方法

1. [astral-sh/uv](https://docs.astral.sh/uv/) をインストールする。
2. Visual Studio Code のターミナルで `uv sync` コマンドを実行する。
3. Visual Studio Code に `Ruff``Mypy Type Checker``Pylance` 拡張をインストールする。
4. タイプチェックをしたい py ファイルを開く。

## ソフトウェアテストの実行方法

1. [astral-sh/uv](https://docs.astral.sh/uv/) をインストールする。
2. ターミナルで `git submodule update --init --recursive` コマンドを実行する。
3. リポジトリの `tools\test.bat` をダブルクリックして実行する。
4. Blenderが見つからないという趣旨のエラーが表示されたら、環境変数 `BLENDER_VRM_TEST_BLENDER_PATH` に Blender 4.2 または 3.6 または 3.3 または 2.93 の exe ファイルのパスを設定する。

## Visual Studio Codeでのソフトウェアテストを実行方法

1. [astral-sh/uv](https://docs.astral.sh/uv/) をインストールする。
2. Visual Studio Code のターミナルで `uv sync` コマンドを実行する。
3. Visual Studio Code のターミナルで、`git submodule update --init --recursive` コマンドを実行する。
4. Visual Studio Code の左のアイコンから `Testing` を選択する。
5. `Configure Python Tests` を選択する。
6. テストライブラリとして `unittests` を選択する。
7. テストフォルダとして `Root Directory` を選択する。
8. テストファイルパターンとして `test_*` を選択する。
9. `Run Tests` を押す。
10. `Blender not found` というエラーが表示されたら、環境変数 `BLENDER_VRM_TEST_BLENDER_PATH` に Blender 4.2 または 3.6 または 3.3 または 2.93 の exe ファイルのパスを設定する。

0 comments on commit 3bf9f08

Please sign in to comment.