1
$\begingroup$

I want to know which add-ons in Blender 2.79 are enabled by me.

$\endgroup$
  • $\begingroup$ Do you want to get the enabled add-ons, excluding those that are enabled by default, or all add-ons that are currently enabled? $\endgroup$ – Robert Gützkow Feb 9 at 17:14
  • $\begingroup$ @RobertGützkow Yes, excluding those add-ons enabled default . $\endgroup$ – Basara Kubikiri Feb 10 at 1:07
2
$\begingroup$

Blender's Python API allows to get the currently enabled add-ons, without any differentiation of what/who enabled them. Therefore it's not possible to distinguish between add-ons that have been enabled by default, by the user or by another add-on/script. You may however compare the currently active add-ons to the ones that are known to be enabled by default and only use those that are not it the default list.

Blender 2.79

The enabled add-ons can be access through the user preferences bpy.context.user_preferences.addons.

import bpy


for addon in bpy.context.user_preferences.addons:
    print(addon.module)

The add-ons that are enabled by default are:

io_scene_3ds
io_scene_fbx
io_anim_bvh
io_mesh_ply
io_scene_obj
io_scene_x3d
io_mesh_stl
io_mesh_uv_layout
io_curve_svg
cycles

Therefore a solution that excludes them could look like this:

import bpy


default_addons = {"io_scene_3ds",
                  "io_scene_fbx",
                  "io_anim_bvh",
                  "io_mesh_ply",
                  "io_scene_obj",
                  "io_scene_x3d",
                  "io_mesh_stl",
                  "io_mesh_uv_layout",
                  "io_curve_svg",
                  "cycles"}


for addon in bpy.context.user_preferences.addons:
    if addon.module not in default_addons:
        print(addon.module)

Blender 2.8x

The enabled add-ons can be access through the preferences bpy.context.preferences.addons.

import bpy


for addon in bpy.context.preferences.addons:
    print(addon.module)

The add-ons that are enabled by default are:

io_anim_bvh
io_curve_svg
io_mesh_ply
io_mesh_stl
io_mesh_uv_layout
io_scene_fbx
io_scene_gltf2
io_scene_obj
io_scene_x3d
cycles

Therefore a solution that excludes them could look like this:

import bpy


default_addons = {"io_anim_bvh",
                  "io_curve_svg",
                  "io_mesh_ply",
                  "io_mesh_stl",
                  "io_mesh_uv_layout",
                  "io_scene_fbx",
                  "io_scene_gltf2",
                  "io_scene_obj",
                  "io_scene_x3d",
                  "cycles"}


for addon in bpy.context.preferences.addons:
    if addon.module not in default_addons:
        print(addon.module)
|improve this answer|||||
$\endgroup$
  • $\begingroup$ But that won't get add-ons specifically enabled by the user, will it? It will also get add-ons that come pre-enabled? (I haven't tested this yet, just wondering.) $\endgroup$ – Ray Mairlot Feb 9 at 14:05
  • $\begingroup$ @RayMairlot Since users also have the ability to disable and re-enable the default add-ons, it's not possible to distinguish the default activated and user activated add-ons. You can only retrieve a list of currently active add-ons, how that state came to be is unknown. $\endgroup$ – Robert Gützkow Feb 9 at 14:09
  • $\begingroup$ So shouldn't that be in the answer as I think that is what the user is asking for? $\endgroup$ – Ray Mairlot Feb 9 at 16:25
  • $\begingroup$ @RayMairlot Updated the answer. $\endgroup$ – Robert Gützkow Feb 9 at 17:01
  • 1
    $\begingroup$ @BasaraKubikiri Yes that would be a way to solve this $\endgroup$ – Robert Gützkow Feb 10 at 7:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.