I want to reload an addon using a script, however I cannot get the same functionality as pressing F8.

## What I'm trying to do:

The addon manuelbastionilab (http://www.manuelbastioni.com/) has some .json files which specify how to change blendshapes to make certain expressions. If I modify such a .json, it is not detected in Blender. If I press F8, this addon with its .json files are reloaded and everything is good.

However, now I want to achieve the same functionality in a script.

## What I tried

As suggest here: Is there a way to restart a modified addon? , I tried different combinations of (open Python console with Shift+F4):

bpy.utils.unregister_module('manuelbastionilab')
bpy.utils.register_module('manuelbastionilab')


But all didn't give the same functionality as F8. If I use one of these code lines in the build-in terminal in Blender, it does reload the addon, but the .json files are not reloaded.

I also tried import bge and then bge.events.F8KEY, but I get a NameError: name 'bge' is not defined.

## Question

How do I get script-wise the exact same functionality as F8? But preferably only for 1 addon?

• F8 is the equivalent of bpy.ops.script.reload() – batFINGER Dec 1 '17 at 10:48

The following worked for me in the Python console in Blender (Shift+F4 to open):
import imp

• Single line command for Blender 2.8 to reload 1 add-on: bpy.ops.preferences.addon_enable(module='manuelbastionilab') – NumesSanguis Apr 21 '19 at 5:30