Auto enable addon?


(AFWS) #1

Is it possible to auto enable addon? Is there some line of code I could place in the addon. I found several lines of code ,but can’t seem to get anything to work.

Edit:
Solved my problem for what I was needing, still may be a better way to do it.

#1

addon_utils.enable(
        module_name, default_set=False, persistent=False, handle_error=None)

#2

import addon_utils
addon_utils.enable("my_addon")


#3

bpy.ops.wm.addon_enable(module = "addon")