Blender Version
2.76
Using invoke_props_dialog or another function which requires RUNNING_MODAL in invoke (like fileselect_add) is not possible with a modal excution (ie using modal_handler_add and a modal() function).
The folowing code crash Blender.
import bpy
from bpy.props import IntProperty
class TEST(bpy.types.Operator):
bl_idname = "test.modal"
bl_label = "test invoke props + modal"
nb = IntProperty(name="int prop")
def invoke(self, context, event):
return context.window_manager.invoke_props_dialog(self)
def execute(self, context):
context.window_manager.modal_handler_add(self)
return {'RUNNING_MODAL'}
def modal(self, context, event):
if event.type in {'ESC'}:
return {'CANCELLED'}
return {'RUNNING_MODAL'}
def register():
bpy.utils.register_class(TEST)
def unregister():
bpy.utils.unregister_class(TEST)
if __name__ == "__main__":
register()