System Information
Operating system: Linux-5.15.4-x86_64-AMD_Ryzen_3_PRO_4350G_with_Radeon_Graphics-with-glibc2.33 64 Bits
Graphics card: AMD RENOIR (DRM 3.42.0, 5.15.4, LLVM 13.0.0) AMD 4.6 (Core Profile) Mesa 21.2.6
Blender Version
Broken: version: 2.93.0, branch: master, commit date: 2021-06-02 11:21, hash: rB84da05a8b806
2.93.6, 2.93.7, 3.0.0 and 3.1.0 all are broken.
Worked: (don't know)
Short description of error
Blender crashes while trying to display operator properties dialog (invoke_props_dialog) and add
the same operator as the modal handler (modal_handler_add(self))
I think it's the same problem as in the (closed) task T48196
Exact steps for others to reproduce the error
Try to invoke corresponding operator and then to return {'FINISHED'} or {'CANCELLED'} from the modal() handler.
Then blender crashes after pressing ESC or closing dialog.
Sample code:
import bpy
class TEST(bpy.types.Operator):
bl_idname = "test.modal"
bl_label = "test invoke props + modal"
test: bpy.props.StringProperty(
name="test",
description="test",
default=''
)
def draw(self, context):
col = self.layout.column(align=True)
col.prop(self, "test")
def invoke(self, context, event):
context.window_manager.invoke_props_dialog(self)
context.window_manager.modal_handler_add(self)
return {'RUNNING_MODAL'}
def execute(self, context):
return {'FINISHED'}
def modal(self, context, event):
if event.type in {'ESC'}:
return {'CANCELLED'}
return {'PASS_THROUGH'}
def register():
bpy.utils.register_class(TEST)
def unregister():
bpy.utils.unregister_class(TEST)
if __name__ == "__main__":
register()I think that impossibility of creating modal operators which can simultaneously have open properties
dialog for on-the-fly corrections lead to endless tries to create custom bgl-rendered UIs which is just
an unneeded overhead.
Please, review the mentioned bug, AFAIK it was already fixed but somehow reappeared upstream...