Scripting: Addons

Addons are merely an operator script with additional meta data for the addon manager:

bl_info = {
    "name": "My Script",
    "description": "Single line explaining what this script exactly does.",
    "author": "Oliver Reischl <clawjelly@gmail.com",
    "version": (1, 0),
    "blender": (2, 92, 0),
    "location": "View3D > Add > Mesh", # where to find it
    "warning": "", # used for warning icon and text in addons panel
    "wiki_url": "http://manuals.clawjelly.net",
    "support": "COMMUNITY", # or "TESTING"
    "category": "Add Mesh",
}

Blender Metainfo Wiki

Addon API additional Info

Multi-file packages

Splitting an addon into multiple files needs a special, rather clunky syntax/construct to make it editable.

bl_info = {
  "name": "Multi-file Packages Demo",
  "description": "This addon demos the Multi-file Packages construct",
  "blender": (3, 0, 0),
  "version" : (1, 0, 1),
  "category": "Demo",
  "author": "Oliver Reischl"
}

if "bpy" in locals(): # <------ Blender already started once
    import importlib
    importlib.reload(myLib)
else:  # <--------------------- Blender has not started yet
    from . import myLib

import os
import bpy
from bpy.props import CollectionProperty, PointerProperty, StringProperty

Multi-file Packages Info