Godot Private Asset Libraryで自作ライブラリをAssetLib経由で利用する
記述日:2025年4月1日
お題:Godot AssetLibをプライベートで使いたい
とりあえずサーバーが動作する所まで確認できた
作者に感謝
実際に使用するライブラリの作成はまた今度
・参考
https://spielmannspiel.com/blog/transitioning_from_unity_to_godot
https://github.com/SpielmannSpiel/Godot-Private-Asset-Library#Locally
・環境構築
$ git clone https://github.com/SpielmannSpiel/Godot-Private-Asset-Library.git
$ cd Godot-Private-Asset-Library
$ python -m venv .venv
$ source .venv/bin/activate
$ pip install -r requirements.txt
・サーバー実行
$ uvicorn main:app --port 8080
アドオンの開発時はリロードオプションを付けると最新を配信してくれると思う
$ uvicorn main:app --port 8080 --reload
自動実行させたければDockerにした方が良いか?
・Godot Editorからアクセス
[エディタ設定][一般][アセットライブラリ][有効なURL]に要素を追加する
新規キー(String):Local Asset Library
新規の値(String): http://127.0.0.1:8080/api
・アセットの登録
規則に従ってプロジェクトを作成する
https://docs.godotengine.org/ja/4.x/community/asset_library/submitting_to_assetlib.html
プロジェクトをGodot-Private-Asset-Library/godot_assetsに配置する
プロジェクト内でres://addons/プロジェクト名のフォルダを作成しそこに配布物を置く
最低限これだけで配布可能
アイコンはres://icon.svgを置き換える
拡張子は ".png", ".jpg", ".jpeg", ".gif", ".webp", ".svg"
[プロジェクト設定][一般][アプリケーション][構成]
説明:
バージョン:
・問題点※解決済
addon配布時に不要なファイル群の除外設定が判らない
プロジェクト設定ファイルが上書きされるのでこのままでは使えない
zip作成処理を見る限りでは配布サーバーでは除外処理を行っていない
対応
zip作成はgit archiveを利用しているらしくリポジトリとして機能する様にすれば
.gitattributeの設定に従ってファイルがzip化される
$ git init
$ git add .
$ git commit -m "first commit"
.gitattributeに以下を追加
# Only include the addons folder when downloading from the Asset Library.
/** export-ignore
/addons !export-ignore
/addons/** !export-ignore
--
コメント
コメントを投稿