Blender (2.70a) is crashing with segmentation faults when I enable/disable/reenable my addon. I've inherited a project with a multi-file package design. I'm suspect that some classes are not unregistering since they aren't being called when the addon's unregister gets called.
I've reviewed this cookbook. And in both examples there are no bpy.type.Operators except in the __init__.py file. But in my project some files have Operators and Panels and some don't.
Does anyone know if reregistering classes can cause a crash? What's the point of calling bpy.utils.unregister_module(__name__) if it doesn't unregister. Here is my __init__.py
bl_info = { 'name': 'MyTools', 'author': 'Me', 'version': (0, 3), 'blender': (2, 69, 0), 'location': 'bpy.ops.mytools', 'description': 'MyTools', 'warning': '', 'wiki_url': '', 'category': 'user'} import os import sys import importlib # import/reload all .py files dynamically for file_name in os.listdir(os.path.dirname(__file__)): if file_name == '__init__.py' or \ file_name[-3:] != '.py' or \ file_name[0] == '.' or \ file_name[0] == '#': continue module_name = 'mytool.' + file_name[:-3] __import__(module_name, locals(), globals()) module = sys.modules[module_name] if 'bpy' in locals(): print(module.__name__) importlib.reload(module) if 'bpy' in locals(): print('Reloaded Mytool AddOn') else: print('Imported Mytool AddOn') import bpy def register(): bpy.utils.register_module(__name__) def unregister(): bpy.utils.unregister_module(__name__) if __name__ == '__main__': register() And mock up of one of the other files. foo.py
from . import myUtils import bpy class myOp(bpy.types.Operator): bl_idname = "mytools.myop" bl_label = "my operator" def execute(self,context): self.report({'INFO'}, "awesome") return {'FINISHED'} bpy.utils.register_class(myOp) Is this as simple as adding register and unregister methods to all of my other .py files.