A Module Manager to integrate into your blender addons to automate the automation
Python 100.0%
3 1 0

Clone this repository

https://tangled.org/valerie-bosco.tngl.sh/ALXModuleManager
git@tangled.org:valerie-bosco.tngl.sh/ALXModuleManager

For self-hosted knots, clone URLs may differ based on your setup.

README.md

[ALX - Module Manager]#

Supported Blender versions by the system [ 4.0-4.5 ]

the system automatically registers and gathers all blender related classes from within the addon
this eliminates any necessity to manually decalare any registration except the function itself


Usage:#

Pre-Step #1:#

add the file or folder with file anywhere in your addon, preferrably in your_addon/modules/add_it_here

Step #1:#

in your __init__.py file simply import the module manager class in whatever format you desire:

an example if used with git submodules to keep it up to date in your repository

from .modules.ALXModuleManager.ALXModuleManager.ALX_ModuleManager import \
    Alx_Module_Manager

or more simply:

from ALX_ModuleManager import Alx_Module_Manager

note: Alx_Module_Manager is the class

Step #2:#

in your __init__.py file add the definition for the your addon:

module_manager = Alx_Module_Manager(
    # package path, 
    # will result automatically to the correct path when blender makes a package out of it
    path=__path__, 

    # global scope, this is where the module manager will run
    # no need for imports outside explicitly typed objects, the rest will be handled by the system
    globals=globals(),

    # mute the output of imports/registration logs in the console
    mute=True
)

Step #3:#

in your __init__.py file call the module manager in register/unregister:

def register():
    module_manager.developer_register_modules()

def unregister():
    module_manager.developer_unregister_modules()

note: to avoid error please call anything else after the module manager, except for properties if any of them are required at registration time, register them before module_manager.developer_register_modules()

Step #4:#

enjoy an easy refresh of any changes to your addon by simply pressing in blender F3 > script.reload

all that is necessary is for the edits to be done on the install location inside blender usally: C:\Users\User\AppData\Roaming\Blender Foundation\Blender\[blender_version]\scripts\addons\[your_addon_name] for github repos it's recommended to symlink the folder to the above location and work inside the github repo instead