Remove_user_installed_addons(cat='Experimental development', dry_run=False)Īs you can see, Blender provides us with an addon_utils If os.path.dirname(mod._file_).startswith(userdir):īpy.ops.wm.addon_remove(module=mod._name_) And yes, this code removes add-ons, not just disables them!įrom addon_utils import modules, module_bl_infoĭef remove_user_installed_addons(cat='Experimental development', dry_run=True): And keep back-ups, but careful people always do that, right? ). Removing stuff always carries the risk of accidental deletion so be careful (and use this snippet at your own risk. It is not an add-on itself, it is meant to be run from the command line inside Blender or from Blender's text editor (clicking Run Script). Tedious, but fortunately Blender can help. Removing a single add-on is simple but to remove a bunch of user installed add-ons is less so because you have to locate the Blender user config directory (which is different on various operating systems) and you'll have to open each add-on file (or _init_.py file in a subdirectory if it's a multi-file add-on) to see if it defines the relevant category. That way I can at least easily find them and see them grouped together in the user preferences. What I often do when I develop a collection of add-ons is define a common category for all of them that is not one of the predefined categories. I admit that this is probably not a problem many people have but as an add-on developer I find myself every now an then in the situation that I want remove a whole bunch of user installed add-ons in one go.
0 Comments
Leave a Reply. |