When Blender starts, all active add-ons are loaded sequentially, one after the other. Which add-on will be loaded first is determined by its order in the “bpy.context.preferences.addons” list.
This list is stored in the user preferences file “userpref.blend”, which is stored in the system user’s directory:
1 |
.../_USER_/AppData/Roaming/Blender Foundation/Blender/3.4/config/userpref.blend |
We can see the list of active add-ons by walking through the list of “bpy.context.preferences.addons”:
1 2 3 4 5 6 7 8 9 10 |
for addon in bpy.context.preferences.addons: print(addon) # <bpy_struct, Addon("io_anim_bvh") at 0x000001F2285130A8> io_anim_bvh # <bpy_struct, Addon("io_curve_svg") at 0x000001F228513048> io_curve_svg # <bpy_struct, Addon("io_mesh_ply") at 0x000001F228512FE8> io_mesh_ply # ... # <bpy_struct, Addon("node_wrangler") at 0x000001F228512C88> node_wrangler # <bpy_struct, Addon("print_to_py_console") at 0x000001F228512BC8> print_to_py_console # <bpy_struct, Addon("area_switcher") at 0x000001F228512B68> area_switcher |
Add-ons are loaded when Blender starts in the order of this list.
Each time an add-on is activated, the pointer to it is moved to the end of the list.
This can be easily verified by deactivating – reactivating the add-on, for example the “Node Wrangler”, which in the example above placed in the third from the bottom in the list.
Ate now once again print the list of add-ons:
1 2 3 4 5 6 7 8 |
for addon in bpy.context.preferences.addons: print(addon, addon.module) # <bpy_struct, Addon("io_anim_bvh") at 0x000001F2285130A8> io_anim_bvh ... # <bpy_struct, Addon("print_to_py_console") at 0x000001F228512BC8> print_to_py_console # <bpy_struct, Addon("area_switcher") at 0x000001F228512B68> area_switcher # <bpy_struct, Addon("node_wrangler") at 0x000001F22856B528> node_wrangler |
As we can see, the “Node Wrangler” add-on is last in the list now.
If the user saves the settings by pressing the “Save Preferences” button (or automatically, if the checkbox is active in the settings) now, this add-on will be loaded last on all next Blender starts.