For different work directions in Blender, separate startup configurations are organized – sets of basic settings for scene parameters, rendering and user interface. Each configuration is stored in a separate file and is loaded from it when the user opens Blender or executes the “File – New” command from the main menu.
The initial (factory) startup files are stored in the Blender installation directory in the “bl_app_templates_system” folder:
1 |
_BLENDER_INSTALL_DIRECTORY_\4.0\scripts\startup\bl_app_templates_system\ |
Each subdirectory contains a startup file and an initializing script for a specific work process: 2D animation, add-on development, VFX, or video editing.
If necessary, creating your own startup file is very simple – you need to create a subdirectory in this directory with the desired name, for example “MyConfig” and copy there the .blend file in which your settings will be saved. After restarting Blender, a new item will appear in the “File – New” menu.
If the user makes changes to the startup file and saves it with the “File – Defaults – Save Startup File” command in the main menu, the user startup file is saved in the directory with the user data, also each in its own subdirectory:
1 |
c:\Users\_USER_NAME_\AppData\Roaming\Blender Foundation\Blender\4.0\config\ |
When starting Blender, user startup files take precedence over default ones.
You can access a set of startup files through the Blender Python API using the “app_template_paths()” function, which returns the “app_template_paths” generator.
1 2 3 |
bpy.utils.app_template_paths() # <generator object app_template_paths at 0x000001BE34BC4040> |
By iterating the elements of the generator, we can get a pointer to the “bl_app_templates_system” directory, in which startup files are physically located.
1 2 3 |
list(bpy.utils.app_template_paths()) # ['C:\\Program Files\\blender40\\4.0\\scripts\\startup\\bl_app_templates_system'] |
Walking through this directory and its subdirectories in search of the “startup.blend” files, we will get the paths to all existing startup files.
1 2 3 4 5 6 7 8 9 |
from pathlib import Path generator = Path(next(bpy.utils.app_template_paths())).rglob('startup.blend') for startup_file in generator: print(startup_file) # C:\Program Files\blender40\4.0\scripts\startup\bl_app_templates_system\2D_Animation\startup.blend # ... |
Having received the full path to the startup file, we can, for example, load the necessary parameters and settings from it, or perform any other actions with it.