将 Blender 资产库打包为拓展插件。代码使用 GPT-4o 编写。
理论上支持 Blender 3.0 之后的版本(因为 3.0 才有资产库),
测试在 3.6 和 4.2 都能正常使用,在 4.2 以上版本会自动识别为新版的拓展。
我的 Cashew Nodes 资产库 使用这个工具进行打包。
Package the Blender asset library as an extension. The code was written using GPT-4o.
Theoretically, it supports Blender versions after 3.0 (because 3.0 has an asset library).
It has been tested to work normally in 3.6 and 4.2. It will be automatically recognized as an extension in versions above 4.2.
My Cashew Nodes assets library uses this tool for packaging.
点击绿色的 Code 按钮或者从 Releases 下载项目 zip 文件。
Click the green Code button or download the project zip file from Releases.
Edit init.py
资产库目录名需要与资产库名称相同 The asset library directory name must be the same as the asset library name.
ASSET_LIBRARY_NAME = "YourAssetsName"
Edit init.py
bl_info = {
"name": "Your add-on name 拓展名称",
"version": (1, 0, 0),
"blender": (3, 0, 0),
"category": "Assets",
}
Edit blender_manifest.toml
schema_version = "1.0.0"
# Example of manifest file for a Blender extension
# Change the values according to your extension
id = "extension_id"
version = "1.0.0"
name = "extension name 拓展名称"
tagline = "extension describe"
maintainer = "Author 作者 <[email protected]>"
# Supported types: "add-on", "theme"
type = "add-on"
# # Optional: link to documentation, support, source files, etc
# website = "https://extensions.blender.org/add-ons/my-example-package/"
# # Optional: tag list defined by Blender and server, see:
# # https://docs.blender.org/manual/en/dev/advanced/extensions/tags.html
tags = ["Geometry Nodes", "Render"]
blender_version_min = "4.2.0"
将你的资产文件夹内容放入拓展目录下的 YourAssetsName
文件夹(第二步中输入的名称)
Place the contents of the assets folder into a folder called YourAssetsName
in the extension directory (the name you entered in step 2)
打包拓展目录并安装测试加载是否正常,确保最终目录结构如下所示。
Package the expansion directory and install it to test, Make sure the final directory structure looks like this.
my_extension-0.0.1.zip
├─ my_extension
├─ YourAssetsName
├─blender_assets.cats.txt
├─Assets.blend
├─ __init__.py
├─ blender_manifest.toml
└─ (...)