0
$\begingroup$

If you create an add-on which replaces existing menus in order to ex. add elements in between the existing elements, installing it works fine, but uninstalling it removes the entire menu. So the question is how to uninstall such an add-on and restore the previous menus?

In this folder: Blender Foundation\Blender 2.91\2.91\scripts\startup\bl_ui\ the default ui scripts are located, but how do I execute the UI script during the unregistering of the menu-altering-add-on?

$\endgroup$
0
$\begingroup$

You add this to the unregister function, pointing the the UI script of the affected editor:

    bpy.ops.script.python_file_run(filepath= bpy.utils.resource_path(type="LOCAL")+"\\scripts\\startup\\bl_ui\\space_sequencer.py")
    bpy.ops.script.reload()
$\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.