forked from saturday06/VRM-Addon-for-Blender
-
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
1 parent
70b6d42
commit 3bf9f08
Showing
5 changed files
with
186 additions
and
16 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
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 |
---|---|---|
@@ -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. |
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,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 ファイルのパスを設定する。 |