2
$\begingroup$

Pressing F8 reloads all addons. How can I call this from the python console?

Ultimately I want to make small startup script or addon that updates all the company addons. This brings up small related questions like, do startup scripts run before addons are loaded? Is reloading possible via script access?

$\endgroup$
1
$\begingroup$

I found this in the source code.

https://gitorious.org/blenderprojects/blender/commit/49c90bd

static int script_reload_exec(bContext *C, wmOperator *op)
{
#ifndef DISABLE_PYTHON
    BPY_eval_string(C, "__import__('bpy').utils.load_scripts(reload_scripts=True)");

    return OPERATOR_FINISHED;
#endif
    return OPERATOR_CANCELLED;
}

So I call this in python and it works.

bpy.utils.load_scripts(reload_scripts=True)
$\endgroup$

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.