I have the following register function:
def register(): bpy.utils.register_class(ModalOperator) bpy.ops.object.modal_operator('INVOKE_DEFAULT')
It'll work if I run the code from Blender's Text Editor, but will give the following error if I try to use it as add-on:
AttributeError: '_RestrictContext' object has no attribute 'scene'
Is there a way of running my modal operator on Blender's start (or on opening new file)?