Open .blend file with the last saved version of the Blender.exe .
adapted from ファイルを作成したバージョンを判別してBlenderを起動するWindowsバッチファイル - yoitaro’s blog
.blend ファイルをダブルクリックで開くときに自動で Blender のバージョンを選ぶプログラムです。コア・コンセプトは上記ブログ記事のとおりです。
.blend ファイルには、最後に編集(保存)した Blender.exe のバージョン番号が書き込まれているので、その情報を利用しています。
.blend ファイルを右クリックしてメニューを開き
プログラムから開く
→ 別のプログラムを選択
アプリを選択して .blend ファイルを開く
のウィンドウで PCでアプリを選択する
から
実行ファイル open_blender_file.exe を選び、 常に使う
に設定する。
Windowsのバージョンが違うと細かい手順に違いがあると思います。
open_blender_file.exe に .blend ファイルをドロップするか、 前項の設定をしたうえで .blend ファイルをダブルクリック等で開いてください。
- 設定ファイル(
%APPDATA%\open_blender_file\config.json
)に該当するバージョンがあればそれを開く - 設定ファイルに
default: "3.6"
のように設定されており、設定ファイルに該当バージョンがあり、ファイルの最終更新バージョンよりも新しければそれを開く C:\Program Files\Blender Foundation\Blender <version>\
を探して該当するバージョンの実行ファイルが見つかればそれを開く- 上記すべて該当しない場合、開かない。
{
"executable_map":{
// ショートカットでも可
"2.93": "C:\\Users\\John_Smith\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Blender\\Blender 2.93.lnk",
"3.4": "C:\\Program Files\\Blender Foundation\\Blender 3.4\\blender-launcher.exe",
"4.1": "C:\\Program Files\\Blender Foundation\\Blender 4.1\\blender-launcher.exe",
},
// "default": "4.1", のように書く
"default": null,
}
Usage: open_blender_file <FILE> [options] ["--" [extra args for blender.exe]]
Options:
--set-icon set icon (registry editing).
-h, --help print this help menu
-p, --print-version
print version and exit.
--dry-run print found blender executable and exit.
レジストリの値は正しく書けているように見えるので、何かでリフレッシュがかかったタイミングでアイコンが反映されます
- Blender 本体から .ico のリソースを持ってくるのはあまりやりたくない
- 管理者権限でレジストリの値を弄るよりもやりたくない
- windres-rs のクロスコンパイルがつらかった1