kitfox
September 6, 2024, 8:43am
1
I’m diving into Blender’s new extension system that is replacing addons, mostly because I need to use python wheels. Anyhow, I’d like to add a line to my make script that installs the extension after I’ve finished building it. I’m trying to figure out the right syntax to use. According to the docs, I think I need something like
blender --command extension install-file -r REPO --enable extension/kitfox_my_extension-1.0.0-windows_x64.zip
The problem is, I have no idea what the REPO is supposed to be and the documentation doesn’t provide any help. If you leave it out, it refuses to install. This is a just a zip file in a local directory that my script has just built - what should I put for the REPO?
https://docs.blender.org/manual/en/latest/advanced/command_line/extension_arguments.html#command-line-args-extensions
I’m not in front of my computer, so I may be wrong.
But I would run the repo-list
sub-command to see which repositories you have available, and pick the one you need.
Maybe the person who asked the question gave up, but I verified it instead.
First,
The value obtained by the repo-list command is
blender_org:
name: "extensions.blender.org"
directory: "C:\\Users\\<USER>\\AppData\\Roaming\\Blender Foundation\\Blender\\4.2\\extensions\\blender_org"
url: "https://extensions.blender.org/api/v1/extensions/"
user_default:
name: "User Default"
directory: "C:\\Users\\<USER>\\AppData\\Roaming\\Blender Foundation\\Blender\\4.2\\extensions\\user_default"
source: "USER"
system:
name: "System"
directory: "C:\\Program Files\\Blender Foundation\\Blender\\4.2\\extensions\\system"
source: "SYSTEM"
to be.
I had already added the repository on the Multiple Preferences screen,
It was not showing up.
I also tried repo-add and it added it but it did not show up in this repo-list .
On the other hand, when I ran the following code
import bpy
def check_repositories():
prefs = bpy.context.preferences
for repo in bpy.context.preferences.extensions.repos:
print(f"ID: {repo.module}")
print(f" Name: {repo.name}")
print(f" Path: {repo.directory}")
print(f" Remote: {repo.remote_url}")
print(f" Source: {repo.source}")
print(f" module: {repo.module}")
check_repositories()
You will receive the same response as in the Preferences screen(Blender UI) as shown below.
ID: blender_org
Name: extensions.blender.org
Path: C:\Users\<USER>\AppData\Roaming\Blender Foundation\Blender\4.4\extensions\blender_org
Remote: https://extensions.blender.org/api/v1/extensions/
Source: USER
module: blender_org
ID: user_default
Name: User Default
Path: C:\Users\<USER>\AppData\Roaming\Blender Foundation\Blender\4.4\extensions\user_default
Remote:
Source: USER
module: user_default
ID: system
Name: System
Path: C:\blender\stable\blender-4.4.0-stable.<BUILD_ID>\4.4\extensions\system
Remote:
Source: SYSTEM
module: system
ID: ksyn_repo
Name: ksyn_repo
Path: C:\Users\<USER>\AppData\Roaming\Blender Foundation\Blender\4.4\extensions\ksyn_repo
Remote: file:///D:/.../blender%20scrpt/.ksyn_repo/index.json
Source: USER
module: ksyn_repo
ID: ksyn_repo_001
Name: ksyn_repo.001
Path: C:\Users\<USER>\OneDrive\documents\aaa\
Remote:
Source: USER
module: ksyn_repo_001
Since the install-file in the command is “usable in the list output by the command”,
Probably a bug in repo-list and install.
Please check back when you are free.