I'm trying to learn how to create a multifile addon, but its getting hard, I've tried out some ways but no sucess. the method that better worked was this. but it is giving me an error on line 17 now 'TypeError: ("reload() argumment must be module")' someone can help?

bl_info = {
    "name": "driven_shapes",
    "description": "",
    "author": "Your Name",
    "version": (0, 0, 1),
    "blender": (2, 78, 0),
    "location": "View3D",
    "warning": "This addon is still in development.",
    "wiki_url": "",
    "category": "Object" }

if "bpy" in locals():
    import importlib

    from . import shapesplit
    from . import driver_add
    from . import ui

def register():

def unregister():

if __name__ == "__main__":

You are getting the TypeError because of passing a string argument to the reload function. reload function expects a module object as its argument.

You could create a mapping of the modules you want reloaded and then pass the mapping's value to reload.

You can refer to an example from Blender's UI module for a thorough example.


reloading modules

building a mapping of modules to reload

| improve this answer | |
  • $\begingroup$ That is great. In general I have found Blender's factory Python scripts to be of high quality and a great resource to learn from. $\endgroup$ – satishgoda Jun 3 '17 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.