In Blender version 4.1 and below, all add-ons were installed locally. To install the add-on, we have to download it to our computer, open the Preferences area, switch to the Add-ons tab and install the add-on by clicking on the Install button. Starting with version 4.2, extensions opened – add-ons published online became available for installation.
By default, access to online storage is disabled. In order to activate access, you need to click on the “Allow Online Access” button on the Get Extensions tab.
This operation can also be performed using the Blender Python API:
1 |
bpy.ops.extensions.userpref_allow_online() |
We can also open access to online storage simply by checking the “Allow Online Access” checkbox in the Blender settings on the System tab.
Or using API:
1 |
bpy.context.preferences.system.use_online_access = True |
We can check whether access to the online repository is allowed through this variable.
1 2 3 |
print(bpy.context.preferences.system.use_online_access) # True |
After online access to Blender is allowed, a list of extensions available for installation will be automatically generated on the Get Extensions tab.
Extensions in Blender can be installed from various repositories. The main one, of course, is the official Blender repository – extensions.blender.org.
We can get a list of all repositories with their urls:
1 2 3 4 5 6 |
for repo in bpy.context.preferences.extensions.repos: print(repo.name, repo.remote_url) # extensions.blender.org https://extensions.blender.org/api/v1/extensions/ # User Default # System |
The “User Default” and “System” repositories are local Blender repositories on your computer.
We can install an extension manually by clicking the Install button to the right of the name of the desired extension in the list of extensions.
To install an extension from a repository using Blender Python API, we need to know the repository index and extension id.
The id of the extension can be seen by hovering the mouse over its Install button (with developer hints enabled). For example, for the Icon Viewer extension, its id will be “icon_viewer”.
We can install the extension using the API by executing the following operator:
1 2 3 4 |
bpy.ops.extensions.package_install( repo_index=0, pkg_id="icon_viewer" ) |
The “repo_index” parameter is the repository index (0 is the official Blender repository) and “pkg_id” is the extension id.
After installation, the extension will move to the Add-ons tab and will be activated immediately.
It should also be noted that the local installation of add-ons, “as it was before,” has not gone away. To install the downloaded add-on, we need to click on the button with the “Add-ons Settings” arrow in the upper right corner and select “Install from Disk”.