Blender 5.2 LTS のインストール(ソースコードを使用)(Windows 上)
【概要】
Windows 上で、Visual Studio・Git・CMake を用いて、Blender をソースコードからビルド・インストールする手順を説明する。バージョンは Blender 5.2 LTS を対象とする。手順は、Git による Blender 5.2 LTS ブランチのソースコードのクローン、make update によるライブラリの取得、make によるビルド、および Blender の起動確認である。あわせて、Blender を Python モジュール(bpy)としてビルドする手順も示す。公式の手順に従う。
Blender は、3次元コンピュータグラフィックス・アニメーションソフトウェアである。3次元モデルの編集、レンダリング、光源やカメラ等を設定しての3次元コンピュータグラフィックス・アニメーション作成機能がある。ファイル形式は、Stanford Triangle Format(ply)、Wavefront OBJ(obj)、STL(stl)、glTF(glb, gltf)などに対応する。Windows 版、Linux 版、macOS 版がある。
Blender のインストールには複数の方法がある。最新版を検証したい、開発に貢献したいなどの場合は、ソースコードからビルドする(このページで説明する)。通常の利用では、公式サイトの安定版をインストールする方が簡単である(下の「サイト内の関連情報」を参照)。
【目次】
【関連する外部ページ】
- Blender をソースコードからビルドする公式手順(Windows): https://developer.blender.org/docs/handbook/building_blender/windows/
- ビルドオプションとターゲットの公式解説: https://developer.blender.org/docs/handbook/building_blender/options/
- Blender を Python モジュールとしてビルドする公式手順: https://developer.blender.org/docs/handbook/building_blender/python_module/
【サイト内の関連情報】
前準備
Build Tools for Visual Studio 2026(ビルドツール)のインストール
Build Tools for Visual Studio 2026(ビルドツール)のインストールを行い、C/C++ コードのビルド環境を整える。
Build Tools for Visual Studio は,Visual Studio の IDE を含まない C/C++ コンパイラ,ライブラリ,ビルドツール等のコマンドライン向け開発ツールセットである。インストール済みの場合,この手順は不要である。 以下のコマンドは、Build Tools が未インストールの場合は winget で新規インストールし、インストール済みの場合は 【インストールコマンドの実行方法】 管理者権限でコマンドプロンプトを起動する(手順:Windows キーまたはスタートメニュー → 上記のコマンドでは、Build Tools 本体と Visual C++ 再頒布可能パッケージをインストールし、続いて以下のコンポーネントを追加している。 上記以外の追加のコンポーネントが必要になった場合は Visual Studio Installer で個別にインストールできる。 インストール完了の確認 Visual Studio を必要とするとき Visual Studio の機能を必要とする場合は,追加インストールできる。[Build Tools for Visual Studio 2026(ビルドツール)のインストール手順を見るには、ここをクリック]
Windows での Build Tools for Visual Studio 2026 のインストール
setup.exe modify でコンポーネントを追加する(バージョンは変更しない)。cmd と入力 → 右クリック → 「管理者として実行」)。そして、コマンド全体をコマンドプロンプトにコピー&ペーストする。REM VC++ ランタイム
winget install --scope machine --id Microsoft.VCRedist.2015+.x64 -e --silent --disable-interactivity --force --accept-source-agreements --accept-package-agreements --override "/quiet /norestart"
REM ============================================================
REM Visual Studio Build Tools + Desktop development with C++
REM (VCTools、MSBuildTools、CMake連携、Clang、Windows 11 SDK)
REM ============================================================
REM 進行中のインストーラーを停止(ロック競合回避)
taskkill /F /IM vs_setup.exe /T >nul 2>&1
taskkill /F /IM vs_installer.exe /T >nul 2>&1
taskkill /F /IM vs_installerservice.exe /T >nul 2>&1
REM 未インストール時: winget で新規インストール
REM インストール済み時: setup.exe modify でコンポーネント追加(バージョンは変更しない)
winget list --id Microsoft.VisualStudio.BuildTools 2>nul | findstr /i "BuildTools" >nul 2>&1
if %ERRORLEVEL% EQU 0 (
for /f "usebackq delims=" %P in (`"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -products Microsoft.VisualStudio.Product.BuildTools -property installationPath`) do start /wait "" "C:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe" modify --installPath "%P" --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Workload.MSBuildTools --add Microsoft.VisualStudio.Component.VC.CMake.Project --add Microsoft.VisualStudio.Component.VC.Llvm.Clang --add Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset --add Microsoft.VisualStudio.Component.Windows11SDK.26100 --includeRecommended --quiet --norestart --nocache
) else (
winget install --scope machine --id Microsoft.VisualStudio.BuildTools -e --silent --disable-interactivity --force --accept-source-agreements --accept-package-agreements --override "--quiet --wait --norestart --nocache --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --add Microsoft.VisualStudio.Workload.MSBuildTools --add Microsoft.VisualStudio.Component.VC.CMake.Project --add Microsoft.VisualStudio.Component.VC.Llvm.Clang --add Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset --add Microsoft.VisualStudio.Component.Windows11SDK.26100"
)
REM 破損時の修復(任意、動作がおかしくなった場合)
REM "C:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe" repair --installPath "C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools" --quiet --norestart
REM 導入確認(インストールパスが表示されれば正常)
"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -products * -requires Microsoft.VisualStudio.Workload.VCTools -property installationPath
--includeRecommended により、MSVC コンパイラ、C++ AddressSanitizer、vcpkg、CMake ツール、Windows 11 SDK 等の推奨コンポーネントが含まれる)winget list Microsoft.VisualStudio.BuildTools
Git のインストール
Git for Windows をインストールする。インストーラでは、Git を PATH に追加する設定を選ぶ。これは、後の make update を正しく動作させるために必要である。
管理者権限でコマンドプロンプトを起動する
(手順:Windowsキーまたはスタートメニュー → cmd と入力 → 右クリック → 「管理者として実行」)。
winget install --scope machine --id Git.Git -e --silent --disable-interactivity --force --accept-source-agreements --accept-package-agreements --override "/VERYSILENT /NORESTART /NOCANCEL /SP- /CLOSEAPPLICATIONS /RESTARTAPPLICATIONS /COMPONENTS=""icons,ext\reg\shellhere,assoc,assoc_sh"" /o:PathOption=Cmd /o:CRLFOption=CRLFCommitAsIs /o:BashTerminalOption=MinTTY /o:DefaultBranchOption=main /o:EditorOption=VIM /o:SSHOption=OpenSSH /o:UseCredentialManager=Enabled /o:PerformanceTweaksFSCache=Enabled /o:EnableSymlinks=Disabled /o:EnableFSMonitor=Disabled"
Git LFS のインストール
管理者権限でコマンドプロンプトを起動する
(手順:Windowsキーまたはスタートメニュー → cmd と入力 → 右クリック → 「管理者として実行」)。
winget install --id GitHub.GitLFS
CMake のインストール
CMake をインストールする。インストーラでは、システムの PATH に追加する設定「Add CMake to the system PATH for all users」を選ぶ。
管理者権限でコマンドプロンプトを起動する
(手順:Windowsキーまたはスタートメニュー → cmd と入力 → 右クリック → 「管理者として実行」)。
winget install --scope machine --id Kitware.CMake -e --silent --disable-interactivity --force --accept-source-agreements --accept-package-agreements --override "/qn /norestart ADD_CMAKE_TO_PATH=System"
Blender のインストール(ソースコードからビルド)
以下の操作は、コマンドプロンプト(cmd.exe)で実行する。(手順:Windowsキーまたはスタートメニュー → cmd と入力 →「コマンドプロンプト」を選択)。ソースコードを置くフォルダには、空白を含まないパスを使う。ここでは C:\blender-git を使う。本資料では、Blender の長期サポート版(LTS)である Blender 5.2 LTS を対象とするため、クローン後にその安定化ブランチ(blender-v5.2-release)へ切り替える。
- Blender のソースコードのダウンロードと対象バージョンへの切り替え
rmdir /s /q C:\blender-git mkdir C:\blender-git cd /d C:\blender-git git clone https://projects.blender.org/blender/blender.git cd blender git checkout blender-v5.2-release - 終了の確認
- ヘルプの表示(make.bat help)
cd /d C:\blender-git\blender make.bat help
- ライブラリのダウンロード(make.bat update)
ビルドに必要なライブラリを取得する。ライブラリは数ギガバイトあり、ダウンロードに時間がかかる。
cd /d C:\blender-git\blender make.bat update - 終了の確認
- ソースコードからのビルド
ビルドを実行する。終了まで時間がかかるので、しばらく待つ。
cd /d C:\blender-git rmdir /s /q build mkdir build cmake -S blender -B build -C blender\build_files\cmake\config\bpy_module.cmake -G "Visual Studio 18 2026" -A x64 cmake --build build --config Release --target INSTALL - 終了の確認
- 確認のため、生成された Blender を起動する。パスはビルド結果のメッセージで表示されたものに読み替える。
C:\blender-git\build\bin\Release\blender.exe - 最新の変更への更新
後日、blender-v5.2-release ブランチの最新の状態に更新してビルドし直すときは、ソースとライブラリを更新した後に cmake --build を再実行します。
cd /d C:\blender-git\blender git pull python build_files\build_environment\sys_project.py update cd /d C:\blender-git\build_windows cd /d C:\blender-git\blender make update make cmake --build . --config Release --target INSTALL -- /m