Skip to main content
added 452 characters in body
Source Link
batFINGER
  • 85.2k
  • 10
  • 114
  • 244

On linux can select the folder and compress

enter image description here

A zip file that follows convention recommended here Addons: Only some .zips will install

Note: look for the error if it is saying the folder already exists then choose overwrite option, remove previous installation (delete folder, or hit remove button on addon)

The enabled addon,

The enabled addon,

On linux can select the folder and compress

enter image description here

A zip file that follows convention recommended here Addons: Only some .zips will install

Note: look for the error if it is saying the folder already exists then choose overwrite option, remove previous installation (delete folder, or hit remove button on addon)

The enabled addon,

added 1 character in body
Source Link
batFINGER
  • 85.2k
  • 10
  • 114
  • 244
bl_info = {
    "name": "Popup Macro",
    "author": "",
    "version": (1, 0),
    "blender": (2, 83, 0),
    "location": "DC_MT_macro_menu",
    "description": "",
    "warning": "",
    "doc_url": "",
    "category": "Testing",
}

# can use importlib.reload here instead 
import bpy
from testing_testing import operators, menus

modules = (operators, menus)


def register():
    for m in modules:
        m.register()


def unregister():
    for m in modules:
        m.uregisterunregister()


if __name__ == "__main__":
    register()
bl_info = {
    "name": "Popup Macro",
    "author": "",
    "version": (1, 0),
    "blender": (2, 83, 0),
    "location": "DC_MT_macro_menu",
    "description": "",
    "warning": "",
    "doc_url": "",
    "category": "Testing",
}

# can use importlib.reload here instead 
import bpy
from testing_testing import operators, menus

modules = (operators, menus)


def register():
    for m in modules:
        m.register()


def unregister():
    for m in modules:
        m.uregister()


if __name__ == "__main__":
    register()
bl_info = {
    "name": "Popup Macro",
    "author": "",
    "version": (1, 0),
    "blender": (2, 83, 0),
    "location": "DC_MT_macro_menu",
    "description": "",
    "warning": "",
    "doc_url": "",
    "category": "Testing",
}

# can use importlib.reload here instead 
import bpy
from testing_testing import operators, menus

modules = (operators, menus)


def register():
    for m in modules:
        m.register()


def unregister():
    for m in modules:
        m.unregister()


if __name__ == "__main__":
    register()
added 156 characters in body
Source Link
batFINGER
  • 85.2k
  • 10
  • 114
  • 244

Can alter the submodules by adding removing other classes without the need to edit init file. Only need to edit again for a new submodule. Can use something like pkgutils.list_modules to look for modules in root folder and automate the imports of each, hence never needing to touch init to have any module placed in folder registered.

The addonNote can betest if a module has a register method using

if hasattr(m, "register"):
    m.register()

The enabled addon,

To hang your menu onto another during register, recommend writing your own registerregister and unregisterunregister methods instead of using the factory generated methods.

Finally to make a shortcut to popup your menu, as displayed above the operator is "wm.call_menu" and set its name property to the bl_idname of your menu.

Can alter the submodules by adding removing other classes without the need to edit init file. Only need to edit again for a new submodule. Can use something like pkgutils.list_modules to look for modules in root folder and automate the imports of each.

The addon can be enabled,

To hang your menu onto another during register, recommend writing your own register and unregister methods instead of using the factory generated methods.

Can alter the submodules by adding removing other classes without the need to edit init file. Only need to edit again for a new submodule. Can use something like pkgutils.list_modules to look for modules in root folder and automate the imports of each, hence never needing to touch init to have any module placed in folder registered.

Note can test if a module has a register method using

if hasattr(m, "register"):
    m.register()

The enabled addon,

To hang your menu onto another during register, recommend writing your own register and unregister methods instead of using the factory generated methods.

Finally to make a shortcut to popup your menu, as displayed above the operator is "wm.call_menu" and set its name property to the bl_idname of your menu.

Source Link
batFINGER
  • 85.2k
  • 10
  • 114
  • 244
Loading