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')
bpy.ops.wm.addon_disable(module='manuelbastionilab')
bpy.ops.wm.addon_disable(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?
bpy.ops.script.reload()
$\endgroup$