0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Blender 4.2 からのアドオン作成方法

Posted at

Blender 4.2 からアドオン作成方法が変更されました。
管理方法がエクステンションに変更されたので
ざっくりと全体の流れを書き起こしました。

下記のサイトを参考に書き出しています。
How to Create Extensions

検証環境

Tool バージョン
Mac Sequoia (15.1.1)
Blender 4.2

必要なファイル

アドオンのパッケージを作成するために2つのファイルが必要

1. __init__.py
アドオン本体を記述するファイル
ここに必要な機能を記載する

2. blender_manifest.toml
4.2 から加わった設定ファイル
公式にテンプレートが用意されているので、必要箇所を変更する
公式サイト:blender_manifest.toml

パッケージ生成

作成した2つのファイルがあるディレクトリで下記のコマンドを実行
blender_manifest.toml ファイル情報を元に Zip ファイルが作成される
Zip ファイル名のデフォルトは toml ファイルで指定した id と version の値で付けられる

blender --command extension build
作成例

公式からファイルを入手
addon_add_object.py
blender_manifest.toml

addon_add_object.py__init__.py にリネーム

ターミナルからファイルがあるディレクトリに移動

コマンドを実行

blender --command extension build

実行したディレクトリ内にmy_example_extension-1.0.0.zipが作成される

blender へのエイリアスを設定しておくと便利
Mac の場合下記のディレクトリにインストールされている
/Applications/blender.app/Contents/MacOS/blender

追加のオプションの説明は下記を参照
Subcommand: build options

Blender へのインストール

メニューの 編集 > プリファレンス を選択

スクリーンショット 2024-12-02 17.51.44.png

Blender プリファレンスの エクステンションを入手 > (上段右端) を選択
ディスクからインストール を選択
スクリーンショット 2024-12-02 18.00.35.png

パッケージ生成で作成した Zip ファイルを選択しディスクからインストールを実行
スクリーンショット 2024-12-02 18.08.05_edit.png

インストールが完了するとインストール済みリストに追加される
スクリーンショット 2024-12-02 18.25.05.png

アドオンの左にある を選択すると toml ファイルで設定した情報を確認できます。
パスはアドオンがインストールされている場所を示しています。
スクリーンショット 2024-12-02 18.26.51_edit.png

アドオンがインストールされるディレクトリ
/Users/<ユーザ名>/Library/Application Support/Blender/<Blenderのバージョン>/extensions

アインインストール

アンインストールしたいアドオンの右にある を選択
アンインストールを実行
スクリーンショット 2024-12-02 18.36.55.png

4.1 以前からの違い

公式サイトに情報がまとめられています。
import の仕方、ディレクトリ名の変更など
移行に関する重要な情報が載っているので確認が必要です。

Legacy vs Extension Add-ons

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?