I did some tests and concluded that there is a way to recover the behaviour of the register_module()
function.
I would like your opinion about this:
the solution is quite convoluted and big but works both in 2.7 and 2.8.
bl_info = {
"name": "myaddon",
"description": "it does stuff",
"author": "me",
"version": (500, 499, 1),
"blender": (2, 80, 0),
"location": "View3D",
"warning": "This is an test script",
"wiki_url": "",
"category": "Object" }
modules = [
"my_module",
"module_that_does_stuf",
"my_mesh_stuff",
"ui_panels",
]
import importlib
import bpy
for module in modules:
if module in locals():
importlib.reload(module)
else:
exec("from . import %s" % module)
classes = []
for module in modules:
module = locals()[module]
attributes = dir(module)
for thing in [getattr(module, attr) for attr in attributes]:
if hasattr(thing, "bl_idname"):
classes.append(thing)
def register():
for cls in classes:
bpy.utils.register_class(cls)
def unregister():
for cls in classes:
bpy.utils.unregister_class(cls)