← All ideas
  • Published 2 Sep 2024

BLENDER_SYSTEM_SCRIPTS support multiple search paths

Support a list of search paths separated by the os path separator for BLENDER_SYSTEM_SCRIPTS. Blender will just process that list in order.

Background

The BLENDER_SYSTEM_SCRIPTS variable was broken and got a fix recently.

The BLENDER_SYSTEM_SCRIPTS env variable can be set to a directory path before starting up Blender. Blender will execute startup scripts and load add-ons that are present in that folder hierarchy.

While this is great, the variable only supports a single directory path.

From a pipeline perspective you often want to separate add-ons and startup scripts on the filesystem logically by different categories.

  • studio
  • project
  • department
  • ....

Users can already add script directories manually in the preferences.

Requiring artists to manually add 5 different script directories before they can start to work leads to frustration and errors.

Adding and removing script directory items is also scriptable.

There are still limitations from a pipeline perspective:

  • modifying blender preferences needs to be done shortly delayed after startup, otherwise we get a bpy.context access error

  • blender would need to be re-launched to properly process the newly added script directory with startup scripts etc.

  • removing existing script directories is not possible before they are processed, meaning statup script etc. will still be executed before we can remove them

100%

Development Status: Open

Upvote 6 Downvote 0
pullpullson
2 Sep 2024

1 Comment

bradleymullennix

For similar/same need, had just added a feature request to support the/a PYTHONPATH environment variable.

Generally when we are developing pipeline scripts and modules, we will put them into a shared network path, and add those paths as needed to the artists environment variable PYTHONPATH. (all OSes). Generally, these paths then just show up in the sys.path list.