I have an addon with a modal operator, I change the file (Operator) which is in the Blender scripts directory (Windows AppData path) in an external editor.
Then I use reload scripts to reload the addon. The init.py file is updated, I can also see the new version in the preferences if I change it, but the operator is not updated.
To update the operator I have to restart Blender. The operator is unregister in the unregister method:
def register():
bpy.utils.register_class(DP_OT_draw_operator)
def unregister():
bpy.utils.unregister_class(DP_OT_draw_operator)
It is derived from another class which extends Operator:
class DP_OT_draw_operator(BL_UI_OT_draw_operator):
bl_idname = "object.dp_ot_draw_operator"
bl_options = {'REGISTER' }
def __init__(self):
super().__init__()
self.panel = BL_UI_Drag_Panel(100, 400, 300, 200)
self.panel.bg_color = (0.2, 0.2, 0.2, 0.9)
Could this be a problem or that the Operator is a modal one?