Support dynamic Extension Repository paths via BLENDER_SYSTEM_SCRIPTS
Hello!
Thanks to work from Sony Interactive Entertainment, we have received support for multiple paths in
BLENDER_SYSTEM_SCRIPTS
, which enabled us to read addons, startup scripts and other things automatically from multiple locations.
projects.blender.org/blender/blender/pulls/132812
This is highly needed in studio environments to support packaged application environments. There is some good discussion in here (with a great comment by Matt Ebb), which does a good job at explaining the reasons: devtalk.blender.org/t/blender-user-scripts-and-multiple-paths/10395/5
Unfortunately, extension repositories (and their paths) have to be explicitly added + managed and get saved in the preferences. This means that if one wants to gather extensions from a multitude of packages, one will need to both remove the previously added local repositories and add the now needed ones. This is unfortunately quite tricky and could be improved.
My proposal would be to add support for local extension repositories to be picked up automatically via subpaths in BLENDER_SYSTEM_SCRIPTS.
For example this path could be like the following:
{BLENDER_SYSTEM_SCRIPTS}
└── extensions
└── system
(with context of the other usual Blender folders)
{BLENDER_SYSTEM_SCRIPTS}
├── config
├── scripts
│ ├── startup
│ └── addons
└── extensions
└── system
In this case Blender could detect the
{BLENDER_SYSTEM_SCRIPTS}/extensions/system
path and automatically add it to the local repositories.
Personally, I don't have any strong opinion about the concrete path, but for studios it would be very much needed to get some help to dynamically manage extension repositories.
Thank you,
Manuel
3 Comments
Hey !
I totally agree with you it's very difficult to deploy Blender to production with environment manager like REZ.
I was reading your proposal, and I think it could be better if we don't add
extensionfolder to$BLENDER_SYSTEM_SCRIPTlayout directory which lead to confusion. However we can handle multiple extension repository path by making$BLENDER_SYSTEM_EXTENSIONSenvironment variable allowed to contains multiple folders.I think it will make the things clearer since extensions are only addon or theme and not scripts or application template.
What do you think about this ?
Hey!
Honestly that's even better. I was mostly taking inspiration from
HOUDINI_PATH, which has this sort of singular entry-point functionality. It can be nice to structure things this way as the directory layout of any package is self-explanatory due to it always being the same. Compared to individual env vars where one will need to look up the layout/design more carefully.sidefx.com/docs/houdini/basics/houdinipath.html
But yeah, having a distinct
BLENDER_SYSTEM_EXTENSIONSwould be even better and easier to handle for Blender's use case, I think.So I guess it could look like this instead:
Also just found this request, which is very much related: blender.community/c/rightclickselect/vZ8n/